MIOpen icon indicating copy to clipboard operation
MIOpen copied to clipboard

error: unknown argument: -fno-offload-uniform-block

Open trixirt opened this issue 2 years ago • 15 comments

The handling of WORKAROUND_SWDEV_413293 assumes a compile and does not check if passing -fno-offload-uniform-block is valid adding without checking in CMakeLists.txt

On Fedora Rawhide/F40, this is clang 17 clang version 17.0.6 (Fedora 17.0.6-6.fc40) The latest release of clang.

The option -fno-offload-uniform-block is in the to be released clang 18. It would be better to use check_cxx_compiler_flag() here.

trixirt avatar Feb 07 '24 13:02 trixirt

@trixirt Thanks for reporting the issue and proposing a way for fixing it.

It seems like you are not using clang from ROCm, please switch to it. If you are building MIOpen from sources, please use CXX='/opt/rocm/llvm/bin/clang++' cmake ...

check_cxx_compiler_flag() works only during the the building of the library. This won't work if the end user installs pre-built package.

Hope this helps.

[Notice] Clang from ROCm 6.0.0 supports -fno-offload-uniform-block but reports:

/opt/rocm/llvm/bin/clang++ --version
AMD clang version 17.0.0 (https://github.com/RadeonOpenCompute/llvm-project roc-6.0.0 23483 7208e8d15fbf218deb74483ea8c549c67ca4985e)

atamazov avatar Feb 07 '24 13:02 atamazov

I am packaging MIOpen for Fedora, so the Fedora clang compiler is required.

trixirt avatar Feb 07 '24 14:02 trixirt

@trixirt Hmm... But MIOpen needs HIP runtime at least to work (and the latter is a part of ROCm). Which version of ROCm is expected to be installed on the target Fedora system?

/cc @JehandadKhan @junliume

atamazov avatar Feb 07 '24 22:02 atamazov

Does something need to change in the compiler?

bcahoon avatar Feb 08 '24 00:02 bcahoon

Does something need to change in the compiler?

@bcahoon -fno-offload-uniform-block is not yet upstreamed? What would be the best practice for libraries to use it?

junliume avatar Feb 08 '24 00:02 junliume

Fedora has packaged up a large part of the ROCm 6.0 stack, all of the dependencies needed to build miopen are also in Fedora. ck and rocmlir are not yet in Fedora, ck because of build problems and rocmlir because of a clang fork. So these two configs are turned off in the miopen build.

All of the ROCm packages in Fedora are built with the system clang.

so though the -fno-offload-uniform-block has been upstreamed, it will not be usable by Fedora until clang 18 is released and Fedora updates to clang 18. So i am asking the the option be checked before it is used, here in the cmakelist.txt and src/comgr.cpp

trixirt avatar Feb 08 '24 13:02 trixirt

@trixirt 👌 Feature request accepted. Well, basically, this is W/A for current Fedora. Please let us know the importance/urgency of this.

atamazov avatar Feb 08 '24 15:02 atamazov

@trixirt Please also let us know which version (or branch/git hash) of MIOpen are you using.

atamazov avatar Feb 08 '24 15:02 atamazov

tag: rocm-6.0.0, releases/rocm-rel-6.0 miopen is a dependency for pytorch, when pytorch 2.3 is released, it will be build with rocm 6.x Fedora's pytorch.

trixirt avatar Feb 09 '24 13:02 trixirt

@trixirt This is a patch for MIOpen tag: rocm-6.0.0 (branch release/rocm-rel-6.0 commit f34a90f76). Please give it a try and let me know if it resolves the problem. By-product: Fix build with -DMIOPEN_USE_COMPOSABLEKERNEL=off for 6.0 release.

fix-issue-2734-rel-6.0-commit.zip

atamazov avatar Feb 09 '24 17:02 atamazov

@bcahoon -fno-offload-uniform-block is not yet upstreamed? What would be the best practice for libraries to use it?'

Hi @atamazov, the -fno-offload-unfiform-block option has been upstreamed, but it was added after the 17.0.6 clang release that is used/mentioned in the previous comment.

I think your commit addresses the original issue.

bcahoon avatar Feb 09 '24 17:02 bcahoon

@bcahoon Yeah, thanks for feedback.

atamazov avatar Feb 09 '24 17:02 atamazov

@trixirt PRs #2741 and #2743 will remain in the DRAFT state until we get your confirmation that patch resolves the issue.

atamazov avatar Feb 09 '24 19:02 atamazov

@trixirt We need your feedback, please.

atamazov avatar Feb 12 '24 15:02 atamazov

Looks good, here is where I am using it fedora's miopen specfile

trixirt avatar Feb 13 '24 17:02 trixirt