feat: prefer aotrion from release#541
Merged
Merged
Conversation
f0680b9 to
6e03fa7
Compare
danieldk
reviewed
May 13, 2026
Comment on lines
+57
to
+73
| installCheckPhase = '' | ||
| runHook preInstallCheck | ||
|
|
||
| cmakeFlags = [ | ||
| # Disable building kernels if no supported targets are enabled | ||
| (lib.cmakeBool "AOTRITON_NOIMAGE_MODE" true) | ||
| # Use preinstalled triton from our python's site-packages | ||
| (lib.cmakeBool "AOTRITON_INHERIT_SYSTEM_SITE_TRITON" true) | ||
| # Avoid kernels being skipped if build host is overloaded | ||
| (lib.cmakeFeature "AOTRITON_GPU_BUILD_TIMEOUT" "0") | ||
| (lib.cmakeFeature "CMAKE_CXX_COMPILER" compiler) | ||
| # Manually define CMAKE_INSTALL_<DIR> | ||
| # See: https://github.com/NixOS/nixpkgs/pull/197838 | ||
| (lib.cmakeFeature "CMAKE_INSTALL_BINDIR" "bin") | ||
| (lib.cmakeFeature "CMAKE_INSTALL_LIBDIR" "lib") | ||
| (lib.cmakeFeature "CMAKE_INSTALL_INCLUDEDIR" "include") | ||
| (lib.cmakeFeature "AOTRITON_TARGET_ARCH" gpuTargets') | ||
| (lib.cmakeBool "AOTRITON_USE_TORCH" false) | ||
| ]; | ||
| test -f "$out/lib/libaotriton_v2.so" | ||
| test -d "$out/lib/aotriton.images" | ||
| python - <<PY | ||
| import ctypes | ||
| import os | ||
|
|
||
| ctypes.CDLL( | ||
| "$out/lib/libaotriton_v2.so", | ||
| mode=os.RTLD_NOW | os.RTLD_LOCAL, | ||
| ) | ||
| PY | ||
|
|
||
| runHook postInstallCheck | ||
| ''; |
Member
There was a problem hiding this comment.
Hmmm, I don't think this adds much to all the fixup stuff that the build already does.
If we want to test this, it's probably best to make passthru tests, one to verify that Torch loads with aotrition. Second that actually does some computation that triggers aotriton use (but we'd need a ROCm GPU to actually run it).
Collaborator
Author
There was a problem hiding this comment.
thanks for the suggestion, removed the installCheckPhase in latest commit. do you think it makes sense to add the passthru tests somewhere?
Member
There was a problem hiding this comment.
As long as we cannot run it on the GPU, it does not seem that useful to have the passthru test, since loadability is already checked when ROCm Torch gets built:
❯ ldd result/torch210-cxx11-rocm71-x86_64-linux/torch-out/lib/python3.13/site-packages/torch/_C.cpython-313-x86_64-linux-gnu.so | grep ao
libaotriton_v2.so.0.11.1 => /nix/store/k85zxmmnjfyhji6b5q6y9yhs2i4f1ajq-rocm-merged/lib/libaotriton_v2.so.0.11.1 (0x00007260c4400000)
❯ grep "pythonImportsCheck" nix-builder/pkgs/python-modules/torch/binary/generic.nix
pythonImportsCheck = [ "torch" ];
sayakpaul
pushed a commit
that referenced
this pull request
May 19, 2026
* feat: prefer aotrion from release * fix: resolve libamdhip * fix: remove installCheckPhase
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.
This PR avoids compiling aotrion and prefers using the prebuilt
libaotriton_v2.sofrom https://github.com/ROCm/aotriton/releasesexample of contents from
https://github.com/ROCm/aotriton/releases/download/0.11b/aotriton-0.11b-manylinux_2_28_x86_64-rocm6.2-shared.tar.gz
├── include │ └── aotriton │ ├── _internal │ │ ├── aiter_hip_common.h │ │ ├── flash │ │ │ └── aiter.h │ │ ├── kernel_cluster.h │ │ ├── lazy_tensor_internal.h │ │ ├── packed_kernel.h │ │ ├── triton_kernel.h │ │ └── util.h │ ├── config.h │ ├── cpp_tune.h │ ├── dtypes.h │ ├── flash.h │ ├── runtime.h │ ├── util.h │ └── v2 │ └── flash.h └── lib ├── cmake │ └── aotriton │ ├── aotriton-config-version.cmake │ ├── aotriton-config.cmake │ ├── aotriton-targets-release.cmake │ └── aotriton-targets.cmake ├── libaotriton_v2.so -> libaotriton_v2.so.0.11.2 └── libaotriton_v2.so.0.11.2