@@ -109,14 +109,35 @@ func (wg *WorkerGenerator) GenerateWorkerPod(
109
109
Value : strconv .Itoa (port ),
110
110
}, corev1.EnvVar {
111
111
Name : constants .WorkerCudaUpLimitTflopsEnv ,
112
- Value : strconv .FormatInt (limits .Tflops .Value (), 10 ),
112
+ Value : func () string {
113
+ tflopsMap := make (map [string ]int64 )
114
+ for _ , gpu := range gpus {
115
+ tflopsMap [gpu .Status .UUID ] = limits .Tflops .Value ()
116
+ }
117
+ jsonBytes , _ := json .Marshal (tflopsMap )
118
+ return string (jsonBytes )
119
+ }(),
113
120
}, corev1.EnvVar {
114
121
Name : constants .WorkerCudaUpLimitEnv ,
115
- Value : strconv .FormatInt (int64 (math .Ceil (float64 (limits .Tflops .Value ())/ float64 (info .Fp16TFlops .Value ())* 100 )), 10 ),
122
+ Value : func () string {
123
+ upLimitMap := make (map [string ]int64 )
124
+ for _ , gpu := range gpus {
125
+ upLimitMap [gpu .Status .UUID ] = int64 (math .Ceil (float64 (limits .Tflops .Value ())/ float64 (info .Fp16TFlops .Value ())* 100 ))
126
+ }
127
+ jsonBytes , _ := json .Marshal (upLimitMap )
128
+ return string (jsonBytes )
129
+ }(),
116
130
}, corev1.EnvVar {
117
131
Name : constants .WorkerCudaMemLimitEnv ,
118
132
// bytesize
119
- Value : strconv .FormatInt (limits .Vram .Value (), 10 ),
133
+ Value : func () string {
134
+ memLimitMap := make (map [string ]int64 )
135
+ for _ , gpu := range gpus {
136
+ memLimitMap [gpu .Status .UUID ] = limits .Vram .Value ()
137
+ }
138
+ jsonBytes , _ := json .Marshal (memLimitMap )
139
+ return string (jsonBytes )
140
+ }(),
120
141
}, corev1.EnvVar {
121
142
Name : constants .WorkerPodNameEnv ,
122
143
ValueFrom : & corev1.EnvVarSource {
0 commit comments