-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HIP: force max threads per block to be 1024 #11621
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ggml/src/ggml-hip/CMakeLists.txt
Outdated
@@ -40,6 +40,9 @@ find_package(hip REQUIRED) | |||
find_package(hipblas REQUIRED) | |||
find_package(rocblas REQUIRED) | |||
|
|||
# Workaround old compilers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please move this down a bit as the find_package calls and the version check below are logically related operations
I saw the discussion, but don't have any knowledge about HIP/ROCm to have an opinion about this. If you think that it is not likely to cause issues to other users, feel free to merge it. |
Some old compilers still use 256. Explicitly set it to 1024 to get correct result from ops like ARGMAX and GROUP_NORM. Related: ggml-org#10610, ggml-org#11619 Signed-off-by: fxzjshm <fxzjshm@163.com>
7e596d4
to
59ad593
Compare
@IMbackK Moved. Is this place proper? @slaren This compiler flag is documented at https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-gpu-max-threads-per-block. I've also compiled with ROCm 6.3.1 and no compile error is given, now testing test-backend-ops. Update: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just resets the default, also maximum value for all current amd gpus, it dosent change the code generation at all on sane versions of llvm at this time. We might run in to problems in the future if amd changes this for a new gpu arch - but i think this is an acceptable risk.
Some old/vendor forked version of llvm still use 256. Explicitly set it to 1024 to align with upstream llvm. Signed-off-by: fxzjshm <fxzjshm@163.com>
Some old/vendor forked version of llvm still use 256. Explicitly set it to 1024 to align with upstream llvm. Signed-off-by: fxzjshm <fxzjshm@163.com>
Some old/vendor forked version of llvm still use 256. Explicitly set it to 1024 to align with upstream llvm. Signed-off-by: fxzjshm <fxzjshm@163.com>
Some old compilers still use 256. Explicitly set it to 1024 to get correct result from ops like ARGMAX and GROUP_NORM.
Related: #10610, #11619
CC @IMbackK