sagemaker-hyperpod 3.3.0__tar.gz → 3.4.0__tar.gz
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.
- sagemaker_hyperpod-3.4.0/NOTICE +3 -0
- {sagemaker_hyperpod-3.3.0/src/sagemaker_hyperpod.egg-info → sagemaker_hyperpod-3.4.0}/PKG-INFO +299 -2
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/README.md +297 -1
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/pyproject.toml +1 -1
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/setup.py +3 -2
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/clients/kubernetes_client.py +117 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/cluster_utils.py +15 -3
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/commands/cluster.py +71 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/commands/cluster_stack.py +22 -4
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/commands/inference.py +2 -2
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/commands/init.py +15 -7
- sagemaker_hyperpod-3.4.0/src/sagemaker/hyperpod/cli/commands/space.py +140 -0
- sagemaker_hyperpod-3.4.0/src/sagemaker/hyperpod/cli/commands/space_access.py +21 -0
- sagemaker_hyperpod-3.4.0/src/sagemaker/hyperpod/cli/commands/space_template.py +74 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/commands/training.py +20 -1
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/constants/init_constants.py +25 -16
- sagemaker_hyperpod-3.4.0/src/sagemaker/hyperpod/cli/constants/space_access_constants.py +16 -0
- sagemaker_hyperpod-3.4.0/src/sagemaker/hyperpod/cli/constants/space_constants.py +20 -0
- sagemaker_hyperpod-3.4.0/src/sagemaker/hyperpod/cli/constants/space_template_constants.py +16 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/hyp_cli.py +63 -7
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/init_utils.py +31 -1
- sagemaker_hyperpod-3.4.0/src/sagemaker/hyperpod/cli/space_utils.py +439 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cluster_management/hp_cluster_stack.py +8 -6
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/common/utils.py +28 -12
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/inference/config/constants.py +2 -2
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/inference/config/hp_endpoint_config.py +217 -4
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/inference/config/hp_jumpstart_endpoint_config.py +21 -0
- sagemaker_hyperpod-3.4.0/src/sagemaker/hyperpod/inference/constant.py +58 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/inference/hp_endpoint.py +21 -46
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/inference/hp_endpoint_base.py +12 -13
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/inference/hp_jumpstart_endpoint.py +72 -21
- sagemaker_hyperpod-3.4.0/src/sagemaker/hyperpod/space/__init__.py +22 -0
- sagemaker_hyperpod-3.4.0/src/sagemaker/hyperpod/space/hyperpod_space.py +824 -0
- sagemaker_hyperpod-3.4.0/src/sagemaker/hyperpod/space/hyperpod_space_template.py +535 -0
- sagemaker_hyperpod-3.4.0/src/sagemaker/hyperpod/space/utils.py +91 -0
- sagemaker_hyperpod-3.4.0/src/sagemaker/hyperpod/training/accelerator_partition_util.py +125 -0
- sagemaker_hyperpod-3.3.0/src/sagemaker/hyperpod/training/quota_allocation_util.py → sagemaker_hyperpod-3.4.0/src/sagemaker/hyperpod/training/constants.py +13 -160
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/training/hyperpod_pytorch_job.py +112 -14
- sagemaker_hyperpod-3.4.0/src/sagemaker/hyperpod/training/quota_allocation_util.py +375 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0/src/sagemaker_hyperpod.egg-info}/PKG-INFO +299 -2
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker_hyperpod.egg-info/SOURCES.txt +14 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker_hyperpod.egg-info/requires.txt +1 -0
- sagemaker_hyperpod-3.3.0/NOTICE +0 -1
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/LICENSE +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/setup.cfg +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/__init__.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/__init__.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/__init__.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/clients/__init__.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/cluster_stack_utils.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/commands/__init__.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/common_utils.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/constants/__init__.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/constants/command_constants.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/constants/exception_constants.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/constants/hyperpod_instance_types.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/constants/kueue_constants.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/constants/pytorch_constants.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/inference_utils.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/service/__init__.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/service/cancel_training_job.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/service/discover_namespaces.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/service/exec_command.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/service/get_logs.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/service/get_namespaces.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/service/get_training_job.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/service/list_pods.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/service/list_training_jobs.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/service/self_subject_access_review.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/templates/__init__.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/training_utils.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/type_handler_utils.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/utils.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/validators/__init__.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/validators/cluster_validator.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/validators/job_validator.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cli/validators/validator.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cluster_management/__init__.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cluster_management/config/__init__.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/cluster_management/config/hp_cluster_stack_config.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/common/__init__.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/common/cli_decorators.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/common/config/__init__.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/common/config/metadata.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/common/exceptions/__init__.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/common/telemetry/__init__.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/common/telemetry/constants.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/common/telemetry/telemetry_logging.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/common/telemetry/user_agent.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/inference/__init__.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/inference/config/__init__.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/inference/jumpstart_public_hub_visualization_utils.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/observability/MonitoringConfig.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/observability/__init__.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/observability/constants.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/observability/utils.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/training/__init__.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/training/config/__init__.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker/hyperpod/training/config/hyperpod_pytorch_job_unified_config.py +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker_hyperpod.egg-info/dependency_links.txt +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker_hyperpod.egg-info/entry_points.txt +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker_hyperpod.egg-info/top_level.txt +0 -0
- {sagemaker_hyperpod-3.3.0 → sagemaker_hyperpod-3.4.0}/src/sagemaker_hyperpod.egg-info/zip-safe +0 -0
{sagemaker_hyperpod-3.3.0/src/sagemaker_hyperpod.egg-info → sagemaker_hyperpod-3.4.0}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sagemaker-hyperpod
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.4.0
|
|
4
4
|
Summary: Amazon SageMaker HyperPod SDK and CLI
|
|
5
5
|
Home-page: https://github.com/aws/sagemaker-hyperpod-cli
|
|
6
6
|
Author: Amazon Web Services
|
|
@@ -48,6 +48,7 @@ Requires-Dist: hyperpod-pytorch-job-template<2.0.0,>=1.0.0
|
|
|
48
48
|
Requires-Dist: hyperpod-custom-inference-template<2.0.0,>=1.0.0
|
|
49
49
|
Requires-Dist: hyperpod-jumpstart-inference-template<2.0.0,>=1.0.0
|
|
50
50
|
Requires-Dist: hyperpod-cluster-stack-template<2.0.0,>=1.0.0
|
|
51
|
+
Requires-Dist: hyperpod_space_template<2.0.0,>=1.0.0
|
|
51
52
|
Dynamic: home-page
|
|
52
53
|
Dynamic: license-file
|
|
53
54
|
Dynamic: requires-dist
|
|
@@ -76,10 +77,12 @@ Note: Old `hyperpod`CLI V2 has been moved to `release_v2` branch. Please refer [
|
|
|
76
77
|
- [Inference](#inference)
|
|
77
78
|
- [Jumpstart Endpoint](#jumpstart-endpoint-creation)
|
|
78
79
|
- [Custom Endpoint](#custom-endpoint-creation)
|
|
80
|
+
- [Space](#space)
|
|
79
81
|
- [SDK](#sdk)
|
|
80
82
|
- [Cluster Management](#cluster-management-sdk)
|
|
81
83
|
- [Training](#training-sdk)
|
|
82
84
|
- [Inference](#inference-sdk)
|
|
85
|
+
- [Space](#space-sdk)
|
|
83
86
|
- [Examples](#examples)
|
|
84
87
|
|
|
85
88
|
|
|
@@ -101,7 +104,7 @@ The SageMaker HyperPod CLI is a tool that helps create training jobs and inferen
|
|
|
101
104
|
### Prerequisites for Inference
|
|
102
105
|
|
|
103
106
|
- HyperPod CLI supports creating Inference Endpoints through jumpstart and through custom Endpoint config
|
|
104
|
-
- You can follow [inference operator doc](https://
|
|
107
|
+
- You can follow [inference operator doc](https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-hyperpod-model-deployment-setup.html) to install it.
|
|
105
108
|
|
|
106
109
|
## Platform Support
|
|
107
110
|
|
|
@@ -355,6 +358,37 @@ hyp create hyp-pytorch-job \
|
|
|
355
358
|
--volume name=training-output,type=pvc,mount_path=/data2,claim_name=my-pvc,read_only=false
|
|
356
359
|
```
|
|
357
360
|
|
|
361
|
+
**Example with accelerator parititons:**
|
|
362
|
+
|
|
363
|
+
```bash
|
|
364
|
+
hyp create hyp-pytorch-job \
|
|
365
|
+
--version 1.1 \
|
|
366
|
+
--job-name test-pytorch-job \
|
|
367
|
+
--image pytorch/pytorch:latest \
|
|
368
|
+
--command '[python, train.py]' \
|
|
369
|
+
--args '[--epochs=10, --batch-size=32]' \
|
|
370
|
+
--environment '{"PYTORCH_CUDA_ALLOC_CONF": "max_split_size_mb:32"}' \
|
|
371
|
+
--pull-policy "IfNotPresent" \
|
|
372
|
+
--instance-type ml.p4d.24xlarge \
|
|
373
|
+
--tasks-per-node 8 \
|
|
374
|
+
--label-selector '{"accelerator": "nvidia", "network": "efa"}' \
|
|
375
|
+
--deep-health-check-passed-nodes-only true \
|
|
376
|
+
--scheduler-type "kueue" \
|
|
377
|
+
--queue-name "training-queue" \
|
|
378
|
+
--priority "high" \
|
|
379
|
+
--max-retry 3 \
|
|
380
|
+
--accelerator-partition-type "mig-1g.5gb" \
|
|
381
|
+
--accelerator-partition-count 2 \
|
|
382
|
+
--accelerator-partition-limit 4 \
|
|
383
|
+
--vcpu 96.0 \
|
|
384
|
+
--memory 1152.0 \
|
|
385
|
+
--vcpu-limit 96.0 \
|
|
386
|
+
--memory-limit 1152.0 \
|
|
387
|
+
--preferred-topology "topology.kubernetes.io/zone=us-west-2a" \
|
|
388
|
+
--volume name=model-data,type=hostPath,mount_path=/data,path=/data \
|
|
389
|
+
--volume name=training-output,type=pvc,mount_path=/data2,claim_name=my-pvc,read_only=false
|
|
390
|
+
```
|
|
391
|
+
|
|
358
392
|
| Parameter | Type | Required | Description |
|
|
359
393
|
|-----------|------|----------|-------------|
|
|
360
394
|
| `--job-name` | TEXT | Yes | Unique name for the training job (1-63 characters, alphanumeric with hyphens) |
|
|
@@ -381,10 +415,21 @@ hyp create hyp-pytorch-job \
|
|
|
381
415
|
| `--accelerators-limit` | INTEGER | No | Limit for the number of accelerators a.k.a GPUs or Trainium Chips |
|
|
382
416
|
| `--vcpu-limit` | FLOAT | No | Limit for the number of vCPUs |
|
|
383
417
|
| `--memory-limit` | FLOAT | No | Limit for the amount of memory in GiB |
|
|
418
|
+
| `--accelerator-partition-type` | TEXT | No | Type of accelerator partition (e.g., mig-1g.5gb, mig-2g.10gb, mig-3g.20gb, mig-4g.20gb, mig-7g.40gb) |
|
|
419
|
+
| `--accelerator-partition-count` | INTEGER | No | Number of accelerator partitions to request (minimum: 1) |
|
|
420
|
+
| `--accelerator-partition-limit` | INTEGER | No | Limit for the number of accelerator partitions (minimum: 1) |
|
|
384
421
|
| `--preferred-topology` | TEXT | No | Preferred topology annotation for scheduling |
|
|
385
422
|
| `--required-topology` | TEXT | No | Required topology annotation for scheduling |
|
|
386
423
|
| `--debug` | FLAG | No | Enable debug mode (default: false) |
|
|
387
424
|
|
|
425
|
+
#### List Available Accelerator Partition Types
|
|
426
|
+
|
|
427
|
+
This command lists the available accelerator partition types on the cluster for a specific instance type.
|
|
428
|
+
|
|
429
|
+
```bash
|
|
430
|
+
hyp list-accelerator-partition-type --instance-type <instance-type>
|
|
431
|
+
```
|
|
432
|
+
|
|
388
433
|
#### List Training Jobs
|
|
389
434
|
|
|
390
435
|
```bash
|
|
@@ -669,6 +714,105 @@ hyp get-operator-logs hyp-custom-endpoint --since-hours 0.5
|
|
|
669
714
|
hyp delete hyp-custom-endpoint --name endpoint-custom
|
|
670
715
|
```
|
|
671
716
|
|
|
717
|
+
### Space
|
|
718
|
+
|
|
719
|
+
#### Create a Space
|
|
720
|
+
|
|
721
|
+
```bash
|
|
722
|
+
hyp create hyp-space \
|
|
723
|
+
--name myspace \
|
|
724
|
+
--namespace default \
|
|
725
|
+
--display-name "My Space"
|
|
726
|
+
```
|
|
727
|
+
|
|
728
|
+
| Parameter | Type | Required | Description |
|
|
729
|
+
|-----------|------|----------|-------------|
|
|
730
|
+
| `--name` | TEXT | Yes | Space name |
|
|
731
|
+
| `--display-name` | TEXT | Yes | Display Name of the space |
|
|
732
|
+
| `--namespace` | TEXT | No | Kubernetes namespace |
|
|
733
|
+
| `--image` | TEXT | No | Image specifies the container image to use |
|
|
734
|
+
| `--desired-status` | TEXT | No | DesiredStatus specifies the desired operational status |
|
|
735
|
+
| `--ownership-type` | TEXT | No | OwnershipType specifies who can modify the space. 'Public' means anyone with RBAC permissions can update/delete the space. 'OwnerOnly' means only the creator can update/delete the space. |
|
|
736
|
+
| `--node-selector` | TEXT | No | NodeSelector specifies node selection constraints for the space pod (JSON string) |
|
|
737
|
+
| `--affinity` | TEXT | No | Affinity specifies node affinity and anti-affinity rules for the space pod (JSON string) |
|
|
738
|
+
| `--tolerations` | TEXT | No | Tolerations specifies tolerations for the space pod to schedule on nodes with matching taints (JSON string) |
|
|
739
|
+
| `--lifecycle` | TEXT | No | Lifecycle specifies actions that the management system should take in response to container lifecycle events (JSON string) |
|
|
740
|
+
| `--app-type` | TEXT | No | AppType specifies the application type for this workspace |
|
|
741
|
+
| `--service-account-name` | TEXT | No | ServiceAccountName specifies the name of the ServiceAccount to use for the workspace pod |
|
|
742
|
+
| `--idle-shutdown` | TEXT | No | Idle shutdown configuration. Format: --idle-shutdown enabled=<bool>,idleTimeoutInMinutes=<int>,detection=<JSON string> |
|
|
743
|
+
| `--template-ref` | TEXT | No | TemplateRef references a WorkspaceTemplate to use as base configuration. Format: --template-ref name=<name>,namespace=<namespace> |
|
|
744
|
+
| `--container-config` | TEXT | No | Container configuration. Format: --container-config command=<cmd>,args=<arg1;arg2> |
|
|
745
|
+
| `--storage` | TEXT | No | Storage configuration. Format: --storage storageClassName=<class>,size=<size>,mountPath=<path> |
|
|
746
|
+
| `--volume` | TEXT | No | Volume configuration. Format: --volume name=<name>,mountPath=<path>,persistentVolumeClaimName=<pvc_name>. Use multiple --volume flags for multiple volumes. |
|
|
747
|
+
| `--accelerator-partition-count` | TEXT | No | Fractional GPU partition count, e.g. '1' |
|
|
748
|
+
| `--accelerator-partition-type` | TEXT | No | Fractional GPU partition type, e.g. 'mig-3g.20gb' |
|
|
749
|
+
| `--gpu-limit` | TEXT | No | GPU resource limit, e.g. '1' |
|
|
750
|
+
| `--gpu` | TEXT | No | GPU resource request, e.g. '1' |
|
|
751
|
+
| `--memory-limit` | TEXT | No | Memory resource limit, e.g. '2Gi' |
|
|
752
|
+
| `--memory` | TEXT | No | Memory resource request, e.g. '2Gi' |
|
|
753
|
+
| `--cpu-limit` | TEXT | No | CPU resource limit, e.g. '500m' |
|
|
754
|
+
| `--cpu` | TEXT | No | CPU resource request, e.g. '500m' |
|
|
755
|
+
|
|
756
|
+
#### List Spaces
|
|
757
|
+
|
|
758
|
+
```bash
|
|
759
|
+
hyp list hyp-space
|
|
760
|
+
```
|
|
761
|
+
|
|
762
|
+
#### Describe a Space
|
|
763
|
+
|
|
764
|
+
```bash
|
|
765
|
+
hyp describe hyp-space --name myspace
|
|
766
|
+
```
|
|
767
|
+
|
|
768
|
+
#### Update a Space
|
|
769
|
+
|
|
770
|
+
```bash
|
|
771
|
+
hyp update hyp-space \
|
|
772
|
+
--name myspace \
|
|
773
|
+
--display-name "Updated Space Name"
|
|
774
|
+
```
|
|
775
|
+
|
|
776
|
+
#### Start/Stop a Space
|
|
777
|
+
|
|
778
|
+
```bash
|
|
779
|
+
hyp start hyp-space --name myspace
|
|
780
|
+
hyp stop hyp-space --name myspace
|
|
781
|
+
```
|
|
782
|
+
|
|
783
|
+
#### Get Logs
|
|
784
|
+
|
|
785
|
+
```bash
|
|
786
|
+
hyp get-logs hyp-space --name myspace
|
|
787
|
+
```
|
|
788
|
+
|
|
789
|
+
#### Delete a Space
|
|
790
|
+
|
|
791
|
+
```bash
|
|
792
|
+
hyp delete hyp-space --name myspace
|
|
793
|
+
```
|
|
794
|
+
|
|
795
|
+
#### Space Template Management
|
|
796
|
+
|
|
797
|
+
Create reusable space templates:
|
|
798
|
+
|
|
799
|
+
```bash
|
|
800
|
+
hyp create hyp-space-template --file template.yaml
|
|
801
|
+
hyp list hyp-space-template
|
|
802
|
+
hyp describe hyp-space-template --name <template-name>
|
|
803
|
+
hyp update hyp-space-template --name <template-name> --file updated-template.yaml
|
|
804
|
+
hyp delete hyp-space-template --name <template-name>
|
|
805
|
+
```
|
|
806
|
+
|
|
807
|
+
#### Space Access
|
|
808
|
+
|
|
809
|
+
Create remote access to spaces:
|
|
810
|
+
|
|
811
|
+
```bash
|
|
812
|
+
hyp create hyp-space-access --name myspace --connection-type vscode-remote
|
|
813
|
+
hyp create hyp-space-access --name myspace --connection-type web-ui
|
|
814
|
+
```
|
|
815
|
+
|
|
672
816
|
## SDK
|
|
673
817
|
|
|
674
818
|
Along with the CLI, we also have SDKs available that can perform the cluster management, training and inference functionalities that the CLI performs
|
|
@@ -1048,6 +1192,159 @@ from sagemaker.hyperpod.observability.utils import get_monitoring_config
|
|
|
1048
1192
|
monitor_config = get_monitoring_config()
|
|
1049
1193
|
```
|
|
1050
1194
|
|
|
1195
|
+
### Space SDK
|
|
1196
|
+
|
|
1197
|
+
#### Creating a Space
|
|
1198
|
+
|
|
1199
|
+
```python
|
|
1200
|
+
from sagemaker.hyperpod.space.hyperpod_space import HPSpace
|
|
1201
|
+
from hyperpod_space_template.v1_0.model import SpaceConfig
|
|
1202
|
+
|
|
1203
|
+
# Create space configuration
|
|
1204
|
+
space_config = SpaceConfig(
|
|
1205
|
+
name="myspace",
|
|
1206
|
+
namespace="default",
|
|
1207
|
+
display_name="My Space",
|
|
1208
|
+
)
|
|
1209
|
+
|
|
1210
|
+
# Create and start the space
|
|
1211
|
+
space = HPSpace(config=space_config)
|
|
1212
|
+
space.create()
|
|
1213
|
+
```
|
|
1214
|
+
|
|
1215
|
+
#### List Spaces
|
|
1216
|
+
|
|
1217
|
+
```python
|
|
1218
|
+
from sagemaker.hyperpod.space.hyperpod_space import HPSpace
|
|
1219
|
+
|
|
1220
|
+
# List all spaces in default namespace
|
|
1221
|
+
spaces = HPSpace.list()
|
|
1222
|
+
for space in spaces:
|
|
1223
|
+
print(f"Space: {space.config.name}, Status: {space.status}")
|
|
1224
|
+
|
|
1225
|
+
# List spaces in specific namespace
|
|
1226
|
+
spaces = HPSpace.list(namespace="your-namespace")
|
|
1227
|
+
```
|
|
1228
|
+
|
|
1229
|
+
#### Get a Space
|
|
1230
|
+
|
|
1231
|
+
```python
|
|
1232
|
+
from sagemaker.hyperpod.space.hyperpod_space import HPSpace
|
|
1233
|
+
|
|
1234
|
+
# Get specific space
|
|
1235
|
+
space = HPSpace.get(name="myspace", namespace="default")
|
|
1236
|
+
print(f"Space name: {space.config.name}")
|
|
1237
|
+
print(f"Display name: {space.config.display_name}")
|
|
1238
|
+
```
|
|
1239
|
+
|
|
1240
|
+
#### Update a Space
|
|
1241
|
+
|
|
1242
|
+
```python
|
|
1243
|
+
from sagemaker.hyperpod.space.hyperpod_space import HPSpace
|
|
1244
|
+
|
|
1245
|
+
# Get existing space
|
|
1246
|
+
space = HPSpace.get(name="myspace")
|
|
1247
|
+
|
|
1248
|
+
# Update space configuration
|
|
1249
|
+
space.update(
|
|
1250
|
+
display_name="Updated Space Name",
|
|
1251
|
+
)
|
|
1252
|
+
```
|
|
1253
|
+
|
|
1254
|
+
#### Start/Stop a Space
|
|
1255
|
+
|
|
1256
|
+
```python
|
|
1257
|
+
from sagemaker.hyperpod.space.hyperpod_space import HPSpace
|
|
1258
|
+
|
|
1259
|
+
# Get existing space
|
|
1260
|
+
space = HPSpace.get(name="myspace")
|
|
1261
|
+
|
|
1262
|
+
# Start the space
|
|
1263
|
+
space.start()
|
|
1264
|
+
|
|
1265
|
+
# Stop the space
|
|
1266
|
+
space.stop()
|
|
1267
|
+
```
|
|
1268
|
+
|
|
1269
|
+
#### Get Space Logs
|
|
1270
|
+
|
|
1271
|
+
```python
|
|
1272
|
+
from sagemaker.hyperpod.space.hyperpod_space import HPSpace
|
|
1273
|
+
|
|
1274
|
+
# Get space and retrieve logs
|
|
1275
|
+
space = HPSpace.get(name="myspace")
|
|
1276
|
+
|
|
1277
|
+
# Get logs from default pod and container
|
|
1278
|
+
logs = space.get_logs()
|
|
1279
|
+
print(logs)
|
|
1280
|
+
```
|
|
1281
|
+
|
|
1282
|
+
#### List Space Pods
|
|
1283
|
+
|
|
1284
|
+
```python
|
|
1285
|
+
from sagemaker.hyperpod.space.hyperpod_space import HPSpace
|
|
1286
|
+
|
|
1287
|
+
# Get space and list associated pods
|
|
1288
|
+
space = HPSpace.get(name="myspace")
|
|
1289
|
+
pods = space.list_pods()
|
|
1290
|
+
for pod in pods:
|
|
1291
|
+
print(f"Pod: {pod}")
|
|
1292
|
+
```
|
|
1293
|
+
|
|
1294
|
+
#### Create Space Access
|
|
1295
|
+
|
|
1296
|
+
```python
|
|
1297
|
+
from sagemaker.hyperpod.space.hyperpod_space import HPSpace
|
|
1298
|
+
|
|
1299
|
+
# Get existing space
|
|
1300
|
+
space = HPSpace.get(name="myspace")
|
|
1301
|
+
|
|
1302
|
+
# Create VS Code remote access
|
|
1303
|
+
vscode_access = space.create_space_access(connection_type="vscode-remote")
|
|
1304
|
+
print(f"VS Code URL: {vscode_access['SpaceConnectionUrl']}")
|
|
1305
|
+
|
|
1306
|
+
# Create web UI access
|
|
1307
|
+
web_access = space.create_space_access(connection_type="web-ui")
|
|
1308
|
+
print(f"Web UI URL: {web_access['SpaceConnectionUrl']}")
|
|
1309
|
+
```
|
|
1310
|
+
|
|
1311
|
+
#### Delete a Space
|
|
1312
|
+
|
|
1313
|
+
```python
|
|
1314
|
+
from sagemaker.hyperpod.space.hyperpod_space import HPSpace
|
|
1315
|
+
|
|
1316
|
+
# Get existing space
|
|
1317
|
+
space = HPSpace.get(name="myspace")
|
|
1318
|
+
|
|
1319
|
+
# Delete the space
|
|
1320
|
+
space.delete()
|
|
1321
|
+
```
|
|
1322
|
+
|
|
1323
|
+
#### Space Template Management
|
|
1324
|
+
|
|
1325
|
+
```python
|
|
1326
|
+
from sagemaker.hyperpod.space.hyperpod_space_template import HPSpaceTemplate
|
|
1327
|
+
|
|
1328
|
+
# Create space template from YAML file
|
|
1329
|
+
template = HPSpaceTemplate(file_path="template.yaml")
|
|
1330
|
+
template.create()
|
|
1331
|
+
|
|
1332
|
+
# List all space templates
|
|
1333
|
+
templates = HPSpaceTemplate.list()
|
|
1334
|
+
for template in templates:
|
|
1335
|
+
print(f"Template: {template.name}")
|
|
1336
|
+
|
|
1337
|
+
# Get specific space template
|
|
1338
|
+
template = HPSpaceTemplate.get(name="my-template")
|
|
1339
|
+
print(template.to_yaml())
|
|
1340
|
+
|
|
1341
|
+
# Update space template
|
|
1342
|
+
template.update(file_path="updated-template.yaml")
|
|
1343
|
+
|
|
1344
|
+
# Delete space template
|
|
1345
|
+
template.delete()
|
|
1346
|
+
```
|
|
1347
|
+
|
|
1051
1348
|
## Examples
|
|
1052
1349
|
#### Cluster Management Example Notebooks
|
|
1053
1350
|
|
|
@@ -21,10 +21,12 @@ Note: Old `hyperpod`CLI V2 has been moved to `release_v2` branch. Please refer [
|
|
|
21
21
|
- [Inference](#inference)
|
|
22
22
|
- [Jumpstart Endpoint](#jumpstart-endpoint-creation)
|
|
23
23
|
- [Custom Endpoint](#custom-endpoint-creation)
|
|
24
|
+
- [Space](#space)
|
|
24
25
|
- [SDK](#sdk)
|
|
25
26
|
- [Cluster Management](#cluster-management-sdk)
|
|
26
27
|
- [Training](#training-sdk)
|
|
27
28
|
- [Inference](#inference-sdk)
|
|
29
|
+
- [Space](#space-sdk)
|
|
28
30
|
- [Examples](#examples)
|
|
29
31
|
|
|
30
32
|
|
|
@@ -46,7 +48,7 @@ The SageMaker HyperPod CLI is a tool that helps create training jobs and inferen
|
|
|
46
48
|
### Prerequisites for Inference
|
|
47
49
|
|
|
48
50
|
- HyperPod CLI supports creating Inference Endpoints through jumpstart and through custom Endpoint config
|
|
49
|
-
- You can follow [inference operator doc](https://
|
|
51
|
+
- You can follow [inference operator doc](https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-hyperpod-model-deployment-setup.html) to install it.
|
|
50
52
|
|
|
51
53
|
## Platform Support
|
|
52
54
|
|
|
@@ -300,6 +302,37 @@ hyp create hyp-pytorch-job \
|
|
|
300
302
|
--volume name=training-output,type=pvc,mount_path=/data2,claim_name=my-pvc,read_only=false
|
|
301
303
|
```
|
|
302
304
|
|
|
305
|
+
**Example with accelerator parititons:**
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
hyp create hyp-pytorch-job \
|
|
309
|
+
--version 1.1 \
|
|
310
|
+
--job-name test-pytorch-job \
|
|
311
|
+
--image pytorch/pytorch:latest \
|
|
312
|
+
--command '[python, train.py]' \
|
|
313
|
+
--args '[--epochs=10, --batch-size=32]' \
|
|
314
|
+
--environment '{"PYTORCH_CUDA_ALLOC_CONF": "max_split_size_mb:32"}' \
|
|
315
|
+
--pull-policy "IfNotPresent" \
|
|
316
|
+
--instance-type ml.p4d.24xlarge \
|
|
317
|
+
--tasks-per-node 8 \
|
|
318
|
+
--label-selector '{"accelerator": "nvidia", "network": "efa"}' \
|
|
319
|
+
--deep-health-check-passed-nodes-only true \
|
|
320
|
+
--scheduler-type "kueue" \
|
|
321
|
+
--queue-name "training-queue" \
|
|
322
|
+
--priority "high" \
|
|
323
|
+
--max-retry 3 \
|
|
324
|
+
--accelerator-partition-type "mig-1g.5gb" \
|
|
325
|
+
--accelerator-partition-count 2 \
|
|
326
|
+
--accelerator-partition-limit 4 \
|
|
327
|
+
--vcpu 96.0 \
|
|
328
|
+
--memory 1152.0 \
|
|
329
|
+
--vcpu-limit 96.0 \
|
|
330
|
+
--memory-limit 1152.0 \
|
|
331
|
+
--preferred-topology "topology.kubernetes.io/zone=us-west-2a" \
|
|
332
|
+
--volume name=model-data,type=hostPath,mount_path=/data,path=/data \
|
|
333
|
+
--volume name=training-output,type=pvc,mount_path=/data2,claim_name=my-pvc,read_only=false
|
|
334
|
+
```
|
|
335
|
+
|
|
303
336
|
| Parameter | Type | Required | Description |
|
|
304
337
|
|-----------|------|----------|-------------|
|
|
305
338
|
| `--job-name` | TEXT | Yes | Unique name for the training job (1-63 characters, alphanumeric with hyphens) |
|
|
@@ -326,10 +359,21 @@ hyp create hyp-pytorch-job \
|
|
|
326
359
|
| `--accelerators-limit` | INTEGER | No | Limit for the number of accelerators a.k.a GPUs or Trainium Chips |
|
|
327
360
|
| `--vcpu-limit` | FLOAT | No | Limit for the number of vCPUs |
|
|
328
361
|
| `--memory-limit` | FLOAT | No | Limit for the amount of memory in GiB |
|
|
362
|
+
| `--accelerator-partition-type` | TEXT | No | Type of accelerator partition (e.g., mig-1g.5gb, mig-2g.10gb, mig-3g.20gb, mig-4g.20gb, mig-7g.40gb) |
|
|
363
|
+
| `--accelerator-partition-count` | INTEGER | No | Number of accelerator partitions to request (minimum: 1) |
|
|
364
|
+
| `--accelerator-partition-limit` | INTEGER | No | Limit for the number of accelerator partitions (minimum: 1) |
|
|
329
365
|
| `--preferred-topology` | TEXT | No | Preferred topology annotation for scheduling |
|
|
330
366
|
| `--required-topology` | TEXT | No | Required topology annotation for scheduling |
|
|
331
367
|
| `--debug` | FLAG | No | Enable debug mode (default: false) |
|
|
332
368
|
|
|
369
|
+
#### List Available Accelerator Partition Types
|
|
370
|
+
|
|
371
|
+
This command lists the available accelerator partition types on the cluster for a specific instance type.
|
|
372
|
+
|
|
373
|
+
```bash
|
|
374
|
+
hyp list-accelerator-partition-type --instance-type <instance-type>
|
|
375
|
+
```
|
|
376
|
+
|
|
333
377
|
#### List Training Jobs
|
|
334
378
|
|
|
335
379
|
```bash
|
|
@@ -614,6 +658,105 @@ hyp get-operator-logs hyp-custom-endpoint --since-hours 0.5
|
|
|
614
658
|
hyp delete hyp-custom-endpoint --name endpoint-custom
|
|
615
659
|
```
|
|
616
660
|
|
|
661
|
+
### Space
|
|
662
|
+
|
|
663
|
+
#### Create a Space
|
|
664
|
+
|
|
665
|
+
```bash
|
|
666
|
+
hyp create hyp-space \
|
|
667
|
+
--name myspace \
|
|
668
|
+
--namespace default \
|
|
669
|
+
--display-name "My Space"
|
|
670
|
+
```
|
|
671
|
+
|
|
672
|
+
| Parameter | Type | Required | Description |
|
|
673
|
+
|-----------|------|----------|-------------|
|
|
674
|
+
| `--name` | TEXT | Yes | Space name |
|
|
675
|
+
| `--display-name` | TEXT | Yes | Display Name of the space |
|
|
676
|
+
| `--namespace` | TEXT | No | Kubernetes namespace |
|
|
677
|
+
| `--image` | TEXT | No | Image specifies the container image to use |
|
|
678
|
+
| `--desired-status` | TEXT | No | DesiredStatus specifies the desired operational status |
|
|
679
|
+
| `--ownership-type` | TEXT | No | OwnershipType specifies who can modify the space. 'Public' means anyone with RBAC permissions can update/delete the space. 'OwnerOnly' means only the creator can update/delete the space. |
|
|
680
|
+
| `--node-selector` | TEXT | No | NodeSelector specifies node selection constraints for the space pod (JSON string) |
|
|
681
|
+
| `--affinity` | TEXT | No | Affinity specifies node affinity and anti-affinity rules for the space pod (JSON string) |
|
|
682
|
+
| `--tolerations` | TEXT | No | Tolerations specifies tolerations for the space pod to schedule on nodes with matching taints (JSON string) |
|
|
683
|
+
| `--lifecycle` | TEXT | No | Lifecycle specifies actions that the management system should take in response to container lifecycle events (JSON string) |
|
|
684
|
+
| `--app-type` | TEXT | No | AppType specifies the application type for this workspace |
|
|
685
|
+
| `--service-account-name` | TEXT | No | ServiceAccountName specifies the name of the ServiceAccount to use for the workspace pod |
|
|
686
|
+
| `--idle-shutdown` | TEXT | No | Idle shutdown configuration. Format: --idle-shutdown enabled=<bool>,idleTimeoutInMinutes=<int>,detection=<JSON string> |
|
|
687
|
+
| `--template-ref` | TEXT | No | TemplateRef references a WorkspaceTemplate to use as base configuration. Format: --template-ref name=<name>,namespace=<namespace> |
|
|
688
|
+
| `--container-config` | TEXT | No | Container configuration. Format: --container-config command=<cmd>,args=<arg1;arg2> |
|
|
689
|
+
| `--storage` | TEXT | No | Storage configuration. Format: --storage storageClassName=<class>,size=<size>,mountPath=<path> |
|
|
690
|
+
| `--volume` | TEXT | No | Volume configuration. Format: --volume name=<name>,mountPath=<path>,persistentVolumeClaimName=<pvc_name>. Use multiple --volume flags for multiple volumes. |
|
|
691
|
+
| `--accelerator-partition-count` | TEXT | No | Fractional GPU partition count, e.g. '1' |
|
|
692
|
+
| `--accelerator-partition-type` | TEXT | No | Fractional GPU partition type, e.g. 'mig-3g.20gb' |
|
|
693
|
+
| `--gpu-limit` | TEXT | No | GPU resource limit, e.g. '1' |
|
|
694
|
+
| `--gpu` | TEXT | No | GPU resource request, e.g. '1' |
|
|
695
|
+
| `--memory-limit` | TEXT | No | Memory resource limit, e.g. '2Gi' |
|
|
696
|
+
| `--memory` | TEXT | No | Memory resource request, e.g. '2Gi' |
|
|
697
|
+
| `--cpu-limit` | TEXT | No | CPU resource limit, e.g. '500m' |
|
|
698
|
+
| `--cpu` | TEXT | No | CPU resource request, e.g. '500m' |
|
|
699
|
+
|
|
700
|
+
#### List Spaces
|
|
701
|
+
|
|
702
|
+
```bash
|
|
703
|
+
hyp list hyp-space
|
|
704
|
+
```
|
|
705
|
+
|
|
706
|
+
#### Describe a Space
|
|
707
|
+
|
|
708
|
+
```bash
|
|
709
|
+
hyp describe hyp-space --name myspace
|
|
710
|
+
```
|
|
711
|
+
|
|
712
|
+
#### Update a Space
|
|
713
|
+
|
|
714
|
+
```bash
|
|
715
|
+
hyp update hyp-space \
|
|
716
|
+
--name myspace \
|
|
717
|
+
--display-name "Updated Space Name"
|
|
718
|
+
```
|
|
719
|
+
|
|
720
|
+
#### Start/Stop a Space
|
|
721
|
+
|
|
722
|
+
```bash
|
|
723
|
+
hyp start hyp-space --name myspace
|
|
724
|
+
hyp stop hyp-space --name myspace
|
|
725
|
+
```
|
|
726
|
+
|
|
727
|
+
#### Get Logs
|
|
728
|
+
|
|
729
|
+
```bash
|
|
730
|
+
hyp get-logs hyp-space --name myspace
|
|
731
|
+
```
|
|
732
|
+
|
|
733
|
+
#### Delete a Space
|
|
734
|
+
|
|
735
|
+
```bash
|
|
736
|
+
hyp delete hyp-space --name myspace
|
|
737
|
+
```
|
|
738
|
+
|
|
739
|
+
#### Space Template Management
|
|
740
|
+
|
|
741
|
+
Create reusable space templates:
|
|
742
|
+
|
|
743
|
+
```bash
|
|
744
|
+
hyp create hyp-space-template --file template.yaml
|
|
745
|
+
hyp list hyp-space-template
|
|
746
|
+
hyp describe hyp-space-template --name <template-name>
|
|
747
|
+
hyp update hyp-space-template --name <template-name> --file updated-template.yaml
|
|
748
|
+
hyp delete hyp-space-template --name <template-name>
|
|
749
|
+
```
|
|
750
|
+
|
|
751
|
+
#### Space Access
|
|
752
|
+
|
|
753
|
+
Create remote access to spaces:
|
|
754
|
+
|
|
755
|
+
```bash
|
|
756
|
+
hyp create hyp-space-access --name myspace --connection-type vscode-remote
|
|
757
|
+
hyp create hyp-space-access --name myspace --connection-type web-ui
|
|
758
|
+
```
|
|
759
|
+
|
|
617
760
|
## SDK
|
|
618
761
|
|
|
619
762
|
Along with the CLI, we also have SDKs available that can perform the cluster management, training and inference functionalities that the CLI performs
|
|
@@ -993,6 +1136,159 @@ from sagemaker.hyperpod.observability.utils import get_monitoring_config
|
|
|
993
1136
|
monitor_config = get_monitoring_config()
|
|
994
1137
|
```
|
|
995
1138
|
|
|
1139
|
+
### Space SDK
|
|
1140
|
+
|
|
1141
|
+
#### Creating a Space
|
|
1142
|
+
|
|
1143
|
+
```python
|
|
1144
|
+
from sagemaker.hyperpod.space.hyperpod_space import HPSpace
|
|
1145
|
+
from hyperpod_space_template.v1_0.model import SpaceConfig
|
|
1146
|
+
|
|
1147
|
+
# Create space configuration
|
|
1148
|
+
space_config = SpaceConfig(
|
|
1149
|
+
name="myspace",
|
|
1150
|
+
namespace="default",
|
|
1151
|
+
display_name="My Space",
|
|
1152
|
+
)
|
|
1153
|
+
|
|
1154
|
+
# Create and start the space
|
|
1155
|
+
space = HPSpace(config=space_config)
|
|
1156
|
+
space.create()
|
|
1157
|
+
```
|
|
1158
|
+
|
|
1159
|
+
#### List Spaces
|
|
1160
|
+
|
|
1161
|
+
```python
|
|
1162
|
+
from sagemaker.hyperpod.space.hyperpod_space import HPSpace
|
|
1163
|
+
|
|
1164
|
+
# List all spaces in default namespace
|
|
1165
|
+
spaces = HPSpace.list()
|
|
1166
|
+
for space in spaces:
|
|
1167
|
+
print(f"Space: {space.config.name}, Status: {space.status}")
|
|
1168
|
+
|
|
1169
|
+
# List spaces in specific namespace
|
|
1170
|
+
spaces = HPSpace.list(namespace="your-namespace")
|
|
1171
|
+
```
|
|
1172
|
+
|
|
1173
|
+
#### Get a Space
|
|
1174
|
+
|
|
1175
|
+
```python
|
|
1176
|
+
from sagemaker.hyperpod.space.hyperpod_space import HPSpace
|
|
1177
|
+
|
|
1178
|
+
# Get specific space
|
|
1179
|
+
space = HPSpace.get(name="myspace", namespace="default")
|
|
1180
|
+
print(f"Space name: {space.config.name}")
|
|
1181
|
+
print(f"Display name: {space.config.display_name}")
|
|
1182
|
+
```
|
|
1183
|
+
|
|
1184
|
+
#### Update a Space
|
|
1185
|
+
|
|
1186
|
+
```python
|
|
1187
|
+
from sagemaker.hyperpod.space.hyperpod_space import HPSpace
|
|
1188
|
+
|
|
1189
|
+
# Get existing space
|
|
1190
|
+
space = HPSpace.get(name="myspace")
|
|
1191
|
+
|
|
1192
|
+
# Update space configuration
|
|
1193
|
+
space.update(
|
|
1194
|
+
display_name="Updated Space Name",
|
|
1195
|
+
)
|
|
1196
|
+
```
|
|
1197
|
+
|
|
1198
|
+
#### Start/Stop a Space
|
|
1199
|
+
|
|
1200
|
+
```python
|
|
1201
|
+
from sagemaker.hyperpod.space.hyperpod_space import HPSpace
|
|
1202
|
+
|
|
1203
|
+
# Get existing space
|
|
1204
|
+
space = HPSpace.get(name="myspace")
|
|
1205
|
+
|
|
1206
|
+
# Start the space
|
|
1207
|
+
space.start()
|
|
1208
|
+
|
|
1209
|
+
# Stop the space
|
|
1210
|
+
space.stop()
|
|
1211
|
+
```
|
|
1212
|
+
|
|
1213
|
+
#### Get Space Logs
|
|
1214
|
+
|
|
1215
|
+
```python
|
|
1216
|
+
from sagemaker.hyperpod.space.hyperpod_space import HPSpace
|
|
1217
|
+
|
|
1218
|
+
# Get space and retrieve logs
|
|
1219
|
+
space = HPSpace.get(name="myspace")
|
|
1220
|
+
|
|
1221
|
+
# Get logs from default pod and container
|
|
1222
|
+
logs = space.get_logs()
|
|
1223
|
+
print(logs)
|
|
1224
|
+
```
|
|
1225
|
+
|
|
1226
|
+
#### List Space Pods
|
|
1227
|
+
|
|
1228
|
+
```python
|
|
1229
|
+
from sagemaker.hyperpod.space.hyperpod_space import HPSpace
|
|
1230
|
+
|
|
1231
|
+
# Get space and list associated pods
|
|
1232
|
+
space = HPSpace.get(name="myspace")
|
|
1233
|
+
pods = space.list_pods()
|
|
1234
|
+
for pod in pods:
|
|
1235
|
+
print(f"Pod: {pod}")
|
|
1236
|
+
```
|
|
1237
|
+
|
|
1238
|
+
#### Create Space Access
|
|
1239
|
+
|
|
1240
|
+
```python
|
|
1241
|
+
from sagemaker.hyperpod.space.hyperpod_space import HPSpace
|
|
1242
|
+
|
|
1243
|
+
# Get existing space
|
|
1244
|
+
space = HPSpace.get(name="myspace")
|
|
1245
|
+
|
|
1246
|
+
# Create VS Code remote access
|
|
1247
|
+
vscode_access = space.create_space_access(connection_type="vscode-remote")
|
|
1248
|
+
print(f"VS Code URL: {vscode_access['SpaceConnectionUrl']}")
|
|
1249
|
+
|
|
1250
|
+
# Create web UI access
|
|
1251
|
+
web_access = space.create_space_access(connection_type="web-ui")
|
|
1252
|
+
print(f"Web UI URL: {web_access['SpaceConnectionUrl']}")
|
|
1253
|
+
```
|
|
1254
|
+
|
|
1255
|
+
#### Delete a Space
|
|
1256
|
+
|
|
1257
|
+
```python
|
|
1258
|
+
from sagemaker.hyperpod.space.hyperpod_space import HPSpace
|
|
1259
|
+
|
|
1260
|
+
# Get existing space
|
|
1261
|
+
space = HPSpace.get(name="myspace")
|
|
1262
|
+
|
|
1263
|
+
# Delete the space
|
|
1264
|
+
space.delete()
|
|
1265
|
+
```
|
|
1266
|
+
|
|
1267
|
+
#### Space Template Management
|
|
1268
|
+
|
|
1269
|
+
```python
|
|
1270
|
+
from sagemaker.hyperpod.space.hyperpod_space_template import HPSpaceTemplate
|
|
1271
|
+
|
|
1272
|
+
# Create space template from YAML file
|
|
1273
|
+
template = HPSpaceTemplate(file_path="template.yaml")
|
|
1274
|
+
template.create()
|
|
1275
|
+
|
|
1276
|
+
# List all space templates
|
|
1277
|
+
templates = HPSpaceTemplate.list()
|
|
1278
|
+
for template in templates:
|
|
1279
|
+
print(f"Template: {template.name}")
|
|
1280
|
+
|
|
1281
|
+
# Get specific space template
|
|
1282
|
+
template = HPSpaceTemplate.get(name="my-template")
|
|
1283
|
+
print(template.to_yaml())
|
|
1284
|
+
|
|
1285
|
+
# Update space template
|
|
1286
|
+
template.update(file_path="updated-template.yaml")
|
|
1287
|
+
|
|
1288
|
+
# Delete space template
|
|
1289
|
+
template.delete()
|
|
1290
|
+
```
|
|
1291
|
+
|
|
996
1292
|
## Examples
|
|
997
1293
|
#### Cluster Management Example Notebooks
|
|
998
1294
|
|