-
Notifications
You must be signed in to change notification settings - Fork 429
feat(operator): support shmSize on VLLMRuntime for tensor parallelism (#899) #994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -738,6 +738,23 @@ func (r *VLLMRuntimeReconciler) deploymentForVLLMRuntime( | |
| }) | ||
| } | ||
|
|
||
| // Mount an emptyDir (medium=Memory) at /dev/shm when a size is requested. | ||
| // Tensor parallelism communicates over shared memory, and the container | ||
| // default /dev/shm is usually too small for it. | ||
| if vllmRuntime.Spec.DeploymentConfig.ShmSize != "" { | ||
| shmSource := corev1.VolumeSource{ | ||
| EmptyDir: &corev1.EmptyDirVolumeSource{Medium: corev1.StorageMediumMemory}, | ||
| } | ||
| if q, err := resource.ParseQuantity(vllmRuntime.Spec.DeploymentConfig.ShmSize); err == nil { | ||
| shmSource.EmptyDir.SizeLimit = &q | ||
| } | ||
|
Comment on lines
+748
to
+750
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Improvement: Silent failure on invalid
|
||
| volumes = append(volumes, corev1.Volume{Name: "dshm", VolumeSource: shmSource}) | ||
| volumeMounts = append(volumeMounts, corev1.VolumeMount{ | ||
| Name: "dshm", | ||
| MountPath: "/dev/shm", | ||
| }) | ||
| } | ||
|
Comment on lines
+744
to
+756
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Changes to
|
||
|
|
||
| var affinity *corev1.Affinity | ||
|
|
||
| if vllmRuntime.Spec.DeploymentConfig.NodeSelectorTerms != nil { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommendation: Use
*resource.Quantityinstead ofstringUsing a raw
stringforShmSizerequires manual parsing in the controller and can lead to silent failures or runtime errors if the user inputs an invalid quantity (e.g.,"24Gii").By changing the type to
*resource.Quantity(fromk8s.io/apimachinery/pkg/api/resource), the Kubernetes API server will automatically validate the field value upon creation or update, rejecting any invalid quantities before they ever reach the operator.Example