Skip to content

Commit

Permalink
chore(ray): fix numOfGPUInt logic
Browse files Browse the repository at this point in the history
  • Loading branch information
heiruwu committed Dec 12, 2024
1 parent c71bb75 commit 995ab08
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pkg/ray/ray.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,11 @@ func (r *ray) setHardwareRunOptions(hardware string, numOfGPU string) []string {
"--device nvidia.com/gpu=all",
)
default:
numOfGPUInt, err := strconv.Atoi(numOfGPU)
numOfGPUFloat, err := strconv.ParseFloat(numOfGPU, 64)
if err != nil {
numOfGPUInt = 1
numOfGPUFloat = 0
}
if numOfGPUInt > 1 {
if numOfGPUFloat > 0 {
runOptions = append(runOptions,
fmt.Sprintf("-e %s=%s", EnvRayCustomResource, hardware),
fmt.Sprintf("-e %s=%v", EnvNumOfGPUs, numOfGPU),
Expand Down
2 changes: 1 addition & 1 deletion pkg/ray/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func GenerateHardwareConfig(modelID string) string {
return matches[1]
}

return "1"
return "0"
}

func GetApplicationMetadaValue(modelName string, version string) (applicationMetadataValue string, err error) {
Expand Down

0 comments on commit 995ab08

Please sign in to comment.