@@ -29,6 +29,7 @@ import (
2929 corev1 "k8s.io/api/core/v1"
3030 networkingv1 "k8s.io/api/networking/v1"
3131 rbacv1 "k8s.io/api/rbac/v1"
32+ "k8s.io/apimachinery/pkg/api/resource"
3233 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3334 "k8s.io/apimachinery/pkg/util/intstr"
3435 "k8s.io/utils/ptr"
@@ -134,6 +135,8 @@ type NIMServiceList struct {
134135// NIMServiceStorage defines the attributes of various storage targets used to store the model
135136type NIMServiceStorage struct {
136137 NIMCache NIMCacheVolSpec `json:"nimCache,omitempty"`
138+ // SharedMemorySizeLimit sets the max size of the shared memory volume (emptyDir) used by NIMs for fast model runtime I/O.
139+ SharedMemorySizeLimit * resource.Quantity `json:"sharedMemorySizeLimit,omitempty"`
137140 // PersistentVolumeClaim is the pvc volume used for caching NIM
138141 PVC PersistentVolumeClaim `json:"pvc,omitempty"`
139142 // HostPath is the host path volume for caching NIM
@@ -448,7 +451,8 @@ func (n *NIMService) GetVolumes(modelPVC PersistentVolumeClaim) []corev1.Volume
448451 Name : "dshm" ,
449452 VolumeSource : corev1.VolumeSource {
450453 EmptyDir : & corev1.EmptyDirVolumeSource {
451- Medium : corev1 .StorageMediumMemory ,
454+ Medium : corev1 .StorageMediumMemory ,
455+ SizeLimit : n .Spec .Storage .SharedMemorySizeLimit ,
452456 },
453457 },
454458 },
0 commit comments