Skip to content

Commit 9bbb395

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 5b23497 + 05559c7 commit 9bbb395

File tree

4 files changed

+6
-22
lines changed

4 files changed

+6
-22
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/matoous/go-nanoid/v2 v2.1.0
88
github.com/onsi/gomega v1.32.0
99
github.com/project-codeflare/appwrapper v0.8.0
10-
github.com/project-codeflare/codeflare-common v0.0.0-20250128135036-f501cd31fe8b
10+
github.com/project-codeflare/codeflare-common v0.0.0-20250317102908-1c124db97844
1111
github.com/prometheus/client_golang v1.20.4
1212
github.com/prometheus/common v0.57.0
1313
github.com/ray-project/kuberay/ray-operator v1.1.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
366366
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
367367
github.com/project-codeflare/appwrapper v0.8.0 h1:vWHNtXUtHutN2EzYb6rryLdESnb8iDXsCokXOuNYXvg=
368368
github.com/project-codeflare/appwrapper v0.8.0/go.mod h1:FMQ2lI3fz6LakUVXgN1FTdpsc3BBkNIZZgtMmM9J5UM=
369-
github.com/project-codeflare/codeflare-common v0.0.0-20250128135036-f501cd31fe8b h1:MOmv/aLx/kcHd7PBErx8XNSTW180s8Slf/uVM0uV4rw=
370-
github.com/project-codeflare/codeflare-common v0.0.0-20250128135036-f501cd31fe8b/go.mod h1:DPSv5khRiRDFUD43SF8da+MrVQTWmxNhuKJmwSLOyO0=
369+
github.com/project-codeflare/codeflare-common v0.0.0-20250317102908-1c124db97844 h1:hEjZ2pV4Fp81wytijJZ7uHWovKIqirVBA/t1F5hIrbA=
370+
github.com/project-codeflare/codeflare-common v0.0.0-20250317102908-1c124db97844/go.mod h1:DPSv5khRiRDFUD43SF8da+MrVQTWmxNhuKJmwSLOyO0=
371371
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
372372
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
373373
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=

tests/kfto/kfto_mnist_training_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func runKFTOPyTorchMnistJob(t *testing.T, accelerator Accelerator, image string,
6363
download_mnist_dataset := readFile(test, "resources/download_mnist_datasets.py")
6464
requirementsFileName := readFile(test, requirementsFile)
6565

66-
if accelerator.isGpu() {
66+
if accelerator.IsGpu() {
6767
mnist = bytes.Replace(mnist, []byte("accelerator=\"has to be specified\""), []byte("accelerator=\"gpu\""), 1)
6868
} else {
6969
mnist = bytes.Replace(mnist, []byte("accelerator=\"has to be specified\""), []byte("accelerator=\"cpu\""), 1)
@@ -90,7 +90,7 @@ func runKFTOPyTorchMnistJob(t *testing.T, accelerator Accelerator, image string,
9090

9191
func createKFTOPyTorchMnistJob(test Test, namespace string, config corev1.ConfigMap, accelerator Accelerator, workerReplicas int, numProcPerNode int, baseImage string) *kftov1.PyTorchJob {
9292
var backend string
93-
if accelerator.isGpu() {
93+
if accelerator.IsGpu() {
9494
backend = "nccl"
9595
} else {
9696
backend = "gloo"
@@ -306,7 +306,7 @@ func createKFTOPyTorchMnistJob(test Test, namespace string, config corev1.Config
306306
},
307307
}
308308

309-
if accelerator.isGpu() {
309+
if accelerator.IsGpu() {
310310
// Update resource lists for GPU (NVIDIA/ROCm) usecase
311311
tuningJob.Spec.PyTorchReplicaSpecs[kftov1.PyTorchJobReplicaTypeMaster].Template.Spec.Containers[0].Resources.Requests[corev1.ResourceName(accelerator.ResourceLabel)] = resource.MustParse(fmt.Sprint(numProcPerNode))
312312
tuningJob.Spec.PyTorchReplicaSpecs[kftov1.PyTorchJobReplicaTypeMaster].Template.Spec.Containers[0].Resources.Limits[corev1.ResourceName(accelerator.ResourceLabel)] = resource.MustParse(fmt.Sprint(numProcPerNode))

tests/kfto/support.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,6 @@ import (
3030
corev1 "k8s.io/api/core/v1"
3131
)
3232

33-
type Accelerator struct {
34-
ResourceLabel string
35-
PrometheusGpuUtilizationLabel string
36-
}
37-
38-
var (
39-
NVIDIA = Accelerator{ResourceLabel: "nvidia.com/gpu", PrometheusGpuUtilizationLabel: "DCGM_FI_DEV_GPU_UTIL"}
40-
AMD = Accelerator{ResourceLabel: "amd.com/gpu"}
41-
CPU = Accelerator{}
42-
)
43-
44-
// Method to check if the accelerator is a GPU
45-
func (a Accelerator) isGpu() bool {
46-
return a != CPU
47-
}
48-
4933
//go:embed resources/*
5034
var files embed.FS
5135

0 commit comments

Comments
 (0)