Skip to content

Commit

Permalink
Merge pull request kubeagi#884 from nkwangleiGIT/main
Browse files Browse the repository at this point in the history
Enable --enforce-eager by default and fix NUMBER_GPUS issue
  • Loading branch information
nkwangleiGIT authored Mar 18, 2024
2 parents 8f790fc + 49d6316 commit a9d9344
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
7 changes: 4 additions & 3 deletions pkg/worker/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ func (runner *RunnerFastchatVLLM) Build(ctx context.Context, model *arcadiav1alp

modelFileDir := fmt.Sprintf("/data/models/%s", model.Name)
additionalEnvs := []corev1.EnvVar{}
extraAgrs := "--trust-remote-code"
// --enforce-eager to disable cupy
// TODO: remove --enforce-eager when https://github.com/kubeagi/arcadia/issues/878 is fixed
extraAgrs := "--trust-remote-code --enforce-eager"
if runner.modelFileFromRemote {
m := arcadiav1alpha1.Model{}
if err := runner.c.Get(ctx, types.NamespacedName{Namespace: *model.Namespace, Name: model.Name}, &m); err != nil {
Expand Down Expand Up @@ -251,7 +253,7 @@ func (runner *RunnerFastchatVLLM) Build(ctx context.Context, model *arcadiav1alp
// Need python version and ray address for distributed inference
{Name: "PYTHON_VERSION", Value: pythonVersion},
{Name: "RAY_ADDRESS", Value: rayClusterAddress},
{Name: "NUMBER_GPUS", Value: runner.NumberOfGPUs()},
{Name: "NUMBER_GPUS", Value: strconv.Itoa(gpuCount)},
},
Ports: []corev1.ContainerPort{
{Name: "http", ContainerPort: arcadiav1alpha1.DefaultWorkerPort},
Expand All @@ -262,7 +264,6 @@ func (runner *RunnerFastchatVLLM) Build(ctx context.Context, model *arcadiav1alp
Resources: runner.w.Spec.Resources,
}
container.Env = append(container.Env, additionalEnvs...)

return container, nil
}

Expand Down
5 changes: 0 additions & 5 deletions pkg/worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,11 +499,6 @@ func (podWorker *PodWorker) Start(ctx context.Context) error {
}
}

// Configure environment variable
if len(podSpecTemplate.Spec.Containers) > 0 {
podSpecTemplate.Spec.Containers[0].Env = append(podSpecTemplate.Spec.Containers[0].Env, podWorker.w.Spec.AdditionalEnvs...)
}

desiredDep.Spec.Template = podSpecTemplate
err = controllerutil.SetControllerReference(podWorker.Worker(), desiredDep, podWorker.s)
if err != nil {
Expand Down

0 comments on commit a9d9344

Please sign in to comment.