diff --git a/pkg/config/compatibility.go b/pkg/config/compatibility.go index ae9f5c68ca..c2dc249205 100644 --- a/pkg/config/compatibility.go +++ b/pkg/config/compatibility.go @@ -231,6 +231,16 @@ func latestCuDNNForCUDA(cuda string) (string, error) { } } sort.Slice(cuDNNs, func(i, j int) bool { + // Starting with CUDA 12.3/12.4 (the cuDNN 9 era), + // NVIDIA stopped encoding the cuDNN version in + // the CUDA image tag. So instead of ...-cudnn8-... + // you now just get ...-cudnn-... + // (e.g. 12.8.0-cudnn-devel-ubuntu22.04). The image + // contains “the latest cuDNN 9.x available when + // the image was built,” not a fixed 9.x.y number. + if cuDNNs[i] == "" || cuDNNs[j] == "" { + return false + } return version.Greater(cuDNNs[i], cuDNNs[j]) }) if len(cuDNNs) == 0 { diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 2aeba66454..0f25c52459 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -7,6 +7,8 @@ import ( "path/filepath" "testing" + "github.com/replicate/cog/pkg/util/version" + "github.com/hashicorp/go-version" "github.com/stretchr/testify/require" "gopkg.in/yaml.v2" @@ -297,7 +299,9 @@ func TestValidateAndCompleteCUDAForAllTorch(t *testing.T) { require.Equal(t, "", config.Build.CuDNN) } else { require.NotEqual(t, "", config.Build.CUDA) - require.NotEqual(t, "", config.Build.CuDNN) + if version.MustVersion(*compat.CUDA).Less(version.MustVersion("13.0")) { + require.NotEqual(t, "", config.Build.CuDNN) + } } } } diff --git a/pkg/config/cuda_base_images.json b/pkg/config/cuda_base_images.json index c04c0f6d65..515676cb96 100644 --- a/pkg/config/cuda_base_images.json +++ b/pkg/config/cuda_base_images.json @@ -1,4 +1,46 @@ [ + { + "Tag": "13.0.2-cudnn-devel-ubuntu24.04", + "CUDA": "13.0.2", + "CuDNN": "", + "IsDevel": true, + "Ubuntu": "24.04" + }, + { + "Tag": "13.0.2-cudnn-devel-ubuntu22.04", + "CUDA": "13.0.2", + "CuDNN": "", + "IsDevel": true, + "Ubuntu": "22.04" + }, + { + "Tag": "13.0.1-cudnn-devel-ubuntu24.04", + "CUDA": "13.0.1", + "CuDNN": "", + "IsDevel": true, + "Ubuntu": "24.04" + }, + { + "Tag": "13.0.1-cudnn-devel-ubuntu22.04", + "CUDA": "13.0.1", + "CuDNN": "", + "IsDevel": true, + "Ubuntu": "22.04" + }, + { + "Tag": "13.0.0-cudnn-devel-ubuntu24.04", + "CUDA": "13.0.0", + "CuDNN": "", + "IsDevel": true, + "Ubuntu": "24.04" + }, + { + "Tag": "13.0.0-cudnn-devel-ubuntu22.04", + "CUDA": "13.0.0", + "CuDNN": "", + "IsDevel": true, + "Ubuntu": "22.04" + }, { "Tag": "12.9.1-cudnn-devel-ubuntu24.04", "CUDA": "12.9.1", diff --git a/pkg/config/torch_compatibility_matrix.json b/pkg/config/torch_compatibility_matrix.json index d2d97c2907..0bd331198f 100644 --- a/pkg/config/torch_compatibility_matrix.json +++ b/pkg/config/torch_compatibility_matrix.json @@ -1,8 +1,68 @@ [ { - "Torch": "2.8.0+cpu", - "Torchvision": "0.23.0", - "Torchaudio": "2.8.0", + "Torch": "2.9.1+cu126", + "Torchvision": "0.24.1", + "Torchaudio": "2.9.1", + "FindLinks": "", + "ExtraIndexURL": "https://download.pytorch.org/whl/cu126/", + "CUDA": "12.6", + "Pythons": [ + "3.10", + "3.11", + "3.12", + "3.13", + "3.14" + ] + }, + { + "Torch": "2.9.1+cu128", + "Torchvision": "0.24.1", + "Torchaudio": "2.9.1", + "FindLinks": "", + "ExtraIndexURL": "https://download.pytorch.org/whl/cu128/", + "CUDA": "12.8", + "Pythons": [ + "3.10", + "3.11", + "3.12", + "3.13", + "3.14" + ] + }, + { + "Torch": "2.9.1+cu129", + "Torchvision": "0.24.1", + "Torchaudio": "2.9.1", + "FindLinks": "", + "ExtraIndexURL": "https://download.pytorch.org/whl/cu129/", + "CUDA": "12.9", + "Pythons": [ + "3.10", + "3.11", + "3.12", + "3.13", + "3.14" + ] + }, + { + "Torch": "2.9.1+cu130", + "Torchvision": "0.24.1", + "Torchaudio": "2.9.1", + "FindLinks": "", + "ExtraIndexURL": "https://download.pytorch.org/whl/cu130/", + "CUDA": "13.0", + "Pythons": [ + "3.10", + "3.11", + "3.12", + "3.13", + "3.14" + ] + }, + { + "Torch": "2.9.1+cpu", + "Torchvision": "0.24.1", + "Torchaudio": "2.9.1", "FindLinks": "", "ExtraIndexURL": "https://download.pytorch.org/whl/cpu/", "CUDA": null, @@ -11,15 +71,15 @@ "3.11", "3.12", "3.13", - "3.9" + "3.14" ] }, { - "Torch": "2.8.0+cu126", + "Torch": "2.8.0", "Torchvision": "0.23.0", "Torchaudio": "2.8.0", "FindLinks": "", - "ExtraIndexURL": "https://download.pytorch.org/whl/cu126/", + "ExtraIndexURL": "https://download.pytorch.org/whl/cu126", "CUDA": "12.6", "Pythons": [ "3.10", @@ -30,11 +90,11 @@ ] }, { - "Torch": "2.8.0+cu128", + "Torch": "2.8.0", "Torchvision": "0.23.0", "Torchaudio": "2.8.0", "FindLinks": "", - "ExtraIndexURL": "https://download.pytorch.org/whl/cu128/", + "ExtraIndexURL": "https://download.pytorch.org/whl/cu128", "CUDA": "12.8", "Pythons": [ "3.10", @@ -45,11 +105,11 @@ ] }, { - "Torch": "2.8.0+cu129", + "Torch": "2.8.0", "Torchvision": "0.23.0", "Torchaudio": "2.8.0", "FindLinks": "", - "ExtraIndexURL": "https://download.pytorch.org/whl/cu129/", + "ExtraIndexURL": "https://download.pytorch.org/whl/cu129", "CUDA": "12.9", "Pythons": [ "3.10", @@ -59,6 +119,21 @@ "3.9" ] }, + { + "Torch": "2.8.0", + "Torchvision": "0.23.0", + "Torchaudio": "2.8.0", + "FindLinks": "", + "ExtraIndexURL": "https://download.pytorch.org/whl/cpu", + "CUDA": null, + "Pythons": [ + "3.10", + "3.11", + "3.12", + "3.13", + "3.9" + ] + }, { "Torch": "2.7.1", "Torchvision": "0.22.1", @@ -1796,4 +1871,4 @@ "3.7" ] } -] \ No newline at end of file +] diff --git a/pkg/util/version/version.go b/pkg/util/version/version.go index 689bf38b48..2a7f5cee36 100644 --- a/pkg/util/version/version.go +++ b/pkg/util/version/version.go @@ -84,6 +84,14 @@ func (v *Version) GreaterOrEqual(other *Version) bool { return v.Greater(other) || v.Equal(other) } +func (v *Version) Less(other *Version) bool { + return other.Greater(v) +} + +func (v *Version) LessOrEqual(other *Version) bool { + return other.GreaterOrEqual(v) +} + func (v *Version) EqualMinor(other *Version) bool { return v.Major == other.Major && v.Minor == other.Minor }