Skip to content

Commit 8ed7bb4

Browse files
authored
Update nixpkgs and other flake dependencies (#425)
* nix-builder: fix cache variant name lookups * {rocm,xpu}Packages: let `makeScope` define `callPackage` Before this change we erroneously inherited `callPackage` from nixpkgs. This `callPackage` does not have access to the new scope (the ROCm/XPU package set). However, this error was masked by `makeScope` overriding `callPackage`, so `final` had the correct version. The latest nixpkgs supports overriding `callPackage`, which surfaced this bug. * pythonWheelDepsCheckHook: do not use a conflicting name for disabling * nvidia-cutlass-dsl: remove unused stdenv argument * torch-bin: passing stdenv in the body is deprecated * torch-bin: disable nixpkgs runtime deps check hook We use our own hook. * libffi_3_3: skip check (fails upstream) * jupyter-server: disable pytest check This check takes a long time, sometimes times out, and is already checked upstream. * flake: bump up nixpkgs * rocmPackages.openmp-extras-runtime: libffi_3_2 is not needed anymore * nix fmt * XPU: fix `dlopen()` issue with loading Torch extension on recent glibc `dlopen` by the Python interpreter failed with: cannot enable executable stack as shared object requires: Invalid argument Pass the `-z noexecstack` to the linker to mark the library as not requiring an executable stack.
1 parent f8aab6d commit 8ed7bb4

14 files changed

Lines changed: 49 additions & 46 deletions

File tree

flake.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

kernel-builder/src/pyproject/templates/torch/preamble.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ elseif(GPU_LANG STREQUAL "SYCL")
178178
endif()
179179

180180

181-
set(sycl_link_flags "-fsycl;--offload-compress;-fsycl-targets=spir64_gen,spir64;-Xs;-device pvc,xe-lpg,ats-m150 -options ' -cl-intel-enable-auto-large-GRF-mode -cl-poison-unsupported-fp64-kernels -cl-intel-greater-than-4GB-buffer-required';")
181+
set(sycl_link_flags "-Wl,-z,noexecstack;-fsycl;--offload-compress;-fsycl-targets=spir64_gen,spir64;-Xs;-device pvc,xe-lpg,ats-m150 -options ' -cl-intel-enable-auto-large-GRF-mode -cl-poison-unsupported-fp64-kernels -cl-intel-greater-than-4GB-buffer-required';")
182182
set(sycl_flags "-fsycl;-fhonor-nans;-fhonor-infinities;-fno-associative-math;-fno-approx-func;-fno-sycl-instrument-device-code;--offload-compress;-fsycl-targets=spir64_gen,spir64;")
183183
set(GPU_FLAGS "${sycl_flags}")
184184
set(GPU_ARCHES "")

nix-builder/lib/build.nix

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
lib,
33
pkgs,
44

5-
# Every `buildSets` argument is a list of build sets. Each build set is
6-
# a attrset of the form
7-
#
8-
# { pkgs = <nixpkgs>, torch = <torch drv> }
9-
#
10-
# The Torch derivation is built as-is. So e.g. the ABI version should
11-
# already be set.
5+
# Every `buildSets` argument is a list of build sets. Each build set is
6+
# a attrset of the form
7+
#
8+
# { pkgs = <nixpkgs>, torch = <torch drv> }
9+
#
10+
# The Torch derivation is built as-is. So e.g. the ABI version should
11+
# already be set.
1212
}:
1313

1414
let

nix-builder/lib/cache.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
allOutputs python3.pkgs.nvidia-cutlass-dsl
3131
)
3232
);
33-
buildSetLinkFarm = buildSet: pkgs.linkFarm buildSet.torch.variant (buildSetOutputs buildSet);
33+
buildSetLinkFarm = buildSet: pkgs.linkFarm buildSet.variants.torch.arch (buildSetOutputs buildSet);
3434
in
3535
pkgs.linkFarm "packages-for-cache" (
3636
map (buildSet: {
37-
name = buildSet.torch.variant;
37+
name = buildSet.variants.torch.arch;
3838
path = buildSetLinkFarm buildSet;
3939
}) buildSets
4040
);

