Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/source/builder/build-variants.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ available. This list will be updated as new PyTorch versions are released.
- `torch212-cxx11-rocm72-x86_64-linux`
- `torch213-cxx11-rocm71-x86_64-linux`
- `torch213-cxx11-rocm72-x86_64-linux`
- `torch214-cxx11-rocm714-x86_64-linux`
- `torch214-cxx11-rocm72-x86_64-linux`

## XPU x86_64-linux
Expand Down
1 change: 1 addition & 0 deletions nix-builder/build-variants.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"torch212-cxx11-rocm72-x86_64-linux",
"torch213-cxx11-rocm71-x86_64-linux",
"torch213-cxx11-rocm72-x86_64-linux",
"torch214-cxx11-rocm714-x86_64-linux",
"torch214-cxx11-rocm72-x86_64-linux"
],
"xpu": [
Expand Down
22 changes: 14 additions & 8 deletions nix-builder/lib/extension/torch/arch.nix
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,20 @@ stdenv.mkDerivation (prevAttrs: {
)
++ lib.optionals rocmSupport (
with rocmPackages;
[
hipcub-devel
hipsparselt
rocprim-devel
rocthrust-devel
rocshmem-devel
rocwmma-devel
]
if theRock then
[
amdrocm-ccl-devel
amdrocm-hipblas-common-devel
]
else
[
hipcub-devel
hipsparselt
rocprim-devel
rocthrust-devel
rocshmem-devel
rocwmma-devel
]
)
++ lib.optionals xpuSupport ([
oneapi-torch-dev
Expand Down
4 changes: 4 additions & 0 deletions nix-builder/overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,10 @@ final: prev:
inherit (final) callPackage;
inherit (prev) lib;
})
// (import ./pkgs/rocm-packages-old {
inherit (final) callPackage;
inherit (prev) lib;
})
Comment on lines +291 to +294

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neato

// (import ./pkgs/xpu-packages {
inherit (final) callPackage;
inherit (prev) lib;
Expand Down
1 change: 1 addition & 0 deletions nix-builder/pkgs/aotriton/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ in

hashes = {
"7.2" = "sha256-HN7rt+9hq2kfuh2B2pGbnbXYvvKCaciSowvROgSVt6A=";
"7.14" = "sha256-ehOXl8FrAC/V2bzXBtNtyYGbsQiHcVD4GG2iHQWQ6qY=";
};

images = mkImages version [
Expand Down
7 changes: 3 additions & 4 deletions nix-builder/pkgs/aotriton/generic.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
autoPatchelfHook,
clr,
fetchurl,
lib,
rocm-core,
rocmPackages,
stdenv,
xz,
}:
Expand All @@ -15,7 +14,7 @@
}:

let
rocmVersion = lib.versions.majorMinor rocm-core.version;
rocmVersion = lib.versions.majorMinor rocmPackages.version;
hash =
hashes.${rocmVersion}
or (throw "aotriton ${version} binary package is not specified for ROCm ${rocmVersion}");
Expand All @@ -31,9 +30,9 @@ stdenv.mkDerivation {

nativeBuildInputs = [ autoPatchelfHook ];
buildInputs = [
clr
stdenv.cc.cc.lib
xz
rocmPackages.clr
];

dontConfigure = true;
Expand Down
2 changes: 1 addition & 1 deletion nix-builder/pkgs/python-modules/torch/binary/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let
if cudaSupport then
"cu${flattenVersion cudaPackages.cudaMajorMinorVersion}"
else if rocmSupport then
"rocm${flattenVersion (lib.versions.majorMinor rocmPackages.rocm.version)}"
"rocm${flattenVersion (lib.versions.majorMinor rocmPackages.version)}"
else if xpuSupport then
"xpu"
else
Expand Down
78 changes: 46 additions & 32 deletions nix-builder/pkgs/python-modules/torch/binary/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -91,36 +91,49 @@ let

paths =
with rocmPackages;
[
aotriton
clr
comgr
hipblas
hipblas-common-devel
hipblaslt
hipfft
hipify-clang
hiprand
hipsolver
hipsparse
hipsparselt
hsa-rocr
miopen-hip
rccl
rocblas
rocm-core
rocm-device-libs
rocm-hip-runtime
rocm-smi-lib
rocminfo
rocrand
rocsolver
rocsparse
roctracer
]
++ lib.optionals (versionAtLeast version "2.12") [
rocprofiler-sdk
];
if rocmPackages.theRock then
[
aotriton
clr
amdrocm-blas
amdrocm-dnn
amdrocm-fft
amdrocm-hipfile
amdrocm-profiler-base
amdrocm-rand
amdrocm-rccl
]
else
[
aotriton
clr
comgr
hipblas
hipblas-common-devel
hipblaslt
hipfft
hipify-clang
hiprand
hipsolver
hipsparse
hipsparselt
hsa-rocr
miopen-hip
rccl
rocblas
rocm-core
rocm-device-libs
rocm-hip-runtime
rocm-smi-lib
rocminfo
rocrand
rocsolver
rocsparse
roctracer
]
++ lib.optionals (versionAtLeast version "2.12") [
rocprofiler-sdk
];

postBuild = ''
# Fix `setuptools` not being found
Expand Down Expand Up @@ -233,9 +246,9 @@ buildPythonPackage.override { stdenv = effectiveStdenv; } {
++ lib.optionals (cudaSupport && versionAtLeast version "2.9") [
cudaPackages.libnvshmem
]
++ lib.optionals rocmSupport ([
++ lib.optionals rocmSupport [
rocmtoolkit_joined
])
]
++ lib.optionals xpuSupport (
with xpuPackages;
[
Expand Down Expand Up @@ -330,6 +343,7 @@ buildPythonPackage.override { stdenv = effectiveStdenv; } {
)
)
++ lib.optionals rocmSupport [
"rocm"
# Ours is called 'triton'. Remove this once we build ROCm Triton from
# a binary wheel.
"triton-rocm"
Expand Down
24 changes: 24 additions & 0 deletions nix-builder/pkgs/rocm-packages-old/bintools-unwrapped.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
runCommand,
llvm,
}:

runCommand "rocm-llvm-binutils-${llvm.version}" { preferLocalBuild = true; } ''
mkdir -p $out/bin

for prog in ${llvm}/llvm/bin/*; do
ln -sf $prog $out/bin/$(basename $prog)
done

ln -s ${llvm}/llvm/bin/llvm-ar $out/bin/ar
ln -s ${llvm}/llvm/bin/llvm-as $out/bin/as
ln -s ${llvm}/llvm/bin/llvm-dwp $out/bin/dwp
ln -s ${llvm}/llvm/bin/llvm-nm $out/bin/nm
ln -s ${llvm}/llvm/bin/llvm-objcopy $out/bin/objcopy
ln -s ${llvm}/llvm/bin/llvm-objdump $out/bin/objdump
ln -s ${llvm}/llvm/bin/llvm-ranlib $out/bin/ranlib
ln -s ${llvm}/llvm/bin/llvm-readelf $out/bin/readelf
ln -s ${llvm}/llvm/bin/llvm-size $out/bin/size
ln -s ${llvm}/llvm/bin/llvm-strip $out/bin/strip
ln -s ${llvm}/llvm/bin/lld $out/bin/ld
''
Loading
Loading