Skip to content

Commit

Permalink
Add passing test that includes Torch and TensorFlow together (#1123)
Browse files Browse the repository at this point in the history
Signed-off-by: Mattt Zmuda <[email protected]>
Co-authored-by: Ben Firshman <[email protected]>
  • Loading branch information
mattt and bfirsh authored Jun 25, 2024
1 parent 6ada0c9 commit 6ab380a
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,33 @@ torch==2.3.1+cu121`
require.Equal(t, expected, requirements)
}

func TestPythonPackagesBothTorchAndTensorflow(t *testing.T) {

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

View workflow job for this annotation

GitHub Actions / Test Go (ubuntu-latest)

TestPythonPackagesBothTorchAndTensorflow redeclared in this block

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

View workflow job for this annotation

GitHub Actions / Test Go (macos-latest)

TestPythonPackagesBothTorchAndTensorflow redeclared in this block
config := &Config{
Build: &Build{
GPU: true,
PythonVersion: "3.11.1",
PythonPackages: []string{
"tensorflow==2.12.0",
"torch==2.0.1",
"torchvision==0.15.2",
},
CUDA: "11.8",
},
}
err := config.ValidateAndComplete("")
require.NoError(t, err)
require.Equal(t, "11.8", config.Build.CUDA)
require.Equal(t, "8", config.Build.CuDNN)

requirements, err := config.PythonRequirementsForArch("", "")

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

View workflow job for this annotation

GitHub Actions / Test Go (ubuntu-latest)

not enough arguments in call to config.PythonRequirementsForArch

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

View workflow job for this annotation

GitHub Actions / Test Go (macos-latest)

not enough arguments in call to config.PythonRequirementsForArch
require.NoError(t, err)
expected := `--extra-index-url https://download.pytorch.org/whl/cu118
tensorflow==2.12.0
torch==2.0.1+cu118
torchvision==0.15.2`
require.Equal(t, expected, requirements)
}

func TestCUDABaseImageTag(t *testing.T) {
config := &Config{
Build: &Build{
Expand Down

0 comments on commit 6ab380a

Please sign in to comment.