[amdgpu] Calculate mcpu_ and compute_capability_ properly and with ROCm 6 compat#8667
Merged
Merged
Conversation
ee617f8 to
bf76688
Compare
Contributor
|
Great! |
f29d63b to
a871dfd
Compare
Contributor
|
/rebase |
…OCm 6 compat Signed-off-by: Gavin Zhao <git@gzgz.dev>
for more information, see https://pre-commit.ci
9656e39 to
fae4ea2
Compare
galeselee
approved these changes
Apr 5, 2025
Contributor
|
pre-commit failure is not related, force merging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: #6434 (part of)
Brief Summary
In the AMDGPU backend, we calculate
mcpu_directly based oncompute_capability_using integer addition. However, this can be problematic as themcpu_name is partially hex-based, e.g.compute_capability_ = 910corresponds tomcpu_ = "gfx90a". The proper and recommended way to getmcpu_is using fieldgcnArchName. Similarly,compute_capability_should be calculated using fieldsmajorandminorinstead ofgcnArch.Additionally, there are complications in ROCm 6 regarding calling
hipGetDevicePropertiesby looking up its ABI symbol inlibamdhip64.so. In ROCm 6, the ABI symbolhipGetDeviceProperties(likely) incorrectly maps to the ROCm 5 version ofhipGetDevicePropertieswhich is not ABI-compatible. To handle this, we first treathipGetDevicePropertiesas ROCm 5 version, and if the values we get don't make sense we then treat it as the ROCm 6 version.Walkthrough
copilot:walkthrough