Comments (13)
it is on my todo list but I am a bit short-handed momentarily. I will keep you posted. Thanks for the interest.
from hiop.
@nychiang, as far as I know we used a combination of clang C++ and gcc Fortran compilers to build HiOp with Fortran interface. My understanding is that ROCm bitcode library is specific to the clang intermediate representation and won't work with gcc. If flang is available and mature enough, one should go with that instead of combining different compilers imho.
@ashermancinelli, please chime in.
from hiop.
open :)
from hiop.
The following Fortran examples are given:
For sparse linear system:
https://github.com/LLNL/hiop/blob/develop/src/Drivers/Sparse/NlpSparseExHS071.f
https://github.com/LLNL/hiop/blob/develop/src/Drivers/Sparse/NlpSparseFEx1.f
For dense linear system:
https://github.com/LLNL/hiop/blob/develop/src/Drivers/Dense/NlpDenseConsFEx1.f
from hiop.
What is the status of this issue?
from hiop.
@nychiang : how stage is the Fortran interface?
from hiop.
On the platform with AMD GPU, some compiling error happened when HIOP_BUILD_SHARED
is set to ON
.
The error message is
/opt/rocm-4.5.0/amdgcn/bitcode/hip.bc: file not recognized: file format not recognized
This error prevents HiOp creating all the fortran related examples.
from hiop.
More details:
When Cmake links libraries from hip toolchain, e.g.,
target_link_libraries(hiop_hip INTERFACE hip::device Magma)
(Asher's approach)
or
target_link_libraries(hiop_hip INTERFACE hip::hiprand roc::rocrand hip::hipfft roc::hipblas roc::rocblas hip::hipcub roc::rocprim_hip Magma )
(my modification due to the usage of hiprand),
the new ROCm bitcode library /opt/rocm-4.5.0/amdgcn/bitcode/hip.bc
needs to be linked.
However, it seems that the fortran compiler ftn
doesnโt recognize this format and hence we received this error.
A quick solution is that we use flang
as the fortran compiler, since this bitcode is build by clang and several llvm development tools (https://github.com/RadeonOpenCompute/ROCm-Device-Libs).
Without any change to the existing hiop files, but just setting cmake flag -DCMAKE_Fortran_COMPILER=/opt/rocm-4.5.0/bin/amdflang
, all the unit tests work fine as well as the fortran examples.
@pelesh @cameronrutherford have you ever got similar problem like this? Can we use ftn
with bitcode library? (hard to find relevant discussions on google)
from hiop.
@nychiang, as far as I know we used a combination of clang C++ and gcc Fortran compilers to build HiOp with Fortran interface. My understanding is that ROCm bitcode library is specific to the clang intermediate representation and won't work with gcc. If flang is available and mature enough, one should go with that instead of combining different compilers imho.
@ashermancinelli, please chime in.
PR #514 adds a partial fix and allows using flang compiler on the problematic AMD/ROCm machine. Some investigation is needed to figure out use of gfortran. Nvidia/CUDA machines work fine with generic Fortran compilers.
from hiop.
This is great! But can the examples be written in modern Fortran? I don't think there is any reason to use the F77 format nowadays. Do you need some assistance with doing that?
from hiop.
This is what I have in mind: https://github.com/jacobwilliams/hiop/blob/modern-fortran/src/Drivers/Dense/NlpDenseConsFEx1.f90
from hiop.
This is what I have in mind: https://github.com/jacobwilliams/hiop/blob/modern-fortran/src/Drivers/Dense/NlpDenseConsFEx1.f90
We would be supportive of also using more recent Fortran for examples. Please feel free to take a shot and PR, our experience with Fortran is limited.
In the meanwhile I suggest we close this issue and open an issue re: examples in modern Fortran.
from hiop.
Will close this and we track the developement of a more modern F examples in isssue #532
from hiop.
Related Issues (20)
- Unnecessary dynamic_cast to hiopVectorPar in hiopHessianLowRank HOT 1
- update code style in hiopHessianLowRank
- Update CMake files for building HiOp and LiDO in co-develop mode
- Introduce more user parameters to control NLP scaling
- Update Ginkgo interface so it can take data directly on GPU HOT 1
- Narrowing conversion in Ginko HOT 7
- Install Ginkgo via Spack for HiOp HOT 1
- Primal regularizations for x and d are different
- Failure from the feasibility restoration
- `hiop~mpi` includes MPI headers HOT 6
- Segmentation fault when copying empty matrix in sparse GPU mode
- `hiop@develop%clang-rocm` unable to build HOT 5
- Hiop fails to build on Frontier with Exago build script from KPP2
- `hiop+cuda ^cuda@12` failes to build HOT 7
- Build with Strumpack enabled fails due to -Werror (`-Werror=unused-variable`, `-Werror=reorder`) HOT 4
- RAJA must be used when CUDA is selected. HOT 2
- Are versions retagged? HOT 4
- Cannot build with CUDA flag set ON HOT 3
- Update Incline CI to use ROCm 5.6.0/6.0.0 HOT 1
- Derivative checker
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hiop.