gpustack-runtime 0.1.39.post2__py3-none-any.whl → 0.1.40__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gpustack_runtime/__main__.py +7 -3
- gpustack_runtime/_version.py +2 -2
- gpustack_runtime/_version_appendix.py +1 -1
- gpustack_runtime/cmds/__init__.py +2 -0
- gpustack_runtime/cmds/deployer.py +84 -2
- gpustack_runtime/cmds/images.py +2 -0
- gpustack_runtime/deployer/__init__.py +2 -0
- gpustack_runtime/deployer/__types__.py +52 -28
- gpustack_runtime/deployer/__utils__.py +99 -112
- gpustack_runtime/deployer/cdi/__init__.py +81 -0
- gpustack_runtime/deployer/cdi/__types__.py +667 -0
- gpustack_runtime/deployer/cdi/thead.py +103 -0
- gpustack_runtime/deployer/docker.py +42 -24
- gpustack_runtime/deployer/kuberentes.py +8 -4
- gpustack_runtime/deployer/podman.py +41 -23
- gpustack_runtime/detector/__init__.py +62 -3
- gpustack_runtime/detector/__types__.py +11 -0
- gpustack_runtime/detector/__utils__.py +23 -0
- gpustack_runtime/detector/amd.py +17 -9
- gpustack_runtime/detector/hygon.py +6 -1
- gpustack_runtime/detector/iluvatar.py +20 -5
- gpustack_runtime/detector/mthreads.py +8 -12
- gpustack_runtime/detector/nvidia.py +365 -168
- gpustack_runtime/detector/pyacl/__init__.py +9 -1
- gpustack_runtime/detector/pyamdgpu/__init__.py +8 -0
- gpustack_runtime/detector/pycuda/__init__.py +9 -1
- gpustack_runtime/detector/pydcmi/__init__.py +9 -2
- gpustack_runtime/detector/pyhgml/__init__.py +5879 -0
- gpustack_runtime/detector/pyhgml/libhgml.so +0 -0
- gpustack_runtime/detector/pyhgml/libuki.so +0 -0
- gpustack_runtime/detector/pyhsa/__init__.py +9 -0
- gpustack_runtime/detector/pyixml/__init__.py +89 -164
- gpustack_runtime/detector/pyrocmcore/__init__.py +42 -24
- gpustack_runtime/detector/pyrocmsmi/__init__.py +141 -138
- gpustack_runtime/detector/thead.py +733 -0
- gpustack_runtime/envs.py +128 -55
- {gpustack_runtime-0.1.39.post2.dist-info → gpustack_runtime-0.1.40.dist-info}/METADATA +4 -2
- gpustack_runtime-0.1.40.dist-info/RECORD +55 -0
- gpustack_runtime/detector/pymtml/__init__.py +0 -770
- gpustack_runtime-0.1.39.post2.dist-info/RECORD +0 -49
- {gpustack_runtime-0.1.39.post2.dist-info → gpustack_runtime-0.1.40.dist-info}/WHEEL +0 -0
- {gpustack_runtime-0.1.39.post2.dist-info → gpustack_runtime-0.1.40.dist-info}/entry_points.txt +0 -0
- {gpustack_runtime-0.1.39.post2.dist-info → gpustack_runtime-0.1.40.dist-info}/licenses/LICENSE +0 -0
gpustack_runtime/envs.py
CHANGED
|
@@ -18,7 +18,7 @@ if TYPE_CHECKING:
|
|
|
18
18
|
"""
|
|
19
19
|
GPUSTACK_RUNTIME_LOG_TO_FILE: Path | None = None
|
|
20
20
|
"""
|
|
21
|
-
|
|
21
|
+
Path of file to log to, instead of stderr.
|
|
22
22
|
"""
|
|
23
23
|
GPUSTACK_RUNTIME_LOG_WARNING: bool = False
|
|
24
24
|
"""
|
|
@@ -52,6 +52,7 @@ if TYPE_CHECKING:
|
|
|
52
52
|
"""
|
|
53
53
|
The detected backend mapping to resource keys,
|
|
54
54
|
e.g `{"cuda": "nvidia.com/devices", "rocm": "amd.com/devices"}`.
|
|
55
|
+
Used to map the gpustack-runner's backend name to the corresponding resource key.
|
|
55
56
|
"""
|
|
56
57
|
GPUSTACK_RUNTIME_DETECT_PHYSICAL_INDEX_PRIORITY: bool = True
|
|
57
58
|
"""
|
|
@@ -146,15 +147,24 @@ if TYPE_CHECKING:
|
|
|
146
147
|
"""
|
|
147
148
|
Label prefix for the deployer.
|
|
148
149
|
"""
|
|
150
|
+
GPUSTACK_RUNTIME_DEPLOY_CDI_SPECS_GENERATE: bool = True
|
|
151
|
+
"""
|
|
152
|
+
During deployment, enable automatic generation of Container Device Interface (CDI) specifications
|
|
153
|
+
for detected devices.
|
|
154
|
+
"""
|
|
155
|
+
GPUSTACK_RUNTIME_DEPLOY_CDI_SPECS_DIRECTORY: Path | None = None
|
|
156
|
+
"""
|
|
157
|
+
During deployment, path of directory containing Container Device Interface (CDI) specifications,
|
|
158
|
+
or the directory to generate CDI specifications into.
|
|
159
|
+
If not set, it should be "/var/run/cdi".
|
|
160
|
+
"""
|
|
149
161
|
GPUSTACK_RUNTIME_DEPLOY_AUTOMAP_RESOURCE_KEY: str | None = None
|
|
150
162
|
"""
|
|
151
163
|
The resource key to use for automatic mapping of container backend visible devices environment variables,
|
|
152
164
|
which is used to tell deployer do a device detection and get the corresponding resource key before mapping.
|
|
153
165
|
e.g., "gpustack.ai/devices".
|
|
154
166
|
"""
|
|
155
|
-
|
|
156
|
-
dict[str, str] | None
|
|
157
|
-
) = None
|
|
167
|
+
GPUSTACK_RUNTIME_DEPLOY_RESOURCE_KEY_MAP_CDI: dict[str, str] | None = None
|
|
158
168
|
"""
|
|
159
169
|
Manual mapping of container device interfaces,
|
|
160
170
|
which is used to tell the Container Runtime which devices to inject into the container,
|
|
@@ -236,7 +246,7 @@ if TYPE_CHECKING:
|
|
|
236
246
|
"""
|
|
237
247
|
Resource injection policy for the Docker deployer (e.g., Env, CDI).
|
|
238
248
|
`Env`: Injects resources using standard environment variable, based on `GPUSTACK_RUNTIME_DEPLOY_RESOURCE_KEY_MAP_RUNTIME_VISIBLE_DEVICES`.
|
|
239
|
-
`CDI`: Injects resources using CDI, based on `
|
|
249
|
+
`CDI`: Injects resources using CDI, based on `GPUSTACK_RUNTIME_DEPLOY_RESOURCE_KEY_MAP_CDI`.
|
|
240
250
|
"""
|
|
241
251
|
## Kubernetes
|
|
242
252
|
GPUSTACK_RUNTIME_KUBERNETES_NODE_NAME: str | None = None
|
|
@@ -308,13 +318,22 @@ variables: dict[str, Callable[[], Any]] = {
|
|
|
308
318
|
"INFO",
|
|
309
319
|
),
|
|
310
320
|
"GPUSTACK_RUNTIME_LOG_TO_FILE": lambda: mkdir_path(
|
|
311
|
-
getenv(
|
|
321
|
+
getenv(
|
|
322
|
+
"GPUSTACK_RUNTIME_LOG_TO_FILE",
|
|
323
|
+
),
|
|
324
|
+
parents_only=True,
|
|
312
325
|
),
|
|
313
326
|
"GPUSTACK_RUNTIME_LOG_WARNING": lambda: to_bool(
|
|
314
|
-
getenv(
|
|
327
|
+
getenv(
|
|
328
|
+
"GPUSTACK_RUNTIME_LOG_WARNING",
|
|
329
|
+
"0",
|
|
330
|
+
),
|
|
315
331
|
),
|
|
316
332
|
"GPUSTACK_RUNTIME_LOG_EXCEPTION": lambda: to_bool(
|
|
317
|
-
getenv(
|
|
333
|
+
getenv(
|
|
334
|
+
"GPUSTACK_RUNTIME_LOG_EXCEPTION",
|
|
335
|
+
"1",
|
|
336
|
+
),
|
|
318
337
|
),
|
|
319
338
|
## Detector
|
|
320
339
|
"GPUSTACK_RUNTIME_DETECT": lambda: getenv(
|
|
@@ -327,7 +346,10 @@ variables: dict[str, Callable[[], Any]] = {
|
|
|
327
346
|
lambda: any(x in get_os_release() for x in ("microsoft", "wsl")),
|
|
328
347
|
),
|
|
329
348
|
"GPUSTACK_RUNTIME_DETECT_NO_TOOLKIT_CALL": lambda: to_bool(
|
|
330
|
-
getenv(
|
|
349
|
+
getenv(
|
|
350
|
+
"GPUSTACK_RUNTIME_DETECT_NO_TOOLKIT_CALL",
|
|
351
|
+
"0",
|
|
352
|
+
),
|
|
331
353
|
),
|
|
332
354
|
"GPUSTACK_RUNTIME_DETECT_BACKEND_MAP_RESOURCE_KEY": lambda: to_dict(
|
|
333
355
|
getenv(
|
|
@@ -339,11 +361,15 @@ variables: dict[str, Callable[[], Any]] = {
|
|
|
339
361
|
"corex=iluvatar.ai/devices;"
|
|
340
362
|
"maca=metax-tech.com/devices;"
|
|
341
363
|
"musa=mthreads.com/devices;"
|
|
342
|
-
"cuda=nvidia.com/devices;"
|
|
364
|
+
"cuda=nvidia.com/devices;"
|
|
365
|
+
"hggc=alibabacloud.com/devices;",
|
|
343
366
|
),
|
|
344
367
|
),
|
|
345
368
|
"GPUSTACK_RUNTIME_DETECT_PHYSICAL_INDEX_PRIORITY": lambda: to_bool(
|
|
346
|
-
getenv(
|
|
369
|
+
getenv(
|
|
370
|
+
"GPUSTACK_RUNTIME_DETECT_PHYSICAL_INDEX_PRIORITY",
|
|
371
|
+
"1",
|
|
372
|
+
),
|
|
347
373
|
),
|
|
348
374
|
## Deployer
|
|
349
375
|
"GPUSTACK_RUNTIME_DEPLOY": lambda: getenv(
|
|
@@ -351,19 +377,33 @@ variables: dict[str, Callable[[], Any]] = {
|
|
|
351
377
|
"Auto",
|
|
352
378
|
),
|
|
353
379
|
"GPUSTACK_RUNTIME_DEPLOY_API_CALL_ERROR_DETAIL": lambda: to_bool(
|
|
354
|
-
getenv(
|
|
380
|
+
getenv(
|
|
381
|
+
"GPUSTACK_RUNTIME_DEPLOY_API_CALL_ERROR_DETAIL",
|
|
382
|
+
"1",
|
|
383
|
+
),
|
|
355
384
|
),
|
|
356
385
|
"GPUSTACK_RUNTIME_DEPLOY_PRINT_CONVERSION": lambda: to_bool(
|
|
357
|
-
getenv(
|
|
386
|
+
getenv(
|
|
387
|
+
"GPUSTACK_RUNTIME_DEPLOY_PRINT_CONVERSION",
|
|
388
|
+
"0",
|
|
389
|
+
),
|
|
358
390
|
),
|
|
359
391
|
"GPUSTACK_RUNTIME_DEPLOY_ASYNC": lambda: to_bool(
|
|
360
|
-
getenv(
|
|
392
|
+
getenv(
|
|
393
|
+
"GPUSTACK_RUNTIME_DEPLOY_ASYNC",
|
|
394
|
+
"1",
|
|
395
|
+
),
|
|
361
396
|
),
|
|
362
397
|
"GPUSTACK_RUNTIME_DEPLOY_ASYNC_THREADS": lambda: to_int(
|
|
363
|
-
getenv(
|
|
398
|
+
getenv(
|
|
399
|
+
"GPUSTACK_RUNTIME_DEPLOY_ASYNC_THREADS",
|
|
400
|
+
),
|
|
364
401
|
),
|
|
365
402
|
"GPUSTACK_RUNTIME_DEPLOY_MIRRORED_DEPLOYMENT": lambda: to_bool(
|
|
366
|
-
getenv(
|
|
403
|
+
getenv(
|
|
404
|
+
"GPUSTACK_RUNTIME_DEPLOY_MIRRORED_DEPLOYMENT",
|
|
405
|
+
"0",
|
|
406
|
+
),
|
|
367
407
|
),
|
|
368
408
|
"GPUSTACK_RUNTIME_DEPLOY_MIRRORED_NAME": lambda: getenv(
|
|
369
409
|
"GPUSTACK_RUNTIME_DEPLOY_MIRRORED_NAME",
|
|
@@ -381,11 +421,14 @@ variables: dict[str, Callable[[], Any]] = {
|
|
|
381
421
|
sep=";",
|
|
382
422
|
),
|
|
383
423
|
"GPUSTACK_RUNTIME_DEPLOY_CORRECT_RUNNER_IMAGE": lambda: to_bool(
|
|
384
|
-
getenv(
|
|
424
|
+
getenv(
|
|
425
|
+
"GPUSTACK_RUNTIME_DEPLOY_CORRECT_RUNNER_IMAGE",
|
|
426
|
+
"1",
|
|
427
|
+
),
|
|
385
428
|
),
|
|
386
429
|
"GPUSTACK_RUNTIME_DEPLOY_DEFAULT_CONTAINER_REGISTRY": lambda: trim_str(
|
|
387
430
|
getenvs(
|
|
388
|
-
|
|
431
|
+
[
|
|
389
432
|
"GPUSTACK_RUNTIME_DEPLOY_DEFAULT_CONTAINER_REGISTRY",
|
|
390
433
|
# TODO(thxCode): Backward compatibility, remove in v0.1.45 later.
|
|
391
434
|
"GPUSTACK_RUNTIME_DEPLOY_DEFAULT_REGISTRY",
|
|
@@ -398,7 +441,7 @@ variables: dict[str, Callable[[], Any]] = {
|
|
|
398
441
|
),
|
|
399
442
|
"GPUSTACK_RUNTIME_DEPLOY_DEFAULT_CONTAINER_REGISTRY_USERNAME": lambda: trim_str(
|
|
400
443
|
getenvs(
|
|
401
|
-
|
|
444
|
+
[
|
|
402
445
|
"GPUSTACK_RUNTIME_DEPLOY_DEFAULT_CONTAINER_REGISTRY_USERNAME",
|
|
403
446
|
# TODO(thxCode): Backward compatibility, remove in v0.1.45 later.
|
|
404
447
|
"GPUSTACK_RUNTIME_DEPLOY_DEFAULT_REGISTRY_USERNAME",
|
|
@@ -408,7 +451,7 @@ variables: dict[str, Callable[[], Any]] = {
|
|
|
408
451
|
),
|
|
409
452
|
),
|
|
410
453
|
"GPUSTACK_RUNTIME_DEPLOY_DEFAULT_CONTAINER_REGISTRY_PASSWORD": lambda: getenvs(
|
|
411
|
-
|
|
454
|
+
[
|
|
412
455
|
"GPUSTACK_RUNTIME_DEPLOY_DEFAULT_CONTAINER_REGISTRY_PASSWORD",
|
|
413
456
|
# TODO(thxCode): Backward compatibility, remove in v0.1.45 later.
|
|
414
457
|
"GPUSTACK_RUNTIME_DEPLOY_DEFAULT_REGISTRY_PASSWORD",
|
|
@@ -418,7 +461,7 @@ variables: dict[str, Callable[[], Any]] = {
|
|
|
418
461
|
),
|
|
419
462
|
"GPUSTACK_RUNTIME_DEPLOY_DEFAULT_CONTAINER_NAMESPACE": lambda: trim_str(
|
|
420
463
|
getenvs(
|
|
421
|
-
|
|
464
|
+
[
|
|
422
465
|
"GPUSTACK_RUNTIME_DEPLOY_DEFAULT_CONTAINER_NAMESPACE",
|
|
423
466
|
# Legacy compatibility.
|
|
424
467
|
"GPUSTACK_RUNTIME_DEPLOY_DEFAULT_IMAGE_NAMESPACE",
|
|
@@ -428,7 +471,6 @@ variables: dict[str, Callable[[], Any]] = {
|
|
|
428
471
|
"GPUSTACK_RUNTIME_DEPLOY_IMAGE_PULL_POLICY": lambda: choice(
|
|
429
472
|
getenv(
|
|
430
473
|
"GPUSTACK_RUNTIME_DEPLOY_IMAGE_PULL_POLICY",
|
|
431
|
-
"IfNotPresent",
|
|
432
474
|
),
|
|
433
475
|
options=["Always", "IfNotPresent", "Never"],
|
|
434
476
|
default="IfNotPresent",
|
|
@@ -437,13 +479,25 @@ variables: dict[str, Callable[[], Any]] = {
|
|
|
437
479
|
"GPUSTACK_RUNTIME_DEPLOY_LABEL_PREFIX",
|
|
438
480
|
"runtime.gpustack.ai",
|
|
439
481
|
),
|
|
482
|
+
"GPUSTACK_RUNTIME_DEPLOY_CDI_SPECS_GENERATE": lambda: to_bool(
|
|
483
|
+
getenv(
|
|
484
|
+
"GPUSTACK_RUNTIME_DEPLOY_CDI_SPECS_GENERATE",
|
|
485
|
+
"1",
|
|
486
|
+
),
|
|
487
|
+
),
|
|
488
|
+
"GPUSTACK_RUNTIME_DEPLOY_CDI_SPECS_DIRECTORY": lambda: mkdir_path(
|
|
489
|
+
getenv(
|
|
490
|
+
"GPUSTACK_RUNTIME_DEPLOY_CDI_SPECS_DIRECTORY",
|
|
491
|
+
"/var/run/cdi",
|
|
492
|
+
),
|
|
493
|
+
),
|
|
440
494
|
"GPUSTACK_RUNTIME_DEPLOY_AUTOMAP_RESOURCE_KEY": lambda: getenv(
|
|
441
495
|
"GPUSTACK_RUNTIME_DEPLOY_AUTOMAP_RESOURCE_KEY",
|
|
442
496
|
"gpustack.ai/devices",
|
|
443
497
|
),
|
|
444
|
-
"
|
|
498
|
+
"GPUSTACK_RUNTIME_DEPLOY_RESOURCE_KEY_MAP_CDI": lambda: to_dict(
|
|
445
499
|
getenv(
|
|
446
|
-
"
|
|
500
|
+
"GPUSTACK_RUNTIME_DEPLOY_RESOURCE_KEY_MAP_CDI",
|
|
447
501
|
"amd.com/devices=amd.com/gpu;"
|
|
448
502
|
"huawei.com/devices=huawei.com/npu;"
|
|
449
503
|
"cambricon.com/devices=cambricon.com/mlu;"
|
|
@@ -451,7 +505,8 @@ variables: dict[str, Callable[[], Any]] = {
|
|
|
451
505
|
"iluvatar.ai/devices=iluvatar.com/gpu;"
|
|
452
506
|
"metax-tech.com/devices=metax-tech.com/gpu;"
|
|
453
507
|
"mthreads.com/devices=mthreads.com/gpu;"
|
|
454
|
-
"nvidia.com/devices=nvidia.com/gpu;"
|
|
508
|
+
"nvidia.com/devices=nvidia.com/gpu;"
|
|
509
|
+
"alibabacloud.com/devices=alibabacloud.com/ppu;",
|
|
455
510
|
),
|
|
456
511
|
),
|
|
457
512
|
"GPUSTACK_RUNTIME_DEPLOY_RESOURCE_KEY_MAP_RUNTIME_VISIBLE_DEVICES": lambda: to_dict(
|
|
@@ -464,20 +519,22 @@ variables: dict[str, Callable[[], Any]] = {
|
|
|
464
519
|
"iluvatar.ai/devices=IX_VISIBLE_DEVICES;"
|
|
465
520
|
"metax-tech.com/devices=CUDA_VISIBLE_DEVICES;"
|
|
466
521
|
"mthreads.com/devices=METHERDS_VISIBLE_DEVICES;"
|
|
467
|
-
"nvidia.com/devices=NVIDIA_VISIBLE_DEVICES;"
|
|
522
|
+
"nvidia.com/devices=NVIDIA_VISIBLE_DEVICES;"
|
|
523
|
+
"alibabacloud.com/devices=NVIDIA_VISIBLE_DEVICES;",
|
|
468
524
|
),
|
|
469
525
|
),
|
|
470
526
|
"GPUSTACK_RUNTIME_DEPLOY_RESOURCE_KEY_MAP_BACKEND_VISIBLE_DEVICES": lambda: to_dict(
|
|
471
527
|
getenv(
|
|
472
528
|
"GPUSTACK_RUNTIME_DEPLOY_RESOURCE_KEY_MAP_BACKEND_VISIBLE_DEVICES",
|
|
473
|
-
"amd.com/devices=HIP_VISIBLE_DEVICES
|
|
529
|
+
"amd.com/devices=HIP_VISIBLE_DEVICES;"
|
|
474
530
|
"huawei.com/devices=ASCEND_RT_VISIBLE_DEVICES,NPU_VISIBLE_DEVICES;"
|
|
475
531
|
"cambricon.com/devices=MLU_VISIBLE_DEVICES;"
|
|
476
532
|
"hygon.com/devices=HIP_VISIBLE_DEVICES;"
|
|
477
533
|
"iluvatar.ai/devices=CUDA_VISIBLE_DEVICES;"
|
|
478
534
|
"metax-tech.com/devices=CUDA_VISIBLE_DEVICES;"
|
|
479
|
-
"mthreads.com/devices=CUDA_VISIBLE_DEVICES;"
|
|
480
|
-
"nvidia.com/devices=CUDA_VISIBLE_DEVICES;"
|
|
535
|
+
"mthreads.com/devices=CUDA_VISIBLE_DEVICES,MUSA_VISIBLE_DEVICES;"
|
|
536
|
+
"nvidia.com/devices=CUDA_VISIBLE_DEVICES;"
|
|
537
|
+
"alibabacloud.com/devices=CUDA_VISIBLE_DEVICES;",
|
|
481
538
|
),
|
|
482
539
|
list_sep=",",
|
|
483
540
|
),
|
|
@@ -495,21 +552,27 @@ variables: dict[str, Callable[[], Any]] = {
|
|
|
495
552
|
sep=",",
|
|
496
553
|
),
|
|
497
554
|
"GPUSTACK_RUNTIME_DEPLOY_CPU_AFFINITY": lambda: to_bool(
|
|
498
|
-
getenv(
|
|
555
|
+
getenv(
|
|
556
|
+
"GPUSTACK_RUNTIME_DEPLOY_CPU_AFFINITY",
|
|
557
|
+
"0",
|
|
558
|
+
),
|
|
499
559
|
),
|
|
500
560
|
"GPUSTACK_RUNTIME_DEPLOY_NUMA_AFFINITY": lambda: to_bool(
|
|
501
|
-
getenv(
|
|
561
|
+
getenv(
|
|
562
|
+
"GPUSTACK_RUNTIME_DEPLOY_NUMA_AFFINITY",
|
|
563
|
+
"0",
|
|
564
|
+
),
|
|
502
565
|
),
|
|
503
566
|
# Deployer
|
|
504
567
|
## Docker
|
|
505
568
|
"GPUSTACK_RUNTIME_DOCKER_HOST": lambda: trim_str(
|
|
506
569
|
getenvs(
|
|
507
|
-
|
|
570
|
+
[
|
|
508
571
|
"GPUSTACK_RUNTIME_DOCKER_HOST",
|
|
509
572
|
# Fallback to standard Docker environment variable.
|
|
510
573
|
"DOCKER_HOST",
|
|
511
574
|
],
|
|
512
|
-
|
|
575
|
+
"http+unix:///var/run/docker.sock",
|
|
513
576
|
),
|
|
514
577
|
),
|
|
515
578
|
"GPUSTACK_RUNTIME_DOCKER_MIRRORED_NAME_FILTER_LABELS": lambda: to_dict(
|
|
@@ -519,7 +582,10 @@ variables: dict[str, Callable[[], Any]] = {
|
|
|
519
582
|
sep=";",
|
|
520
583
|
),
|
|
521
584
|
"GPUSTACK_RUNTIME_DOCKER_IMAGE_NO_PULL_VISUALIZATION": lambda: to_bool(
|
|
522
|
-
getenv(
|
|
585
|
+
getenv(
|
|
586
|
+
"GPUSTACK_RUNTIME_DOCKER_IMAGE_NO_PULL_VISUALIZATION",
|
|
587
|
+
"0",
|
|
588
|
+
),
|
|
523
589
|
),
|
|
524
590
|
"GPUSTACK_RUNTIME_DOCKER_PAUSE_IMAGE": lambda: getenv(
|
|
525
591
|
"GPUSTACK_RUNTIME_DOCKER_PAUSE_IMAGE",
|
|
@@ -530,12 +596,14 @@ variables: dict[str, Callable[[], Any]] = {
|
|
|
530
596
|
"gpustack/runtime:health",
|
|
531
597
|
),
|
|
532
598
|
"GPUSTACK_RUNTIME_DOCKER_MUTE_ORIGINAL_HEALTHCHECK": lambda: to_bool(
|
|
533
|
-
getenv(
|
|
599
|
+
getenv(
|
|
600
|
+
"GPUSTACK_RUNTIME_DOCKER_MUTE_ORIGINAL_HEALTHCHECK",
|
|
601
|
+
"1",
|
|
602
|
+
),
|
|
534
603
|
),
|
|
535
604
|
"GPUSTACK_RUNTIME_DOCKER_RESOURCE_INJECTION_POLICY": lambda: choice(
|
|
536
605
|
getenv(
|
|
537
606
|
"GPUSTACK_RUNTIME_DOCKER_RESOURCE_INJECTION_POLICY",
|
|
538
|
-
"Env",
|
|
539
607
|
),
|
|
540
608
|
options=["Env", "CDI"],
|
|
541
609
|
default="Env",
|
|
@@ -543,7 +611,6 @@ variables: dict[str, Callable[[], Any]] = {
|
|
|
543
611
|
## Kubernetes
|
|
544
612
|
"GPUSTACK_RUNTIME_KUBERNETES_NODE_NAME": lambda: getenv(
|
|
545
613
|
"GPUSTACK_RUNTIME_KUBERNETES_NODE_NAME",
|
|
546
|
-
None,
|
|
547
614
|
),
|
|
548
615
|
"GPUSTACK_RUNTIME_KUBERNETES_NAMESPACE": lambda: getenv(
|
|
549
616
|
"GPUSTACK_RUNTIME_KUBERNETES_NAMESPACE",
|
|
@@ -556,18 +623,19 @@ variables: dict[str, Callable[[], Any]] = {
|
|
|
556
623
|
"GPUSTACK_RUNTIME_KUBERNETES_SERVICE_TYPE": lambda: choice(
|
|
557
624
|
getenv(
|
|
558
625
|
"GPUSTACK_RUNTIME_KUBERNETES_SERVICE_TYPE",
|
|
559
|
-
"ClusterIP",
|
|
560
626
|
),
|
|
561
627
|
options=["ClusterIP", "NodePort", "LoadBalancer"],
|
|
562
628
|
default="ClusterIP",
|
|
563
629
|
),
|
|
564
630
|
"GPUSTACK_RUNTIME_KUBERNETES_QUORUM_READ": lambda: to_bool(
|
|
565
|
-
getenv(
|
|
631
|
+
getenv(
|
|
632
|
+
"GPUSTACK_RUNTIME_KUBERNETES_QUORUM_READ",
|
|
633
|
+
"0",
|
|
634
|
+
),
|
|
566
635
|
),
|
|
567
636
|
"GPUSTACK_RUNTIME_KUBERNETES_DELETE_PROPAGATION_POLICY": lambda: choice(
|
|
568
637
|
getenv(
|
|
569
638
|
"GPUSTACK_RUNTIME_KUBERNETES_DELETE_PROPAGATION_POLICY",
|
|
570
|
-
"Foreground",
|
|
571
639
|
),
|
|
572
640
|
options=["Foreground", "Background", "Orphan"],
|
|
573
641
|
default="Foreground",
|
|
@@ -575,17 +643,17 @@ variables: dict[str, Callable[[], Any]] = {
|
|
|
575
643
|
## Podman
|
|
576
644
|
"GPUSTACK_RUNTIME_PODMAN_HOST": lambda: trim_str(
|
|
577
645
|
getenvs(
|
|
578
|
-
|
|
646
|
+
[
|
|
579
647
|
"GPUSTACK_RUNTIME_PODMAN_HOST",
|
|
580
648
|
# Fallback to standard Podman environment variable.
|
|
581
649
|
"CONTAINER_HOST",
|
|
582
650
|
],
|
|
583
|
-
|
|
651
|
+
"http+unix:///run/podman/podman.sock",
|
|
584
652
|
),
|
|
585
653
|
),
|
|
586
654
|
"GPUSTACK_RUNTIME_PODMAN_MIRRORED_NAME_FILTER_LABELS": lambda: to_dict(
|
|
587
655
|
getenvs(
|
|
588
|
-
|
|
656
|
+
[
|
|
589
657
|
"GPUSTACK_RUNTIME_PODMAN_MIRRORED_NAME_FILTER_LABELS",
|
|
590
658
|
# Fallback to Docker's setting.
|
|
591
659
|
"GPUSTACK_RUNTIME_DOCKER_MIRRORED_NAME_FILTER_LABELS",
|
|
@@ -595,43 +663,42 @@ variables: dict[str, Callable[[], Any]] = {
|
|
|
595
663
|
),
|
|
596
664
|
"GPUSTACK_RUNTIME_PODMAN_IMAGE_NO_PULL_VISUALIZATION": lambda: to_bool(
|
|
597
665
|
getenvs(
|
|
598
|
-
|
|
666
|
+
[
|
|
599
667
|
"GPUSTACK_RUNTIME_PODMAN_IMAGE_NO_PULL_VISUALIZATION",
|
|
600
668
|
# Fallback to Docker's setting.
|
|
601
669
|
"GPUSTACK_RUNTIME_DOCKER_IMAGE_NO_PULL_VISUALIZATION",
|
|
602
670
|
],
|
|
603
|
-
|
|
671
|
+
"0",
|
|
604
672
|
),
|
|
605
673
|
),
|
|
606
674
|
"GPUSTACK_RUNTIME_PODMAN_PAUSE_IMAGE": lambda: getenvs(
|
|
607
|
-
|
|
675
|
+
[
|
|
608
676
|
"GPUSTACK_RUNTIME_PODMAN_PAUSE_IMAGE",
|
|
609
677
|
# Fallback to Docker's setting.
|
|
610
678
|
"GPUSTACK_RUNTIME_DOCKER_PAUSE_IMAGE",
|
|
611
679
|
],
|
|
612
|
-
|
|
680
|
+
"gpustack/runtime:pause",
|
|
613
681
|
),
|
|
614
682
|
"GPUSTACK_RUNTIME_PODMAN_UNHEALTHY_RESTART_IMAGE": lambda: getenvs(
|
|
615
|
-
|
|
683
|
+
[
|
|
616
684
|
"GPUSTACK_RUNTIME_PODMAN_UNHEALTHY_RESTART_IMAGE",
|
|
617
685
|
# Fallback to Docker's setting.
|
|
618
686
|
"GPUSTACK_RUNTIME_DOCKER_UNHEALTHY_RESTART_IMAGE",
|
|
619
687
|
],
|
|
620
|
-
|
|
688
|
+
"gpustack/runtime:health",
|
|
621
689
|
),
|
|
622
690
|
"GPUSTACK_RUNTIME_PODMAN_MUTE_ORIGINAL_HEALTHCHECK": lambda: to_bool(
|
|
623
691
|
getenvs(
|
|
624
|
-
|
|
692
|
+
[
|
|
625
693
|
"GPUSTACK_RUNTIME_PODMAN_MUTE_ORIGINAL_HEALTHCHECK",
|
|
626
694
|
# Fallback to Docker's setting.
|
|
627
695
|
"GPUSTACK_RUNTIME_DOCKER_MUTE_ORIGINAL_HEALTHCHECK",
|
|
628
696
|
],
|
|
629
|
-
|
|
697
|
+
"1",
|
|
630
698
|
),
|
|
631
699
|
),
|
|
632
700
|
}
|
|
633
701
|
|
|
634
|
-
|
|
635
702
|
# --8<-- [end:env-vars-definition]
|
|
636
703
|
|
|
637
704
|
|
|
@@ -664,19 +731,23 @@ def expand_path(path: Path | str) -> Path | str:
|
|
|
664
731
|
return path.expanduser().resolve()
|
|
665
732
|
|
|
666
733
|
|
|
667
|
-
def mkdir_path(path: Path | str | None) -> Path | None:
|
|
734
|
+
def mkdir_path(path: Path | str | None, parents_only: bool = False) -> Path | None:
|
|
668
735
|
"""
|
|
669
736
|
Create a directory if it does not exist.
|
|
670
737
|
|
|
671
738
|
Args:
|
|
672
739
|
path (str | Path): The path to the directory.
|
|
740
|
+
parents_only (bool): If True, only create parent directories.
|
|
673
741
|
|
|
674
742
|
"""
|
|
675
743
|
if not path:
|
|
676
744
|
return None
|
|
677
745
|
if isinstance(path, str):
|
|
678
746
|
path = Path(path)
|
|
679
|
-
|
|
747
|
+
if parents_only:
|
|
748
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
749
|
+
else:
|
|
750
|
+
path.mkdir(parents=True, exist_ok=True)
|
|
680
751
|
return path
|
|
681
752
|
|
|
682
753
|
|
|
@@ -835,7 +906,7 @@ def to_set(value: str | None, sep: str = ",") -> set[str]:
|
|
|
835
906
|
return {item.strip() for item in value.split(sep) if item.strip()}
|
|
836
907
|
|
|
837
908
|
|
|
838
|
-
def choice(value: str, options: list[str], default: str = "") -> str:
|
|
909
|
+
def choice(value: str | None, options: list[str], default: str = "") -> str:
|
|
839
910
|
"""
|
|
840
911
|
Check if a value is one of the given options.
|
|
841
912
|
|
|
@@ -848,6 +919,8 @@ def choice(value: str, options: list[str], default: str = "") -> str:
|
|
|
848
919
|
The value if it is in the options, otherwise the default value.
|
|
849
920
|
|
|
850
921
|
"""
|
|
922
|
+
if value is None:
|
|
923
|
+
return default
|
|
851
924
|
if value in options:
|
|
852
925
|
return value
|
|
853
926
|
return default
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gpustack-runtime
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.40
|
|
4
4
|
Summary: GPUStack Runtime is library for detecting GPU resources and launching GPU workloads.
|
|
5
5
|
Project-URL: Homepage, https://github.com/gpustack/runtime
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/gpustack/gpustack/issues
|
|
@@ -15,8 +15,9 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
15
15
|
Requires-Python: >=3.10
|
|
16
16
|
Requires-Dist: argcomplete>=3.6.3
|
|
17
17
|
Requires-Dist: docker>=7.1.0
|
|
18
|
-
Requires-Dist: gpustack-runner>=0.1.
|
|
18
|
+
Requires-Dist: gpustack-runner>=0.1.24.post1
|
|
19
19
|
Requires-Dist: kubernetes>=33.1.0
|
|
20
|
+
Requires-Dist: mthreads-ml-py>=2.2.10
|
|
20
21
|
Requires-Dist: nvidia-ml-py>=13.580.65
|
|
21
22
|
Requires-Dist: podman==5.6.0
|
|
22
23
|
Requires-Dist: pyyaml
|
|
@@ -37,6 +38,7 @@ It supports detection of a wide range of GPU and accelerator resources, includin
|
|
|
37
38
|
- MetaX GPU
|
|
38
39
|
- Moore Threads GPU
|
|
39
40
|
- NVIDIA GPU
|
|
41
|
+
- T-Head PPU
|
|
40
42
|
|
|
41
43
|
Contributions to support additional GPU resources are welcome!
|
|
42
44
|
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
gpustack_runtime/__init__.py,sha256=kKcK6DMIXOdpWhgMS7xlsNrBNvEmY0L8eyQtBIC3CU4,160
|
|
2
|
+
gpustack_runtime/__main__.py,sha256=LkRkKifYM9DTAo-HAlOQZ2vCQaXxXb49EKyfAYJG2vg,3808
|
|
3
|
+
gpustack_runtime/_version.py,sha256=sMt6Nh8gpjLVyXx1PUIN7_DRt_dwpnQIykoU3KzS7u4,777
|
|
4
|
+
gpustack_runtime/_version.pyi,sha256=A42NoSgcqEXVy2OeNm4LXC9CbyonbooYrSUBlPm2lGY,156
|
|
5
|
+
gpustack_runtime/envs.py,sha256=7CTVHWfzBQn9iN8LcGWOxuLp_7HAd-lFDuAYDmwCB6U,34065
|
|
6
|
+
gpustack_runtime/logging.py,sha256=h_fvD5FV7GHCo00IUDLQmkPR-H6r66IX_WSwZwl0mCw,6869
|
|
7
|
+
gpustack_runtime/cmds/__init__.py,sha256=aPmcuPPNkTna6IctK5OCZUy9JP9yAKd4yz5iPEgvLFc,1222
|
|
8
|
+
gpustack_runtime/cmds/__types__.py,sha256=7C4kQM0EHPD8WpJpTo6kh9rEdkrYALcLQ-GAzMMsqV8,789
|
|
9
|
+
gpustack_runtime/cmds/deployer.py,sha256=6C5MYZISugdCcJX8EfJbJKsgtgw1xkdjpoVBi2OPCcs,28787
|
|
10
|
+
gpustack_runtime/cmds/detector.py,sha256=xTuPkl0Psi6T_n7RvwCHBeubX4AsjXAhc_emrMufY58,8724
|
|
11
|
+
gpustack_runtime/cmds/images.py,sha256=nq25wQGFn-0GgmBjonC3p0G_YbWoKWdWpnGm37YaIhU,568
|
|
12
|
+
gpustack_runtime/deployer/__init__.py,sha256=my4IY7t3obOFnKHCwwwPq363T4OZOjnivoAK4Svu4Ow,15581
|
|
13
|
+
gpustack_runtime/deployer/__patches__.py,sha256=4TCUdDzKBiOYmr5s0UkrEjBU0UjT7U36R0aQbSvrFRE,17823
|
|
14
|
+
gpustack_runtime/deployer/__types__.py,sha256=Yx09FnuPDD2XKgAEUy9PfzkEpZY6V1932Gf8WA4TiAw,72162
|
|
15
|
+
gpustack_runtime/deployer/__utils__.py,sha256=rDfF3mRqL17KsI1l2kfcMjxrEBUL5vBPFPWqiY4cJkw,21072
|
|
16
|
+
gpustack_runtime/deployer/docker.py,sha256=_mZkfd4LG1INcGdiwG-2HxQ3xKoxk__fdcjHRg7hfi0,85011
|
|
17
|
+
gpustack_runtime/deployer/kuberentes.py,sha256=8eohX2UQXgQ8hM1QDaOAe_lmeP_D6VZfcF8cNb1W7XA,87488
|
|
18
|
+
gpustack_runtime/deployer/podman.py,sha256=g1XKeHXMczy3OPsBrBBO9D8bEQ1ewhxvGq2b33Jg-UI,82128
|
|
19
|
+
gpustack_runtime/deployer/cdi/__init__.py,sha256=Cx2Ua7WPy6YctxWHd_Ntd6Zuz47vs4c0Ia_73aNmSbk,1904
|
|
20
|
+
gpustack_runtime/deployer/cdi/__types__.py,sha256=z9HsOnD-FnHbHqdhprxsQATg0yDeGYrDMyAWS2iK7ew,16180
|
|
21
|
+
gpustack_runtime/deployer/cdi/thead.py,sha256=tirkgBGLBrIJFmJoWcSIf2OMwtzAeFBiEzGej_zVtkg,2714
|
|
22
|
+
gpustack_runtime/detector/__init__.py,sha256=aNrWMsin3TXnU37LjazNUJmbaTlBxzWNbQ-ELaZRH78,7204
|
|
23
|
+
gpustack_runtime/detector/__types__.py,sha256=OE-6JtafUpocCk_lHMKJBhU_7OV-8ZbNNFbOYIy2jQ8,13374
|
|
24
|
+
gpustack_runtime/detector/__utils__.py,sha256=3_6RsBmrFJ0TpNk0KkwTju_cWhXA-rP__ZNktjP_T_Q,25269
|
|
25
|
+
gpustack_runtime/detector/amd.py,sha256=JGERVoSx1MlZP9AHs_u92I_Zz4Cl4-fxMzLMBia_F74,18693
|
|
26
|
+
gpustack_runtime/detector/ascend.py,sha256=VkmNM-enbjMNVXKFfv7z6S-4BkwD6YkBmcC0J1ZGEuc,18588
|
|
27
|
+
gpustack_runtime/detector/cambricon.py,sha256=bqWo2mUuf3a5kV8NC1PzFtHIUhVQkSejUSWR5Z5XaGA,3899
|
|
28
|
+
gpustack_runtime/detector/hygon.py,sha256=n_spB46BFSQtUBYEact0bQo25uOWSn0fsZ8Uwcq9DHs,13540
|
|
29
|
+
gpustack_runtime/detector/iluvatar.py,sha256=FKd9ZPb9oEUU1wv-f-t0nmKtY6gAytNvWeqXQktt2is,10899
|
|
30
|
+
gpustack_runtime/detector/metax.py,sha256=YRpZVfz_nG7QTEMqTxqpgi9x5aPYy4gfvYhiUpbz8R8,10146
|
|
31
|
+
gpustack_runtime/detector/mthreads.py,sha256=XW8dyb4i8qVKxHw1Yu08f2YRhpj0Xe8E-MSNfSeOwr4,11012
|
|
32
|
+
gpustack_runtime/detector/nvidia.py,sha256=dGeAd-DAGBIhvuexzC9pVi3NYf2LrzYusvg-IACU_9o,32398
|
|
33
|
+
gpustack_runtime/detector/thead.py,sha256=zP-BqUn6bu2FjLA49u3TyELzykUfNzL8CloX6IqBpnY,26281
|
|
34
|
+
gpustack_runtime/detector/pyacl/__init__.py,sha256=UIdRYql11hGflkFD1bAcO9EwDxr4c3xrU_Mb7TtBWgs,16206
|
|
35
|
+
gpustack_runtime/detector/pyamdgpu/__init__.py,sha256=U5GVzKMIxkwR2UlZOjZQbBPgrYuoBhgKMtpw17zg8ms,8591
|
|
36
|
+
gpustack_runtime/detector/pyamdsmi/__init__.py,sha256=BXAOVnoew6MliU86ci73Rk2yWPeXRUBicFKFWh-r2s0,929
|
|
37
|
+
gpustack_runtime/detector/pycuda/__init__.py,sha256=zBL6seocp5NCapM39g3ANu0SdqopeHg_EgCX1bElzXU,16896
|
|
38
|
+
gpustack_runtime/detector/pydcmi/__init__.py,sha256=f0w5hKs9KmGG8ye0FCJIfGLCA8dx8me0SOyPihBGiV0,37238
|
|
39
|
+
gpustack_runtime/detector/pyhgml/__init__.py,sha256=Yp9s-QhHS4ck7Iq9kd4v6a4BruyJQcuOTYlyYSmnOgI,182896
|
|
40
|
+
gpustack_runtime/detector/pyhgml/libhgml.so,sha256=BPzGVBpzrMX1tSvbXddq8Q0Qhi8w-No2JXX8sRxTioI,2101640
|
|
41
|
+
gpustack_runtime/detector/pyhgml/libuki.so,sha256=EE6v1vIYYT4FSDMMm9rSfAqwrwIPFD-4_6KtP51lSps,702352
|
|
42
|
+
gpustack_runtime/detector/pyhsa/__init__.py,sha256=rmogC5o3Chl4_AhPIjnb8W1YXfIsxou4yp-SbimnUN8,15766
|
|
43
|
+
gpustack_runtime/detector/pyixml/__init__.py,sha256=6ss_Dyl8lIT4WrKpfwmQqzBmg4Bxi38vg_eey_wsSY0,162681
|
|
44
|
+
gpustack_runtime/detector/pymxsml/__init__.py,sha256=spHMs9t2tiV-C9kO-cV_230CBVAZ-j2DWtLfiFU5V3E,25
|
|
45
|
+
gpustack_runtime/detector/pymxsml/mxsml.py,sha256=nRuKSVxIsJj2SJX-SYnE9NGZ7hGjWO9nKczC6sYmSRg,47196
|
|
46
|
+
gpustack_runtime/detector/pymxsml/mxsml_extension.py,sha256=zfWFRGa9eSup336t2lPhIvCbPpa7Prn-7xCHRljg4CI,26967
|
|
47
|
+
gpustack_runtime/detector/pymxsml/mxsml_mcm.py,sha256=a4rX7hJNJKTqLodKU9rYeDaAEKef6UNVThl1w-aiFsA,15363
|
|
48
|
+
gpustack_runtime/detector/pyrocmcore/__init__.py,sha256=5Iwy-U4ogFFQwGh1LrEUBsXgmOmt3VQ70P9MZCq1qxc,2497
|
|
49
|
+
gpustack_runtime/detector/pyrocmsmi/__init__.py,sha256=wlzH54ibvw1qgCBgV6vvDBzyQBNa5A9JVa_hLwhba0o,11880
|
|
50
|
+
gpustack_runtime/_version_appendix.py,sha256=Pkq7kJmQ0Xx40Vuif75Qryjfy_Z8s3lCPKPhInbchpU,23
|
|
51
|
+
gpustack_runtime-0.1.40.dist-info/METADATA,sha256=cxOxG0ZcYgnS2_YC4fZ1lxss4r7OP81MUMRBzBxmcgc,2176
|
|
52
|
+
gpustack_runtime-0.1.40.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
53
|
+
gpustack_runtime-0.1.40.dist-info/entry_points.txt,sha256=bBO_61GxP6dIT74uZwbSDgW5Vt2pTePUS3CgjUJkUgg,68
|
|
54
|
+
gpustack_runtime-0.1.40.dist-info/licenses/LICENSE,sha256=OiPibowBvB-NHV3TP_NOj18XNBlXcshXZFMpa3uvKVE,10362
|
|
55
|
+
gpustack_runtime-0.1.40.dist-info/RECORD,,
|