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

Commit eb31541

Browse files
committed
Check Torch minver/maxver handling with Nix
1 parent 48f21ac commit eb31541

4 files changed

Lines changed: 30 additions & 3 deletions

File tree

.github/workflows/nix_fmt.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Check Nix formatting"
1+
name: "Nix checks"
22
on:
33
push:
44
branches: [main]
@@ -9,7 +9,7 @@ on:
99

1010
jobs:
1111
build:
12-
name: Check Nix formatting
12+
name: Nix checks
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
@@ -18,3 +18,5 @@ jobs:
1818
nix_path: nixpkgs=channel:nixos-unstable
1919
- name: Check formatting
2020
run: nix fmt -- --ci
21+
- name: Nix checks
22+
run: nix build .\#checks.x86_64-linux.default

examples/relu-torch-bounds/build.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ universal = false
44

55
[torch]
66
src = ["torch-ext/torch_binding.cpp", "torch-ext/torch_binding.h"]
7-
minver = "2.8"
7+
minver = "2.9"
88
maxver = "2.9"
99

1010
[kernel.relu]

flake.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@
118118

119119
in
120120
rec {
121+
checks.default = pkgs.callPackage ./lib/checks.nix {
122+
inherit buildSets;
123+
build = defaultBuildPerSystem.${system};
124+
};
125+
121126
formatter = pkgs.nixfmt-tree;
122127

123128
packages =

lib/checks.nix

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
lib,
3+
runCommand,
4+
5+
build,
6+
buildSets,
7+
}:
8+
9+
let
10+
kernelBuildSets = build.applicableBuildSets {
11+
inherit buildSets;
12+
path = ../examples/relu-torch-bounds;
13+
};
14+
in
15+
assert lib.assertMsg (builtins.all (buildSet: buildSet.torch.version == "2.9.0") kernelBuildSets) ''
16+
Torch minver/maxver filtering does not work.
17+
'';
18+
runCommand "builder-nix-checks" { } ''
19+
touch $out
20+
''

0 commit comments

Comments
 (0)