-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Let aotriton.cmake detect the best binary package to use, and deprecate aotriton_version.txt #137443
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
Let aotriton.cmake detect the best binary package to use, and deprecate aotriton_version.txt #137443
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/137443
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 79ad25f with merge base ebeb433 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@jithunnair-amd shall we use this PR to bump to 0.7.1b as well? |
jithunnair-amd
left a comment
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.
LGTM, let's make sure various CI workflows run successfully
No, I'd prefer we do that in a different PR |
Fix tarball's suffix
Read rocm version from variables set by LoadHIP.cmake
Copy AOTRITON_INSTALLED_PREFIX/* to torch/
Otherwise bdist_wheel will miss libaotriton_v2.so
Fix problems in aotriton.cmake
Guard against new ROCM environment
This also updates aotriton_version.txt's format
Supply ROCM versions and SHA256 checksums as lists.
Let install_aotriton.sh parse the new format of aotriton_version.txt
Do not hardcode __AOTRITON_ARCH
Updates to aotriton build steps and Dockerfiles (#1599)
Changes cherry-picked from pytorch#137443
Fix tarball's suffix
Read rocm version from variables set by LoadHIP.cmake
Copy AOTRITON_INSTALLED_PREFIX/* to torch/
Otherwise bdist_wheel will miss libaotriton_v2.so
Fix problems in aotriton.cmake
Guard against new ROCM environment
This also updates aotriton_version.txt's format
Supply ROCM versions and SHA256 checksums as lists.
Let install_aotriton.sh parse the new format of aotriton_version.txt
Do not hardcode __AOTRITON_ARCH
Updates to aotriton build steps and Dockerfiles (#1599)
Changes cherry-picked from pytorch#137443
|
Confirmed the new algorithm's correctness with set(__AOTRITON_ROCM_LIST
"rocm6.1"
"rocm6.2"
"rocm6.4"
)
set(detection_lists
"6.0"
"6.1"
"6.2"
"6.3"
"6.4"
)
foreach(__AOTRITON_SYSTEM_ROCM IN LISTS detection_lists)
list(GET __AOTRITON_ROCM_LIST 0 __AOTRITON_ROCM_DEFAULT_STR)
# Initialize __AOTRITON_ROCM to lowest version, in case all builds > system's ROCM
string(SUBSTRING ${__AOTRITON_ROCM_DEFAULT_STR} 4 -1 __AOTRITON_ROCM)
foreach(AOTRITON_ROCM_BUILD_STR IN LISTS __AOTRITON_ROCM_LIST)
# len("rocm") == 4
string(SUBSTRING ${AOTRITON_ROCM_BUILD_STR} 4 -1 AOTRITON_ROCM_BUILD)
# Find the last build that <= system's ROCM
# Assume the list is from lower to higher
if(AOTRITON_ROCM_BUILD VERSION_GREATER __AOTRITON_SYSTEM_ROCM)
break()
endif()
set(__AOTRITON_ROCM ${AOTRITON_ROCM_BUILD})
endforeach()
message(STATUS "System ROCM ${__AOTRITON_SYSTEM_ROCM}, Selected Package ${__AOTRITON_ROCM}")
endforeach()Output |
|
Current plan: let's send varlen/nestedtensor support, which requires some fixes in AOTriton 0.7.2b, and then update this PR. |
a112857 to
9ce8535
Compare
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
Successfully rebased |
9ce8535 to
ecbdf92
Compare
|
@jeffdaily Please review and approve if it looks good. |
|
@pytorchbot merge -f "Rocm CI jobs passed. Wheel build jobs also passed, installing all aotriton files during Pytorch build as expected" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
This is backported from upstream PR pytorch#140172, pytorch#137443 and pytorch#139432. Original commit message of pytorch#140172: Notable new features for SDPA operators on AMD systems from AOTriton 0.8b: 1. Nestedtensor support; 2. MQA/GQA support; 3. Restore Efficient attention support for causal=True and seqlen_q != seqlen_k cases; + The kernel should use top-left alignment, bottom right alignment will be added later 4. Move gfx1100 (RX7900/W7800/W7900) out of experimental support status. However, users are strongly recommended to update to ROCM 6.2.4, notably for its firmware updates. Related unit tests are enabled as well. Notable related changes from AOTriton 0.8b: 1. AOTriton 0.8b moves the GPU kernel out of libaotriton.so to a separate directory `aotriton.images`; 2. LZMA replaces ZSTD as GPU kernel compression algorithm for better compression ratio: aotriton0.8b (.so + aotriton.images take 350MB) compared to aotriton0.7b .so: 800MB 3. The compression cannot be disabled now, and `liblzma` is hard run-time dependency. + Should not be a problem, since `lzma` is part of Python Standard Library Pull Request resolved: pytorch#140172 Approved by: https://github.com/jithunnair-amd, https://github.com/jeffdaily Co-authored-by: Jithun Nair <[email protected]>
The previous port of upstream PR pytorch#137443 is incomplete
The previous port of upstream PR pytorch#137443 is incomplete Fixes #SWDEV-509002
This is backported from upstream PR pytorch#140172, pytorch#137443 and pytorch#139432. Original commit message of pytorch#140172: Notable new features for SDPA operators on AMD systems from AOTriton 0.8b: 1. Nestedtensor support; 2. MQA/GQA support; 3. Restore Efficient attention support for causal=True and seqlen_q != seqlen_k cases; + The kernel should use top-left alignment, bottom right alignment will be added later 4. Move gfx1100 (RX7900/W7800/W7900) out of experimental support status. However, users are strongly recommended to update to ROCM 6.2.4, notably for its firmware updates. Related unit tests are enabled as well. Notable related changes from AOTriton 0.8b: 1. AOTriton 0.8b moves the GPU kernel out of libaotriton.so to a separate directory `aotriton.images`; 2. LZMA replaces ZSTD as GPU kernel compression algorithm for better compression ratio: aotriton0.8b (.so + aotriton.images take 350MB) compared to aotriton0.7b .so: 800MB 3. The compression cannot be disabled now, and `liblzma` is hard run-time dependency. + Should not be a problem, since `lzma` is part of Python Standard Library Pull Request resolved: pytorch#140172 Approved by: https://github.com/jithunnair-amd, https://github.com/jeffdaily Fixes #ISSUE_NUMBER --------- Co-authored-by: Jithun Nair <[email protected]>
…te aotriton_version.txt (pytorch#137443) We do not need `install_aotriton.sh` and `aotriton_version.txt` any more since `aotriton.cmake` now installs the best binary release package as the default option when building pytorch. This should resolve the issue of needing a pre-installed aotriton package when building PyTorch for ROCm from source, which is not feasible if building PyTorch *outside* a CI docker image. With this change, a user can have a pre-installed AOTriton in their environment, if desired, and have the build pick it up by specifying the `AOTRITON_INSTALLED_PREFIX` env var, or have the build automatically detect and install the compatible version. As a third option, the user can also force AOTriton to build from source instead, using the `AOTRITON_INSTALL_FROM_SOURCE` env var. Also, with the changes in this PR, the cmake build process handles the tasks of copying aotriton .so and images directory from `torch/lib` to the installation path. Pull Request resolved: pytorch#137443 Approved by: https://github.com/jithunnair-amd, https://github.com/jeffdaily Co-authored-by: Jithun Nair <[email protected]>
…pport ========================================================================== Let aotriton.cmake detect the best binary package to use, and deprecate aotriton_version.txt (pytorch#137443) We do not need `install_aotriton.sh` and `aotriton_version.txt` any more since `aotriton.cmake` now installs the best binary release package as the default option when building pytorch. This should resolve the issue of needing a pre-installed aotriton package when building PyTorch for ROCm from source, which is not feasible if building PyTorch *outside* a CI docker image. With this change, a user can have a pre-installed AOTriton in their environment, if desired, and have the build pick it up by specifying the `AOTRITON_INSTALLED_PREFIX` env var, or have the build automatically detect and install the compatible version. As a third option, the user can also force AOTriton to build from source instead, using the `AOTRITON_INSTALL_FROM_SOURCE` env var. Also, with the changes in this PR, the cmake build process handles the tasks of copying aotriton .so and images directory from `torch/lib` to the installation path. Pull Request resolved: pytorch#137443 Approved by: https://github.com/jithunnair-amd, https://github.com/jeffdaily Co-authored-by: Jithun Nair <[email protected]> (cherry picked from commit bc57635) Bump AOTriton to 0.8.2b (#1853) Fixes SWDEV-508774 (cherry picked from commit 4bed249) Enable head_dim == 512 with AOTriton 0.8.1 (cherry picked from commit 6edd36f) Add unit tests for head dimension 512 (cherry picked from commit 85290fa)
…pport ========================================================================== Let aotriton.cmake detect the best binary package to use, and deprecate aotriton_version.txt (pytorch#137443) We do not need `install_aotriton.sh` and `aotriton_version.txt` any more since `aotriton.cmake` now installs the best binary release package as the default option when building pytorch. This should resolve the issue of needing a pre-installed aotriton package when building PyTorch for ROCm from source, which is not feasible if building PyTorch *outside* a CI docker image. With this change, a user can have a pre-installed AOTriton in their environment, if desired, and have the build pick it up by specifying the `AOTRITON_INSTALLED_PREFIX` env var, or have the build automatically detect and install the compatible version. As a third option, the user can also force AOTriton to build from source instead, using the `AOTRITON_INSTALL_FROM_SOURCE` env var. Also, with the changes in this PR, the cmake build process handles the tasks of copying aotriton .so and images directory from `torch/lib` to the installation path. Pull Request resolved: pytorch#137443 Approved by: https://github.com/jithunnair-amd, https://github.com/jeffdaily Co-authored-by: Jithun Nair <[email protected]> (cherry picked from commit bc57635) Bump AOTriton to 0.8.2b (#1853) Fixes SWDEV-508774 (cherry picked from commit 4bed249) Enable head_dim == 512 with AOTriton 0.8.1 (cherry picked from commit 6edd36f) Add unit tests for head dimension 512 (cherry picked from commit 85290fa)
…te aotriton_version.txt (pytorch#137443) We do not need `install_aotriton.sh` and `aotriton_version.txt` any more since `aotriton.cmake` now installs the best binary release package as the default option when building pytorch. This should resolve the issue of needing a pre-installed aotriton package when building PyTorch for ROCm from source, which is not feasible if building PyTorch *outside* a CI docker image. With this change, a user can have a pre-installed AOTriton in their environment, if desired, and have the build pick it up by specifying the `AOTRITON_INSTALLED_PREFIX` env var, or have the build automatically detect and install the compatible version. As a third option, the user can also force AOTriton to build from source instead, using the `AOTRITON_INSTALL_FROM_SOURCE` env var. Also, with the changes in this PR, the cmake build process handles the tasks of copying aotriton .so and images directory from `torch/lib` to the installation path. Pull Request resolved: pytorch#137443 Approved by: https://github.com/jithunnair-amd, https://github.com/jeffdaily Co-authored-by: Jithun Nair <[email protected]>
We do not need
install_aotriton.shandaotriton_version.txtany more sinceaotriton.cmakenow installs the best binary release package as the default option when building pytorch.This should resolve the issue of needing a pre-installed aotriton package when building PyTorch for ROCm from source, which is not feasible if building PyTorch outside a CI docker image. With this change, a user can have a pre-installed AOTriton in their environment, if desired, and have the build pick it up by specifying the
AOTRITON_INSTALLED_PREFIXenv var, or have the build automatically detect and install the compatible version. As a third option, the user can also force AOTriton to build from source instead, using theAOTRITON_INSTALL_FROM_SOURCEenv var.Also, with the changes in this PR, the cmake build process handles the tasks of copying aotriton .so and images directory from
torch/libto the installation path.cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @dllehr-amd @jataylo @hongxiayang @naromero77amd