nix-builder/overlay.nix

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,6 @@ in
1818

1919
kernel-layout-check = prev.callPackage ./pkgs/kernel-layout-check { };
2020

21-
# Used by ROCm.
22-
libffi_3_2 = final.libffi_3_3.overrideAttrs (
23-
finalAttrs: _: {
24-
version = "3.2.1";
25-
src = final.fetchurl {
26-
url = with finalAttrs; "https://gcc.gnu.org/pub/${pname}/${pname}-${version}.tar.gz";
27-
hash = "sha256-0G67jh2aItGeONY/24OVQlPzm+3F1GIyoFZFaFciyjc=";
28-
};
29-
}
30-
);
31-
3221
nvtx = final.callPackage ./pkgs/nvtx { };
3322

3423
metal-cpp = final.callPackage ./pkgs/metal-cpp { };
@@ -128,6 +117,13 @@ in
128117
};
129118
});
130119

120+
jupyter-server = python-super.jupyter-server.overrideAttrs (
121+
_: prevAttrs: {
122+
# Gets stuck sometimes, already tested in nixpkgs.
123+
dontUsePytestCheck = true;
124+
}
125+
);
126+
131127
nvidia-cutlass-dsl = python-self.callPackage ./pkgs/python-modules/nvidia-cutlass-dsl { };
132128

133129
nvidia-cutlass-dsl-libs = python-self.callPackage ./pkgs/python-modules/nvidia-cutlass-dsl-libs { };

nix-builder/pkgs/python-modules/hooks/python-wheel-deps-check-hook.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pythonWheelDepsCheckHook() {
1515
echo "Finished executing pythonWheelDepsCheck"
1616
}
1717

18-
if [ -z "${dontCheckRuntimeDeps-}" ]; then
18+
if [ -z "${dontCheckWheelDeps-}" ]; then
1919
echo "Using pythonWheelDepsCheckHook"
2020
# Ideally, this would be post-install, but we have to guarantee
2121
# that the relax hook runs before this, so we move it a phase

nix-builder/pkgs/python-modules/nvidia-cutlass-dsl/default.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
lib,
3-
stdenv,
43
fetchPypi,
54
python,
65

nix-builder/pkgs/python-modules/torch/binary/generic.nix

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,11 @@ let
125125
};
126126

127127
in
128-
buildPythonPackage {
128+
buildPythonPackage.override { stdenv = effectiveStdenv; } {
129129
pname = "torch";
130130
inherit version;
131131
format = "wheel";
132132

133-
stdenv = effectiveStdenv;
134-
135133
outputs = [
136134
"out" # output standard python package
137135
"cxxdev" # propagated deps for the cmake consumers of torch
@@ -143,6 +141,9 @@ buildPythonPackage {
143141
inherit url hash;
144142
};
145143

144+
# We use our own pythonWheelDepsHook.
145+
dontCheckRuntimeDeps = true;
146+
146147
nativeBuildInputs = [
147148
pythonRelaxWheelDepsHook
148149
pythonWheelDepsCheckHook

nix-builder/pkgs/rocm-packages/clr.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
hip-runtime-amd,
1212
hsa-rocr,
1313
perl,
14-
rocm,
1514
rocm-core,
1615
rocm-device-libs,
1716
rocm-opencl,
@@ -34,7 +33,7 @@ let
3433
in
3534
stdenv.mkDerivation {
3635
pname = "rocm-clr";
37-
version = rocm.version;
36+
version = rocm-core.version;
3837

3938
nativeBuildInputs = [
4039
markForRocmRootHook

nix-builder/pkgs/rocm-packages/components.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ final: prev:
33
# Create a package for all components in the ROCm runfile metadata.
44
prev.lib.mapAttrs (
55
pname: metadata:
6-
prev.callPackage ./generic.nix {
6+
final.callPackage ./generic.nix {
77
inherit pname;
88
inherit (metadata) components deps version;
99
rocmPackages = final;

0 commit comments

Comments
 (0)