Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions pkg/config/compatibility.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 5 additions & 1 deletion pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"path/filepath"
"testing"

"github.com/replicate/cog/pkg/util/version"

Check failure on line 10 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (macos-latest, false)

other declaration of version

Check failure on line 10 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (ubuntu-latest, false)

other declaration of version

Check failure on line 10 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (macos-latest, true)

other declaration of version

Check failure on line 10 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (ubuntu-latest, true)

other declaration of version

"github.com/hashicorp/go-version"

Check failure on line 12 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (macos-latest, false)

"github.com/hashicorp/go-version" imported as version and not used

Check failure on line 12 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (macos-latest, false)

version redeclared in this block

Check failure on line 12 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (ubuntu-latest, false)

"github.com/hashicorp/go-version" imported as version and not used

Check failure on line 12 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (ubuntu-latest, false)

version redeclared in this block

Check failure on line 12 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (macos-latest, true)

"github.com/hashicorp/go-version" imported as version and not used

Check failure on line 12 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (macos-latest, true)

version redeclared in this block

Check failure on line 12 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (ubuntu-latest, true)

"github.com/hashicorp/go-version" imported as version and not used

Check failure on line 12 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (ubuntu-latest, true)

version redeclared in this block
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v2"
)
Expand Down Expand Up @@ -146,7 +148,7 @@
}

// Compare only the major and minor parts
if expectedVersion.Segments()[0] != actualVersion.Segments()[0] || expectedVersion.Segments()[1] != actualVersion.Segments()[1] {

Check failure on line 151 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (macos-latest, false)

actualVersion.Segments undefined (type *"github.com/replicate/cog/pkg/util/version".Version has no field or method Segments)

Check failure on line 151 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (macos-latest, false)

expectedVersion.Segments undefined (type *"github.com/replicate/cog/pkg/util/version".Version has no field or method Segments)

Check failure on line 151 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (macos-latest, false)

actualVersion.Segments undefined (type *"github.com/replicate/cog/pkg/util/version".Version has no field or method Segments)

Check failure on line 151 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (macos-latest, false)

expectedVersion.Segments undefined (type *"github.com/replicate/cog/pkg/util/version".Version has no field or method Segments)

Check failure on line 151 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (ubuntu-latest, false)

actualVersion.Segments undefined (type *"github.com/replicate/cog/pkg/util/version".Version has no field or method Segments)

Check failure on line 151 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (ubuntu-latest, false)

expectedVersion.Segments undefined (type *"github.com/replicate/cog/pkg/util/version".Version has no field or method Segments)

Check failure on line 151 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (ubuntu-latest, false)

actualVersion.Segments undefined (type *"github.com/replicate/cog/pkg/util/version".Version has no field or method Segments)

Check failure on line 151 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (ubuntu-latest, false)

expectedVersion.Segments undefined (type *"github.com/replicate/cog/pkg/util/version".Version has no field or method Segments)

Check failure on line 151 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (macos-latest, true)

actualVersion.Segments undefined (type *"github.com/replicate/cog/pkg/util/version".Version has no field or method Segments)

Check failure on line 151 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (macos-latest, true)

expectedVersion.Segments undefined (type *"github.com/replicate/cog/pkg/util/version".Version has no field or method Segments)

Check failure on line 151 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (macos-latest, true)

actualVersion.Segments undefined (type *"github.com/replicate/cog/pkg/util/version".Version has no field or method Segments)

Check failure on line 151 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (macos-latest, true)

expectedVersion.Segments undefined (type *"github.com/replicate/cog/pkg/util/version".Version has no field or method Segments)

Check failure on line 151 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (ubuntu-latest, true)

actualVersion.Segments undefined (type *"github.com/replicate/cog/pkg/util/version".Version has no field or method Segments)

Check failure on line 151 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (ubuntu-latest, true)

expectedVersion.Segments undefined (type *"github.com/replicate/cog/pkg/util/version".Version has no field or method Segments)

Check failure on line 151 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (ubuntu-latest, true)

actualVersion.Segments undefined (type *"github.com/replicate/cog/pkg/util/version".Version has no field or method Segments)

Check failure on line 151 in pkg/config/config_test.go

View workflow job for this annotation

GitHub Actions / Test Go (ubuntu-latest, true)

expectedVersion.Segments undefined (type *"github.com/replicate/cog/pkg/util/version".Version has no field or method Segments)
t.Errorf("Expected %s but got %s", expected, actual)
}
}
Expand Down Expand Up @@ -297,7 +299,9 @@
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)
}
}
}
}
Expand Down
42 changes: 42 additions & 0 deletions pkg/config/cuda_base_images.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
97 changes: 86 additions & 11 deletions pkg/config/torch_compatibility_matrix.json
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -1796,4 +1871,4 @@
"3.7"
]
}
]
]
8 changes: 8 additions & 0 deletions pkg/util/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Loading