Skip to content

Commit 9a474a9

Browse files
committed
fix(nvidia): failed to apply none mig
Signed-off-by: thxCode <thxcode0824@gmail.com>
1 parent 8b7585c commit 9a474a9

2 files changed

Lines changed: 13 additions & 14 deletions

File tree

gpustack_runtime/deployer/__types__.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,12 +1373,13 @@ def _prepare(self):
13731373
resource_key,
13741374
)
13751375
if ren and ben_list:
1376-
valued_backend_uuid = (
1377-
ren
1378-
in envs.GPUSTACK_RUNTIME_DEPLOY_RUNTIME_VISIBLE_DEVICES_VALUE_UUID
1379-
) and manu != ManufacturerEnum.ASCEND
13801376
valued_runtime_uuid = (
1381-
self.allowed_runtime_uuid_values and valued_backend_uuid
1377+
self.allowed_runtime_uuid_values
1378+
and (
1379+
ren
1380+
in envs.GPUSTACK_RUNTIME_DEPLOY_RUNTIME_VISIBLE_DEVICES_VALUE_UUID
1381+
)
1382+
and manu != ManufacturerEnum.ASCEND
13821383
)
13831384
dev_runtime_values: dict[str, str] = {}
13841385
dev_backend_values: dict[str, str] = {}
@@ -1391,10 +1392,12 @@ def _prepare(self):
13911392
dev_runtime_values[dev_index] = dev.uuid
13921393
else:
13931394
dev_runtime_values[dev_index] = dev_index
1394-
if valued_backend_uuid:
1395+
dev_backend_values[dev_index] = dev_index
1396+
if (
1397+
dev.appendix.get("vgpu", False)
1398+
and manu != ManufacturerEnum.ASCEND
1399+
):
13951400
dev_backend_values[dev_index] = dev.uuid
1396-
else:
1397-
dev_backend_values[dev_index] = dev_index
13981401
dev_backend_aligned_values[dev_index] = str(dev_i)
13991402
dev_numa_affinities[dev_index] = dev.appendix.get("numa", "")
14001403
dev_cpus_affinities[dev_index] = map_numa_node_to_cpu_affinity(
@@ -1411,8 +1414,7 @@ def _prepare(self):
14111414
ben: (
14121415
dev_backend_aligned_values
14131416
if (
1414-
not valued_backend_uuid
1415-
and ben
1417+
ben
14161418
in envs.GPUSTACK_RUNTIME_DEPLOY_BACKEND_VISIBLE_DEVICES_VALUE_ALIGNMENT
14171419
)
14181420
else dev_backend_values

gpustack_runtime/envs.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,7 @@
186186
"""
187187
GPUSTACK_RUNTIME_DEPLOY_RUNTIME_VISIBLE_DEVICES_VALUE_UUID: set[str] | None = None
188188
"""
189-
Apply UUIDs for the given runtime visible devices environment variables,
190-
also apply UUIDs for the corresponding backend visible devices environment variables.
189+
Apply UUIDs for the given runtime visible devices environment variables.
191190
"""
192191
GPUSTACK_RUNTIME_DEPLOY_BACKEND_VISIBLE_DEVICES_VALUE_ALIGNMENT: set[str] | None = (
193192
None
@@ -196,8 +195,6 @@
196195
Enable value alignment for the given backend visible devices environment variables.
197196
When detected devices are considered to be partially mapped (starting from a non-zero value or not contiguous),
198197
alignment is performed to ensure they are correctly identified.
199-
Works only when `GPUSTACK_RUNTIME_DEPLOY_RUNTIME_VISIBLE_DEVICES_VALUE_UUID` is not set
200-
the corresponding runtime visible devices environment variable.
201198
"""
202199
GPUSTACK_RUNTIME_DEPLOY_CPU_AFFINITY: bool = False
203200
"""

0 commit comments

Comments
 (0)