Skip to content
This repository was archived by the owner on Apr 6, 2026. It is now read-only.

Commit fd0376f

Browse files
authored
Switch to the to-be hf-nix repo (#141)
1 parent 28f8dd3 commit fd0376f

27 files changed

Lines changed: 86 additions & 2412 deletions

.github/workflows/build_kernel.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
nix_path: nixpkgs=channel:nixos-unstable
2020
- uses: cachix/cachix-action@v14
2121
with:
22-
name: kernel-builder
22+
name: huggingface
2323
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
2424
env:
2525
USER: github_runner

.github/workflows/build_kernel_rocm.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
nix_path: nixpkgs=channel:nixos-unstable
2020
- uses: cachix/cachix-action@v14
2121
with:
22-
name: kernel-builder
22+
name: huggingface
2323
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
2424
env:
2525
USER: github_runner

.github/workflows/nix_fmt.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ jobs:
1717
with:
1818
nix_path: nixpkgs=channel:nixos-unstable
1919
- name: Check formatting
20-
run: nix fmt -- -c ./
20+
run: nix fmt -- --ci

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ RUN echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf \
1919
&& chown -R 1000:1000 /home/nixuser /nix/var/nix/profiles/per-user/nixuser /nix/var/nix/gcroots/per-user/nixuser \
2020
# Install necessary packages
2121
&& nix profile install nixpkgs#cachix nixpkgs#git-lfs nixpkgs#gawk \
22-
&& cachix use kernel-builder
22+
&& cachix use huggingface
2323

2424
# Set permissions for Nix directories
2525
RUN chown -R nixuser:nixuser /nix
@@ -231,4 +231,4 @@ RUN chmod +x /home/nixuser/bin/cli.sh && \
231231
USER nixuser
232232

233233
# Use the cli.sh script directly
234-
ENTRYPOINT ["/home/nixuser/bin/cli.sh"]
234+
ENTRYPOINT ["/home/nixuser/bin/cli.sh"]

docs/nix.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ and `flake.lock` to your repository, this will ensure that kernel
1717
builds are reproducible.
1818

1919
Since the kernel builder depends on many packages (e.g. every supported
20-
PyTorch version), it is recommended to [enable the kernel-builder cache](https://app.cachix.org/cache/kernel-builder)
20+
PyTorch version), it is recommended to [enable the huggingface cache](https://app.cachix.org/cache/huggingface)
2121
to avoid expensive rebuilds.
2222

2323
The kernel builder also provides Nix development shells with all Torch

flake.lock

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

flake.nix

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,18 @@
33

44
inputs = {
55
flake-utils.url = "github:numtide/flake-utils";
6-
#nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable-small";
7-
nixpkgs.url = "github:danieldk/nixpkgs/cudatoolkit-12.9-kernel-builder";
6+
nixpkgs.follows = "hf-nix/nixpkgs";
87
flake-compat.url = "github:edolstra/flake-compat";
9-
rocm-nix = {
10-
url = "github:huggingface/rocm-nix";
11-
inputs.nixpkgs.follows = "nixpkgs";
12-
};
8+
hf-nix.url = "github:huggingface/hf-nix";
139
};
1410

1511
outputs =
1612
{
1713
self,
1814
flake-compat,
1915
flake-utils,
16+
hf-nix,
2017
nixpkgs,
21-
rocm-nix,
2218
}:
2319
let
2420
systems = with flake-utils.lib.system; [
@@ -32,7 +28,7 @@
3228
name = system;
3329
value = import ./lib/buildsets.nix {
3430
inherit nixpkgs system;
35-
rocm = rocm-nix.overlays.default;
31+
hf-nix = hf-nix.overlays.default;
3632
};
3733
}) systems
3834
);
@@ -131,7 +127,7 @@
131127

132128
in
133129
rec {
134-
formatter = pkgs.nixfmt-rfc-style;
130+
formatter = pkgs.nixfmt-tree;
135131

136132
packages = rec {
137133
build2cmake = pkgs.callPackage ./pkgs/build2cmake { };

lib/buildsets.nix

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
nixpkgs,
33
system,
4-
rocm,
4+
hf-nix,
55
}:
66

77
let
@@ -56,8 +56,8 @@ let
5656
rocmSupport = true;
5757
};
5858
overlays = [
59+
hf-nix
5960
overlay
60-
rocm
6161
];
6262
};
6363

@@ -75,6 +75,7 @@ let
7575
cudaSupport = true;
7676
};
7777
overlays = [
78+
hf-nix
7879
overlay
7980
(overlayForCudaVersion cudaVersion)
8081
];
@@ -96,8 +97,8 @@ let
9697
rocmSupport = true;
9798
};
9899
overlays = [
100+
hf-nix
99101
overlay
100-
rocm
101102
(overlayForRocmVersion rocmVersion)
102103
];
103104
};

overlay.nix

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,6 @@
1-
final: prev:
2-
{
3-
blas = if final.stdenv.isx86_64 then prev.blas.override { blasProvider = prev.mkl; } else prev.blas;
4-
lapack =
5-
if final.stdenv.isx86_64 then prev.lapack.override { lapackProvider = prev.mkl; } else prev.blas;
6-
1+
final: prev: {
72
cmakeNvccThreadsHook = prev.callPackage ./pkgs/cmake-nvcc-threads-hook { };
83

9-
magma-hip =
10-
(prev.callPackage ./pkgs/magma {
11-
cudaSupport = false;
12-
rocmSupport = true;
13-
}).magma;
14-
15-
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
16-
(
17-
python-self: python-super: with python-self; {
18-
torch_2_6 = callPackage ./pkgs/python-modules/torch_2_6 { rocmPackages = final.rocmPackages; };
19-
20-
torch_2_7 = callPackage ./pkgs/python-modules/torch_2_7 { rocmPackages = final.rocmPackages; };
21-
}
22-
)
23-
];
24-
254
# Local packages
265

276
kernel-abi-check = prev.callPackage ./pkgs/kernel-abi-check { };
@@ -30,4 +9,3 @@ final: prev:
309

3110
stdenvGlibc_2_27 = prev.callPackage ./pkgs/stdenv-glibc-2_27 { };
3211
}
33-
// (import ./pkgs/cutlass { pkgs = final; })

pkgs/cutlass/builder.nix

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)