-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathversions.nix
38 lines (35 loc) · 1.18 KB
/
versions.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{ lib }:
rec {
# Supported CUDA versions by Torch version.
cudaVersionForTorch = {
"2.5" = [ "11.8" "12.1" "12.4" ];
"2.6" = [ "11.8" "12.4" "12.6" ];
};
cudaVersions = [ "11.8" "12.1" "12.4" "12.6" ];
# All build configurations supported by Torch. We may want to split
# this the CUDA versions by Torch version later, but the versions
# are currently the same.
buildConfigs =
let
torchVersions = [ "2.5" "2.6" ];
buildConfigsWithoutCuda = lib.cartesianProduct {
torchVersion = torchVersions;
cxx11Abi = [
true
false
];
};
# Cartesian product of the build configurations and the CUDA versions
# supported by the Torch in the build configuration. We can't use
# `cartesianProduct` here because of this CUDA -> Torch dependency.
cuda = lib.flatten (
map (
config:
map (cudaVersion: config // { inherit cudaVersion; gpu = "cuda"; }) cudaVersionForTorch.${config.torchVersion}
) buildConfigsWithoutCuda
);
# ROCm always uses the C++11 ABI.
rocm = map (torchVersion: { inherit torchVersion; gpu = "rocm"; cxx11Abi = true; }) torchVersions;
in
cuda ++ rocm;
}