### Verify CLI installation Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/installation.md Checks that the installation was successful by displaying the help menu. ```bash # Verify CLI installation hyp --help ``` -------------------------------- ### Install dependencies and create training dataset Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/01-training-job-submission/00-pytorch-training-job.md Install the required packages and run the script to download and pre-process the dataset locally. ```bash pip install -r ./scripts/requirements.txt python ./scripts/create-training-dataset.py ``` -------------------------------- ### Describe space example Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/cli/space/cli_space.md Example showing how to describe a specific space resource with YAML output. ```bash hyp describe hyp-space --name my-space --namespace default --output yaml ``` -------------------------------- ### List spaces examples Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/cli/space/cli_space.md Examples showing how to list spaces in the default namespace, a specific namespace, across all namespaces, or with JSON output. ```bash # List spaces in default namespace hyp list hyp-space # List spaces in specific namespace hyp list hyp-space --namespace my-namespace # List spaces across all namespaces hyp list hyp-space --all-namespaces # List spaces with JSON output hyp list hyp-space --output json ``` -------------------------------- ### Install Helm Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/helm_chart/readme.md Commands to set up the Helm environment by modifying permissions for the installation script and executing it. ```bash chmod 700 get_helm.sh ./get_helm.sh ``` -------------------------------- ### Simulate Helm Installation Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/helm_chart/readme.md Perform a dry-run of the installation to preview the resources and configuration that would be applied. ```bash helm install dependencies helm_chart/HyperPodHelmChart --namespace kube-system --dry-run ``` -------------------------------- ### Install hyperpod-custom-inference-template Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/hyperpod-custom-inference-template/README.md Install the package using pip. ```bash pip install hyperpod-custom-inference-template ``` -------------------------------- ### Create Space Example Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/cli/space/cli_space.md An example command to create a space named 'my-space' in the 'default' namespace with version 1.0. ```bash hyp create hyp-space --version 1.0 --name my-space --namespace default ``` -------------------------------- ### Start a space resource Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/cli/space/cli_space.md Starts a space resource by its name and namespace. ```bash hyp start hyp-space --name my-space --namespace default ``` -------------------------------- ### Verify CLI Installation Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/00-getting-started/00-setup.md Display help information to verify the CLI is installed and accessible via the hyp command. ```bash hyp --help ``` -------------------------------- ### Install and Run Tox Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/CONTRIBUTING.md Commands to install the tox testing tool and execute the full suite of unit tests and code checks. ```bash pip install tox ``` ```bash tox ``` -------------------------------- ### Example cluster configuration parameters Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/cluster_management.rst Key parameters found in the generated config.yaml file. ```yaml template: cluster-stack namespace: kube-system stage: gamma resource_name_prefix: sagemaker-hyperpod-eks ``` -------------------------------- ### hyp start hyp-space Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/cli/space/cli_space.md Starts a specified space resource. ```APIDOC ## hyp start hyp-space ### Description Start a space resource. ### Syntax `hyp start hyp-space [OPTIONS]` ### Parameters - **--name** (TEXT) - Required - Name of the space to start - **--namespace, -n** (TEXT) - Optional - Kubernetes namespace (default: "default") ### Example `hyp start hyp-space --name my-space --namespace default` ``` -------------------------------- ### Install SageMaker HyperPod CLI via pip Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/installation.md Installs the CLI and SDK directly from the Python Package Index. ```bash # Install from PyPI pip install sagemaker-hyperpod ``` -------------------------------- ### Create a new directory for cluster configuration Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/cluster_management.rst Recommended practice to start with a clean directory for each cluster configuration. ```bash mkdir my-hyperpod-cluster cd my-hyperpod-cluster ``` -------------------------------- ### Create a Basic Cluster Stack Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/cli/cluster_management/cli_cluster_management.md Initializes a new cluster directory, configures parameters, validates the setup, and deploys the stack to a specified region. ```bash # Start with a clean directory mkdir my-hyperpod-cluster cd my-hyperpod-cluster # Initialize cluster configuration hyp init cluster-stack # Configure basic parameters hyp configure --resource-name-prefix my-cluster --stage prod # Validate configuration hyp validate # Create cluster stack hyp create --region us-west-2 ``` -------------------------------- ### Install team-role-and-bindings sub-chart Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/helm_chart/readme.md Install the sub-chart containing only roles and role bindings, requiring the computeQuotaTarget.targetId to be set. ```bash helm install dependencies helm_chart/HyperPodHelmChart/charts/team-role-and-bindings --set computeQuotaTarget.targetId= ``` -------------------------------- ### Create hyp-space-access Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/cli/space/cli_space.md Examples of creating a space access resource with specific connection types. ```bash hyp create hyp-space-access --name my-space --namespace default --connection-type vscode-remote hyp create hyp-space-access --name my-space --connection-type kiro-remote ``` -------------------------------- ### Install HyperPodHelmChart with computeQuotaTarget Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/helm_chart/readme.md Install the HyperPodHelmChart while setting the computeQuotaTarget.targetId, which must match the targetId of the quota allocation. ```bash helm install dependencies helm_chart/HyperPodHelmChart --namespace kube-system --set computeQuotaTarget.targetId= ``` -------------------------------- ### Create a PyTorch Training Job Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/README.md Example command to create a PyTorch training job with various configurations including instance type, environment variables, and volume mounts. ```bash hyp create hyp-pytorch-job \ --version 1.1 \ --job-name test-pytorch-job \ --image pytorch/pytorch:latest \ --command '[python, train.py]' \ --args '[--epochs=10, --batch-size=32]' \ --environment '{"PYTORCH_CUDA_ALLOC_CONF": "max_split_size_mb:32"}' \ --pull-policy "IfNotPresent" \ --instance-type ml.p4d.24xlarge \ --tasks-per-node 8 \ --label-selector '{"accelerator": "nvidia", "network": "efa"}' \ --deep-health-check-passed-nodes-only true \ --scheduler-type "kueue" \ --queue-name "training-queue" \ --priority "high" \ --max-retry 3 \ --accelerator-partition-type "mig-1g.5gb" \ --accelerator-partition-count 2 \ --accelerator-partition-limit 4 \ --vcpu 96.0 \ --memory 1152.0 \ --vcpu-limit 96.0 \ --memory-limit 1152.0 \ --preferred-topology "topology.kubernetes.io/zone=us-west-2a" \ --volume name=model-data,type=hostPath,mount_path=/data,path=/data \ --volume name=training-output,type=pvc,mount_path=/data2,claim_name=my-pvc,read_only=false ``` -------------------------------- ### HostPath Volume Configuration Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/cli/training/cli_training.md Example of mounting a hostPath volume to a container. ```bash --volume name=model-data,type=hostPath,mount_path=/data,path=/host/data ``` -------------------------------- ### Start and Stop a HyperPod Space Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/space.md Manage the lifecycle of a space by starting or stopping it. ```bash # Start a space hyp start hyp-space --name myspace # Stop a space hyp stop hyp-space --name myspace ``` ```python from sagemaker.hyperpod.space.hyperpod_space import HPSpace # Get existing space space = HPSpace.get(name="myspace") # Start the space space.start() # Stop the space space.stop() ``` -------------------------------- ### Create a clean directory for endpoint configuration Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/inference.md Start with a new and clean directory for each endpoint configuration. ```bash mkdir my-endpoint cd my-endpoint ``` -------------------------------- ### HPSpace.start() / HPSpace.stop() Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/README.md Starts or stops an existing space. ```APIDOC ## HPSpace.start() / HPSpace.stop() ### Description Controls the lifecycle state of the space. ``` -------------------------------- ### Prepare model environment variables and sync to S3 Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/02-inference-deployment/01-custom-model-endpoint.md Set the required environment variables, install the Hugging Face hub CLI, download the TinyLlama model, and sync the local checkpoint directory to the specified S3 bucket. ```bash S3_MODEL_BUCKET_NAME="PLEASE_FILL_IN" S3_MODEL_REGION="PLEASE_FILL_IN" S3_CERT_URI="s3://PLEASE_FILL_IN" INSTANCE_TYPE=ml.g5.12xlarge MODEL_NAME="tinyllama" HF_MODEL_ID="TinyLlama/TinyLlama-1.1B-Chat-v1.0" CHECKPOINT_DIR="tinyllama-1.1b-chat" S3_MODEL_URI="s3://$S3_MODEL_BUCKET_NAME/$CHECKPOINT_DIR" ENDPOINT_NAME="test-custom-endpoint" pip install huggingface-hub hf download $HF_MODEL_ID --local-dir $CHECKPOINT_DIR aws s3 sync $CHECKPOINT_DIR $S3_MODEL_URI ``` -------------------------------- ### Get Command Help Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started.md Use the --help flag to view detailed information on specific commands. ```bash hyp --help ``` -------------------------------- ### hyp configure Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/cli/cluster_management/cli_cluster_management.md Configures cluster parameters for pre-deployment setup. ```APIDOC ## hyp configure ### Description Configure cluster parameters interactively or via command line. This command modifies local config.yaml files before cluster creation. ### Syntax hyp configure [OPTIONS] ### Parameters - --resource-name-prefix (TEXT) - Optional - Prefix for all AWS resources - --create-hyperpod-cluster-stack (BOOLEAN) - Optional - Create HyperPod Cluster Stack - --hyperpod-cluster-name (TEXT) - Optional - Name of SageMaker HyperPod Cluster - --create-eks-cluster-stack (BOOLEAN) - Optional - Create EKS Cluster Stack - --kubernetes-version (TEXT) - Optional - Kubernetes version - --eks-cluster-name (TEXT) - Optional - Name of the EKS cluster - --create-helm-chart-stack (BOOLEAN) - Optional - Create Helm Chart Stack - --namespace (TEXT) - Optional - Namespace to deploy HyperPod Helm chart - --node-provisioning-mode (TEXT) - Optional - Continuous provisioning mode - --node-recovery (TEXT) - Optional - Node recovery setting ("Automatic" or "None") - --create-vpc-stack (BOOLEAN) - Optional - Create VPC Stack - --vpc-id (TEXT) - Optional - Existing VPC ID - --vpc-cidr (TEXT) - Optional - VPC CIDR block - --create-security-group-stack (BOOLEAN) - Optional - Create Security Group Stack - --enable-hp-inference-feature (BOOLEAN) - Optional - Enable inference operator - --stage (TEXT) - Optional - Deployment stage ("gamma" or "prod") - --create-fsx-stack (BOOLEAN) - Optional - Create FSx Stack - --storage-capacity (INTEGER) - Optional - FSx storage capacity in GiB - --tags (JSON) - Optional - Resource tags as JSON object ``` -------------------------------- ### Verify installation with kubectl Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/helm_chart/HyperPodHelmChart/charts/hyperpod-ray-endpoint-operator/templates/NOTES.txt Commands to check the status of pods and custom resource definitions in the configured namespace. ```bash kubectl get pods -n {{ .Values.namespace }} kubectl get customresourcedefinitions ``` -------------------------------- ### View available configuration options Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/cli/cluster_management/cli_cluster_management.md Run this command to list all available parameters for your specific configuration template. ```bash hyp configure --help ``` -------------------------------- ### Initialize JumpStart model configuration Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/02-inference-deployment/00-jumpstart-endpoint.md Creates a new directory and initializes the necessary configuration files for a JumpStart model deployment. ```bash mkdir jumpstart-model-config && cd jumpstart-model-config hyp init hyp-jumpstart-endpoint ``` -------------------------------- ### Start and Stop a Space Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/README.md Commands to start or stop a running space. ```bash hyp start hyp-space --name myspace hyp stop hyp-space --name myspace ``` -------------------------------- ### Describe an Endpoint Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/inference.md Get detailed information about a specific JumpStart or custom endpoint by name. ```bash # Describe JumpStart endpoint hyp describe hyp-jumpstart-endpoint --name # Describe custom endpoint hyp describe hyp-custom-endpoint --name ``` ```python from sagemaker.hyperpod.inference.hp_jumpstart_endpoint import HPJumpStartEndpoint from sagemaker.hyperpod.inference.hp_endpoint import HPEndpoint # Get JumpStart endpoint details jumpstart_endpoint = HPJumpStartEndpoint.get(name="js-endpoint-name", namespace="test") print(jumpstart_endpoint) # Get custom endpoint details custom_endpoint = HPEndpoint.get(name="endpoint-custom") print(custom_endpoint) ``` -------------------------------- ### Create JumpStart Endpoint Syntax Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/cli/inference/cli_inference.md Syntax for deploying a pre-trained model from SageMaker JumpStart. ```bash hyp create hyp-jumpstart-endpoint [OPTIONS] ``` -------------------------------- ### HPSpace.create() Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/README.md Creates and starts a new HyperPod space using a provided SpaceConfig object. ```APIDOC ## HPSpace.create() ### Description Initializes and starts a new space based on the configuration provided during instantiation. ### Parameters - **config** (SpaceConfig) - Required - Configuration object containing name, namespace, and display_name. ``` -------------------------------- ### Example pod output Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/01-training-job-submission/00-pytorch-training-job.md This is the expected output format when listing pods with the -o wide flag. ```text NAME READY STATUS RESTARTS AGE IP NODE qwen3-4b-thinking-2507-fsdp-pod-0 1/1 Running 0 3m53s 10.4.224.228 hyperpod-i-00b865d0114cabc20 qwen3-4b-thinking-2507-fsdp-pod-1 1/1 Running 0 3m53s 10.4.142.65 hyperpod-i-0974a98e3fc0da67b ``` -------------------------------- ### Initialize a new endpoint configuration Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/inference.md Initialize the endpoint configuration using the jumpstart template. ```bash hyp init hyp-jumpstart-endpoint ``` -------------------------------- ### Example Cluster List Output Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/00-getting-started/00-setup.md Sample JSON output showing cluster details including instance types and node health status. ```json [ { "Cluster": "hp-eks-test-cluster", "Instances": [ { "InstanceType": "ml.t3.xlarge", "TotalNodes": 2, "AcceleratorDevicesAvailable": "N/A", "NodeHealthStatus=Schedulable": 2, "DeepHealthCheckStatus=Passed": "N/A" }, { "InstanceType": "ml.g5.12xlarge", "TotalNodes": 2, "AcceleratorDevicesAvailable": 8, "NodeHealthStatus=Schedulable": 2, "DeepHealthCheckStatus=Passed": "N/A" } ] }, ] ``` -------------------------------- ### Initialize jumpstart endpoint configuration Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/inference/CLI/inference-jumpstart-init-experience.ipynb Creates a new configuration template in the current directory, including a default config.yaml, k8s.jinja, and README.md. ```python # Initialize a new jumpstart endpoint configuration in the current directory !hyp init hyp-jumpstart-endpoint ``` -------------------------------- ### Initialize a new job configuration Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/training.md Initializes the project structure, creating config.yaml, k8s.jinja, and README.md files. ```bash hyp init hyp-pytorch-job ``` -------------------------------- ### Check JumpStart endpoint creation options Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/02-inference-deployment/00-jumpstart-endpoint.md Displays the available command options for the hyp create hyp-jumpstart-endpoint command. ```bash hyp create hyp-jumpstart-endpoint --help ``` -------------------------------- ### Persistent Volume Claim (PVC) Configuration Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/cli/training/cli_training.md Example of mounting a Persistent Volume Claim (PVC) to a container. ```bash --volume name=training-output,type=pvc,mount_path=/output,claim_name=training-pvc,read_only=false ``` -------------------------------- ### View job status output Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/03-task-governance/00-task-governance.md Example output showing the suspended and running states of jobs after preemption occurs. ```text NAME NAMESPACE STATUS AGE -------------------------------------------------------------------------------- team-a-qwen3-training-prio hyperpod-ns-team-a Suspended N/A NAME NAMESPACE STATUS AGE -------------------------------------------------------------------------------- team-b-qwen3-exp-prio hyperpod-ns-team-b Running 2m team-b-qwen3-training-prio hyperpod-ns-team-b Suspended N/A ``` -------------------------------- ### Create the JumpStart endpoint Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/02-inference-deployment/00-jumpstart-endpoint.md Deploys the JumpStart endpoint using a properly sized and available instance type (ml.g5.12xlarge). ```bash hyp create hyp-jumpstart-endpoint \ --model-id $MODEL_ID \ --instance-type ml.g5.12xlarge \ --endpoint-name $ENDPOINT_NAME \ --tls-certificate-output-s3-uri $S3_CERT_URI \ --namespace default ``` -------------------------------- ### Create a space using the HyperPod SDK Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/space.md Define a SpaceConfig object and use the HPSpace class to create and start the workspace. ```python from sagemaker.hyperpod.space.hyperpod_space import HPSpace from hyperpod_space_template.v1_1.model import SpaceConfig # Create space configuration space_config = SpaceConfig( name="myspace", display_name="My Space", ) # Create and start the space space = HPSpace(config=space_config) space.create() ``` -------------------------------- ### Describe a Training Job via CLI Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/training.md Use the hyp describe command with the --job-name flag to get details about a specific job. ```bash hyp describe hyp-pytorch-job --job-name ``` -------------------------------- ### Import Configuration Classes Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/inference/SDK/inference-jumpstart-e2e.ipynb Import the required configuration classes and utilities for defining a JumpStart endpoint. ```python from sagemaker.hyperpod.inference.config.hp_jumpstart_endpoint_config import Model, Server,SageMakerEndpoint, TlsConfig, EnvironmentVariables from sagemaker.hyperpod.inference.hp_jumpstart_endpoint import HPJumpStartEndpoint from sagemaker.hyperpod.common.config.metadata import Metadata import yaml import time ``` -------------------------------- ### Upgrade HyperPodHelmChart installation Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/helm_chart/readme.md Upgrade the existing Helm chart installation to consume the latest releases of service components like the Health Monitoring Agent. ```bash helm upgrade dependencies helm_chart/HyperPodHelmChart --namespace kube-system ``` -------------------------------- ### Verify Initialized Files Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/01-training-job-submission/02-recipe-job-cli.ipynb List the files in the job directory to confirm that 'config.yaml', '.override_spec.json', and 'k8s.jinja' were created. ```python # Verify files were created !ls -la {JOB_DIR} ``` -------------------------------- ### Get monitoring configurations Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/cli/cluster_management/cli_cluster_management.md Retrieves monitoring configurations for the HyperPod cluster. Use --grafana or --prometheus to get specific URLs, or --list to view available metrics. ```bash hyp get-monitoring [OPTIONS] ``` -------------------------------- ### Configure JumpStart model parameters Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/02-inference-deployment/00-jumpstart-endpoint.md Sets specific configuration parameters for the JumpStart model deployment using the CLI. ```bash hyp configure --endpoint-name $ENDPOINT_NAME hyp configure --model-id $MODEL_ID hyp configure --tls-certificate-output-s3-uri $S3_CERT_URI hyp configure --instance-type ml.g5.12xlarge ``` -------------------------------- ### Get Logs Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/README.md Retrieves logs for a specific pod. ```python from sagemaker.hyperpod.inference.hp_jumpstart_endpoint import HPJumpStartEndpoint from sagemaker.hyperpod.inference.hp_endpoint import HPEndpoint # Get logs from pod js_logs = HPJumpStartEndpoint.get_logs(pod=) print(js_logs) c_logs = HPEndpoint.get_logs(pod=) print(c_logs) ``` -------------------------------- ### View HPA status output Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/02-inference-deployment/01-custom-model-endpoint.md Example output showing the transition of replicas as the target metric increases. ```text NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS keda-hpa-test-custom-endpoint-init-scale-scaled-object Deployment/test-custom-endpoint-init-scale 10/2 (avg) 1 4 1 NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS keda-hpa-test-custom-endpoint-init-scale-scaled-object Deployment/test-custom-endpoint-init-scale 2/2 (avg) 1 4 4 ``` -------------------------------- ### hyp start/stop hyp-space Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/README.md Starts or stops a specified space. ```APIDOC ## hyp start/stop hyp-space ### Description Changes the operational state of a space. ### Parameters - **--name** (TEXT) - Required: The name of the space ``` -------------------------------- ### HPJumpStartEndpoint.create() Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/README.md Creates and deploys a Jumpstart model endpoint. ```APIDOC ## HPJumpStartEndpoint.create() ### Description Deploys a Jumpstart model to a SageMaker endpoint using the provided model, server, and endpoint configuration. ``` -------------------------------- ### Start/Stop a Space Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/space.md Starts or stops a specified HyperPod space. ```APIDOC ## Start/Stop a Space ### CLI `hyp start hyp-space --name ` `hyp stop hyp-space --name ` ### SDK `space.start()` `space.stop()` ``` -------------------------------- ### Initialize custom model deployment configuration Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/02-inference-deployment/01-custom-model-endpoint.md Creates a new directory and initializes the required configuration files for a custom model deployment. ```bash mkdir custom-model-config && cd custom-model-config hyp init hyp-custom-endpoint ``` -------------------------------- ### Initialize HyperPod SDK Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/inference/SDK/inference-jumpstart-e2e.ipynb Import the necessary modules to interact with HyperPod clusters. ```python from sagemaker.hyperpod import list_clusters, set_cluster_context ``` -------------------------------- ### Get Space Logs Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/README.md Retrieves logs for a specific space. ```bash hyp get-logs hyp-space --name myspace ``` -------------------------------- ### Get specific endpoint Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/inference/SDK/inference-fsx-model-e2e.ipynb Retrieve an endpoint instance by its name. ```python endpoint = HPEndpoint.get(name='') ``` -------------------------------- ### View Configuration Files Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/01-training-job-submission/00-pytorch-training-job.md Lists the configuration files generated for the training job. ```text ./k8s.jinja ./config.yaml ``` -------------------------------- ### Create and activate a virtual environment Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/installation.md Recommended step to isolate the SageMaker HyperPod CLI and SDK from other system packages. ```bash # Create a virtual environment python -m venv {venv-name} # Activate the virtual environment source {venv-name}/bin/activate ``` -------------------------------- ### Get Operator Logs Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/inference.md Retrieve operator logs for an endpoint. ```APIDOC ## Get Operator Logs ### CLI `hyp get-operator-logs hyp-jumpstart-endpoint --since-hours ` `hyp get-operator-logs hyp-custom-endpoint --since-hours ` ### SDK `HPJumpStartEndpoint.get_operator_logs(since_hours=)` `HPEndpoint.get_operator_logs(since_hours=)` ``` -------------------------------- ### Get Logs from a Space Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/space.md Retrieves logs from a HyperPod space. ```APIDOC ## Get Logs from a Space ### CLI `hyp get-logs hyp-space --name ` ### SDK `space.get_logs()` ``` -------------------------------- ### Get Monitoring Configuration Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/README.md Retrieves the current monitoring configuration for observability. ```python from sagemaker.hyperpod.observability.utils import get_monitoring_config monitor_config = get_monitoring_config() ``` -------------------------------- ### Get cluster context Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/training/CLI/training-e2e-cli.ipynb Verify the currently active cluster context. ```python #verify the cluster context !hyp get-cluster-context ``` -------------------------------- ### Import Observability Utilities Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/observability/observability.ipynb Import the necessary utility functions to check observability status and retrieve monitoring configurations. ```python from sagemaker.hyperpod.utils import get_monitoring_config, is_observability_addon_enabled ``` -------------------------------- ### Configure Jumpstart Endpoint Parameters Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/README.md Configures Jumpstart endpoint parameters via the command line. ```bash hyp configure --endpoint-name my-jumpstart-endpoint ``` -------------------------------- ### Get Logs Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/inference.md Retrieve logs for a specific pod within an endpoint. ```APIDOC ## Get Logs ### CLI `hyp get-logs hyp-jumpstart-endpoint --pod-name ` `hyp get-logs hyp-custom-endpoint --pod-name ` ### SDK `HPJumpStartEndpoint.get_logs(pod=)` `HPEndpoint.get_logs(pod=)` ``` -------------------------------- ### Describe an Endpoint Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/inference.md Get detailed information about a specific inference endpoint. ```APIDOC ## Describe an Endpoint ### CLI `hyp describe hyp-jumpstart-endpoint --name ` `hyp describe hyp-custom-endpoint --name ` ### SDK `HPJumpStartEndpoint.get(name=, namespace=)` `HPEndpoint.get(name=)` ``` -------------------------------- ### Upload training script and configuration to S3 Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/01-training-job-submission/00-pytorch-training-job.md Sync the local training scripts directory to the S3 bucket. ```bash aws s3 sync ./training_scripts/ $S3_PATH/scripts/ ``` -------------------------------- ### Deploy JumpStart Endpoint Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/inference/SDK/inference-jumpstart-e2e.ipynb Initiate the deployment process using the defined endpoint specification. ```python # use spec to deploy js_endpoint.create() ``` -------------------------------- ### Start and Stop a HyperPod Space Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/README.md Controls the runtime state of an existing space. ```python from sagemaker.hyperpod.space.hyperpod_space import HPSpace # Get existing space space = HPSpace.get(name="myspace") # Start the space space.start() # Stop the space space.stop() ``` -------------------------------- ### Help for create hyp-pytorch-job Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/training/CLI/training-e2e-cli.ipynb Display the help menu for the create hyp-pytorch-job command to verify arguments. ```python # To verify the opinionated list of arguments !hyp create hyp-pytorch-job --help ``` -------------------------------- ### Get Space Logs Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/README.md Retrieves logs from the default pod and container of a space. ```python from sagemaker.hyperpod.space.hyperpod_space import HPSpace # Get space and retrieve logs space = HPSpace.get(name="myspace") # Get logs from default pod and container logs = space.get_logs() print(logs) ``` -------------------------------- ### Get a HyperPod Space Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/README.md Retrieves details for a specific space by name and namespace. ```python from sagemaker.hyperpod.space.hyperpod_space import HPSpace # Get specific space space = HPSpace.get(name="myspace", namespace="default") print(f"Space name: {space.config.name}") print(f"Display name: {space.config.display_name}") ``` -------------------------------- ### Get operator logs Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/inference/SDK/inference-s3-model-e2e.ipynb Retrieve logs for the operator for a specified time window. ```python # get operator logs print(s3_endpoint.get_operator_logs(since_hours=0.1)) ``` -------------------------------- ### Monitor Endpoint Creation Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/inference/CLI/inference-jumpstart-init-experience.ipynb Uses a loop to periodically check the status of the jumpstart endpoint deployment using the describe command. ```python # Check jumpstart endpoint creation status import time print("Monitoring jumpstart endpoint progress...") for i in range(5): print(f"\n--- Status Check {i+1} ---") !hyp describe hyp-jumpstart-endpoint --name my-jumpstart-endpoint time.sleep(30) # Wait 30 seconds between checks ``` -------------------------------- ### Get Pod Logs Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/inference.md Retrieve logs for a specific pod within an endpoint. ```bash # JumpStart endpoint hyp get-logs hyp-jumpstart-endpoint --pod-name # Custom endpoint hyp get-logs hyp-custom-endpoint --pod-name ``` ```python from sagemaker.hyperpod.inference.hp_jumpstart_endpoint import HPJumpStartEndpoint from sagemaker.hyperpod.inference.hp_endpoint import HPEndpoint # Get logs from pod js_logs = HPJumpStartEndpoint.get_logs(pod=) print(js_logs) c_logs = HPEndpoint.get_logs(pod=) print(c_logs) ``` -------------------------------- ### Initialize Template Scaffold with hyp init Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/cli/training/cli_training.md Initializes a template scaffold in the current directory or a specified target directory. ```bash hyp init TEMPLATE [DIRECTORY] [OPTIONS] ``` -------------------------------- ### hyp init Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/README.md Initializes a new recipe job or jumpstart endpoint configuration. ```APIDOC ## hyp init ### Description Initializes a new configuration for a recipe job or a jumpstart endpoint in the current directory. ``` -------------------------------- ### Create JumpStart Model Endpoint via CLI Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/inference.md Use the hyp create hyp-jumpstart-endpoint command to deploy a JumpStart model. ```bash hyp create hyp-jumpstart-endpoint \ --model-id jumpstart-model-id \ --instance-type ml.g5.8xlarge \ --endpoint-name endpoint-jumpstart ``` -------------------------------- ### Create Jumpstart Endpoint Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/inference/CLI/inference-jumpstart-init-experience.ipynb Deploys the HyperPod jumpstart endpoint using the configuration defined in config.yaml. Note that creation typically takes 10-15 minutes. ```python # Create the jumpstart endpoint !hyp create ``` -------------------------------- ### Get Operator Logs Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/README.md Retrieves operator logs for endpoints, optionally filtered by time. ```python from sagemaker.hyperpod.inference.hp_jumpstart_endpoint import HPJumpStartEndpoint from sagemaker.hyperpod.inference.hp_endpoint import HPEndpoint # Invoke JumpStart endpoint print(HPJumpStartEndpoint.get_operator_logs(since_hours=0.1)) # Invoke custom endpoint print(HPEndpoint.get_operator_logs(since_hours=0.1)) ``` -------------------------------- ### Get Training Operator Logs Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/README.md Retrieves logs from the training operator for a specific job. ```python from sagemaker.hyperpod.training import HyperPodPytorchJob # Get training operator logs job = HyperPodPytorchJob.get(name="my-pytorch-job") print(job.get_operator_logs(since_hours=0.1)) ``` -------------------------------- ### Get Operator Logs for Recipe Job Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/README.md Retrieves operator logs for the recipe job. ```bash hyp get-operator-logs hyp-recipe-job ``` -------------------------------- ### Initialize Recipe Job via CLI Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/01-training-job-submission/02-recipe-job-cli.ipynb Use the 'hyp init' command to initialize a job directory with either a JumpStart model ID or a HuggingFace model ID. ```bash # Option A: JumpStart model ID hyp init hyp-recipe-job --model-id huggingface-reasoning-qwen3-06b --technique SFT --instance-type ml.g5.48xlarge # Option B: HuggingFace model ID (resolved automatically via JumpStart Hub search) hyp init hyp-recipe-job --huggingface-model-id Qwen/Qwen3-0.6B --technique SFT --instance-type ml.g5.48xlarge ``` -------------------------------- ### List Endpoints Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/inference/SDK/inference-jumpstart-e2e.ipynb List all JumpStart endpoints and display the first one as YAML. ```python # output is similar to kubectl get jumpstartmodels endpoint_list = HPJumpStartEndpoint.list() print_yaml(endpoint_list[0]) ``` -------------------------------- ### Get pod logs Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/training/CLI/training-e2e-cli.ipynb Retrieve logs for a specific pod within a PyTorch job. ```python !hyp get-logs hyp-pytorch-job --pod-name test-pytorch-job-cli-pod-0 --job-name test-pytorch-job-cli ``` -------------------------------- ### Get Endpoint Details Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/inference/SDK/inference-jumpstart-e2e.ipynb Retrieve details for a specific endpoint by name and display as YAML. ```python # output is similar to kubectl describe jumpstartmodel endpoint = HPJumpStartEndpoint.get(name='') print_yaml(endpoint) ``` -------------------------------- ### Get Job Logs Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/01-training-job-submission/00-pytorch-training-job.md Retrieve logs for a specific pod within a training job. ```bash hyp get-logs hyp-pytorch-job --job-name $JOB_NAME --pod-name $JOB_NAME-pod-0 ``` -------------------------------- ### Initialize a new cluster configuration Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/cluster_management.rst Initializes the cluster stack, creating config.yaml, cfn_params.jinja, and README.md files. ```bash hyp init cluster-stack ``` -------------------------------- ### Get Logs from a Pod Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/training.md Retrieve logs for a specific pod within a training job. ```APIDOC ## Get Logs from a Pod ### CLI `hyp get-logs hyp-pytorch-job --pod-name --job-name ` ### SDK `job.get_logs_from_pod("")` ``` -------------------------------- ### Initialize Recipe Job with JumpStart model ID Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/training.md Initializes a new recipe job directory using a JumpStart model ID, technique, and instance type. ```bash mkdir my-recipe-job cd my-recipe-job hyp init hyp-recipe-job . \ --model-id huggingface-reasoning-qwen3-06b \ --technique SFT \ --instance-type ml.g5.48xlarge ``` -------------------------------- ### Get Operator Logs Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/inference.md Retrieve operator logs for an endpoint, optionally filtered by time. ```bash # JumpStart endpoint hyp get-operator-logs hyp-jumpstart-endpoint --since-hours 0.5 # Custom endpoint hyp get-operator-logs hyp-custom-endpoint --since-hours 0.5 ``` ```python from sagemaker.hyperpod.inference.hp_jumpstart_endpoint import HPJumpStartEndpoint from sagemaker.hyperpod.inference.hp_endpoint import HPEndpoint # Invoke JumpStart endpoint print(HPJumpStartEndpoint.get_operator_logs(since_hours=0.1)) # Invoke custom endpoint print(HPEndpoint.get_operator_logs(since_hours=0.1)) ``` -------------------------------- ### Initialize SDK environment Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/training/SDK/training_sdk_example.ipynb Configures the Python path and suppresses warnings to prepare the environment for the HyperPod SDK. ```python import sys import warnings warnings.filterwarnings("ignore") sys.path.insert(0, '/Users/pintaoz/workspace/private-sagemaker-hyperpod-cli-staging/sagemaker-hyperpod/src/sagemaker') sys.path ``` -------------------------------- ### Get Logs from a HyperPod Space Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/space.md Retrieve logs from the default pod and container of a space. ```bash hyp get-logs hyp-space --name myspace ``` ```python from sagemaker.hyperpod.space.hyperpod_space import HPSpace # Get space and retrieve logs space = HPSpace.get(name="myspace") # Get logs from default pod and container logs = space.get_logs() print(logs) ``` -------------------------------- ### Create a clean directory for job configuration Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/training.md Recommended initial step to isolate job configuration files in a new directory. ```bash mkdir my-pytorch-job cd my-pytorch-job ``` -------------------------------- ### Get Current Cluster Context Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started.md View information about the currently configured cluster context. ```bash hyp get-cluster-context ``` ```python from sagemaker.hyperpod import get_cluster_context get_cluster_context() ``` -------------------------------- ### Build and Push Docker Image Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/01-training-job-submission/00-pytorch-training-job.md Build the training image from the docker directory and push it to the configured ECR repository. ```bash cd docker docker build --platform linux/amd64 -t $ECR_URI:$DOCKER_IMAGE_TAG . docker push $ECR_URI:$DOCKER_IMAGE_TAG cd .. ``` -------------------------------- ### View Current Configuration Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/cluster_management/cluster_creation_init_experience.ipynb Display the contents of the generated config.yaml file to verify the settings before deployment. ```python # Display the current configuration !cat config.yaml | head -50 ``` -------------------------------- ### Get Logs from a Recipe Job Pod Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/README.md Retrieves logs for a specific pod in a recipe job. ```bash hyp get-logs hyp-recipe-job --job-name --pod-name --namespace default ``` -------------------------------- ### Get Operator Logs for Training Job Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/README.md Retrieves operator logs for the specified training job. ```bash hyp get-operator-logs hyp-pytorch-job --since-hours 0.5 ``` -------------------------------- ### Get operator logs Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/training/CLI/training-e2e-cli.ipynb Retrieve operator logs for a PyTorch job within a specified timeframe. ```python !hyp get-operator-logs hyp-pytorch-job --since-hours 0.5 ``` -------------------------------- ### hyp init Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/cli/training/cli_training.md Initializes a template scaffold in the current directory or a specified target directory. ```APIDOC ## hyp init ### Description Initialize a template scaffold in the current directory. ### Syntax `hyp init TEMPLATE [DIRECTORY] [OPTIONS]` ### Parameters - **TEMPLATE** (CHOICE) - Required - Template type (cluster-stack, hyp-pytorch-job, hyp-custom-endpoint, hyp-jumpstart-endpoint) - **DIRECTORY** (PATH) - Optional - Target directory (default: current directory) - **--version** (TEXT) - Optional - Schema version to use ``` -------------------------------- ### Get logs from JumpStart endpoint pods Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/cli/inference/cli_inference.md Retrieves logs from a specific pod in a JumpStart endpoint. ```bash hyp get-logs hyp-jumpstart-endpoint [OPTIONS] ``` -------------------------------- ### Create and Authenticate with ECR Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/01-training-job-submission/00-pytorch-training-job.md Configure environment variables, create an ECR repository, and authenticate the Docker client to the registry. ```bash AWS_REGION="PLEASE_FILL_IN" AWS_ACCOUNT_ID="PLEASE_FILL_IN" DOCKER_IMAGE_TAG="pytorch2.8-cu129" ECR_NAME="qwen3-finetuning" ECR_URI=$AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$ECR_NAME aws ecr create-repository --repository-name $ECR_NAME --region $AWS_REGION 2>&1 | grep -v "RepositoryAlreadyExistsException" || echo "Repository already exists or created successfully" aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $ECR_URI aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin 763104351884.dkr.ecr.us-west-2.amazonaws.com ``` -------------------------------- ### List JumpStart endpoints Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/02-inference-deployment/00-jumpstart-endpoint.md Lists all JumpStart endpoints and displays their current status. ```bash hyp list hyp-jumpstart-endpoint ``` -------------------------------- ### Get operator logs Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/inference/CLI/inference-jumpstart-e2e-cli.ipynb Retrieve operator logs for the JumpStart endpoint for a specified time window. ```bash !hyp get-operator-logs hyp-jumpstart-endpoint --since-hours 0.5 ``` -------------------------------- ### Manual Region Override with Helm Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/helm_chart/readme.md Use the health-monitoring-agent.region flag to manually specify the AWS region during installation. ```bash helm install dependencies helm_chart/HyperPodHelmChart --namespace kube-system --set health-monitoring-agent.region=us-west-2 ``` -------------------------------- ### Initialize HyperPod PyTorch Job Configuration Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/01-training-job-submission/00-pytorch-training-job.md Creates a new directory and initializes the necessary configuration files for a HyperPod PyTorch job. ```bash mkdir pytorch-job-config && cd pytorch-job-config hyp init hyp-pytorch-job ``` -------------------------------- ### List and Describe Cluster Resources Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/cli/cluster_management/cli_cluster_management.md Commands to list cluster stacks, describe specific stacks, view cluster capacity, and manage the current CLI context. ```bash # List all cluster stacks hyp list cluster-stack --region us-west-2 # Describe specific cluster stack hyp describe cluster-stack my-stack-name --region us-west-2 # List HyperPod clusters with capacity info hyp list-cluster --region us-west-2 --output table # Connect to cluster hyp set-cluster-context --cluster-name my-cluster --region us-west-2 # Get current context hyp get-cluster-context ``` -------------------------------- ### List Helm Releases Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/helm_chart/readme.md List all releases currently deployed in a specific namespace to identify existing installations. ```bash helm list --namespace kube-system ``` -------------------------------- ### List JumpStart model endpoints Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/cli/inference/cli_inference.md Lists all JumpStart model endpoints, optionally filtered by namespace. ```bash hyp list hyp-jumpstart-endpoint [OPTIONS] ``` -------------------------------- ### Create JumpStart Model Endpoint via SDK Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/inference.md Use the HPJumpStartEndpoint class to configure and create a JumpStart model endpoint. ```python from sagemaker.hyperpod.inference.config.hp_jumpstart_endpoint_config import Model, Server, SageMakerEndpoint, TlsConfig from sagemaker.hyperpod.inference.hp_jumpstart_endpoint import HPJumpStartEndpoint model = Model( model_id="deepseek-llm-r1-distill-qwen-1-5b" ) server = Server( instance_type="ml.g5.8xlarge" ) endpoint_name = SageMakerEndpoint(name="endpoint-jumpstart") js_endpoint = HPJumpStartEndpoint( model=model, server=server, sage_maker_endpoint=endpoint_name ) js_endpoint.create() ``` -------------------------------- ### Basic migration command Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/helm_chart/HyperPodHelmChart/charts/inference-operator/migration/README.md Performs a standard migration including dependency migration. ```bash ./helm_to_addon.sh \ --cluster-name my-cluster \ --region us-east-1 ``` -------------------------------- ### Initialize HyperPod cluster stack Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/00-getting-started/01-(optional)-cluster-creation.md Creates a new directory and initializes the HyperPod cluster stack configuration files. ```bash mkdir cluster-stack && cd cluster-stack hyp init cluster-stack ``` -------------------------------- ### Initialize custom endpoint configuration Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/inference/CLI/inference-s3-model-init-experience.ipynb Creates a new configuration template in the current directory, generating a config.yaml file, a k8s.jinja reference file, and a README.md. ```python # Initialize a new custom endpoint configuration in the current directory !hyp init hyp-custom-endpoint ``` -------------------------------- ### Get logs for a PyTorch job pod Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/cli/training/cli_training.md Retrieves logs from a specific pod within a PyTorch job. ```bash hyp get-logs hyp-pytorch-job [OPTIONS] ``` -------------------------------- ### Create HyperPod Cluster Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/cluster_management/cluster_creation_init_experience.ipynb The hyp create command deploys the full infrastructure, including VPC, EKS, IAM roles, and S3 buckets. This process typically takes 15-30 minutes. ```python # Create the HyperPod cluster # This will deploy all infrastructure components !hyp create ``` -------------------------------- ### Initialize Pytorch job configuration Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/training/CLI/training-init-experience.ipynb Creates a new configuration template with default settings, including a config.yaml file, k8s.jinja template, and a README.md. ```python # Initialize a new pytorch job configuration in the current directory !hyp init hyp-pytorch-job ``` -------------------------------- ### Disable Debug Mode Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/helm_chart/readme.md Debug mode is enabled by default. Use the health-monitoring-agent.debug flag to disable it during installation or upgrade. ```bash # Disable debug mode during installation helm install dependencies helm_chart/HyperPodHelmChart --namespace kube-system --set health-monitoring-agent.debug=false # Or upgrade existing installation with debug disabled helm upgrade dependencies helm_chart/HyperPodHelmChart --namespace kube-system --set health-monitoring-agent.debug=false ``` -------------------------------- ### Get inference operator logs Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/02-inference-deployment/01-custom-model-endpoint.md Retrieves logs from the inference operator to monitor deployment progress and troubleshoot issues. ```bash hyp get-operator-logs hyp-custom-endpoint --since-hours 0.5 ``` -------------------------------- ### Create a training job using the SDK Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/training.md Configure and execute a PyTorch training job using the HyperPod SDK classes and configuration objects. ```python from sagemaker.hyperpod.training import ( HyperPodPytorchJob, Containers, ReplicaSpec, Resources, RunPolicy, Spec, Template, ) from sagemaker.hyperpod.common.config import Metadata nproc_per_node="1" replica_specs=[ ReplicaSpec( name="pod", template=Template( spec=Spec( containers=[ Containers( name="container-name", image="448049793756.dkr.ecr.us-west-2.amazonaws.com/ptjob:mnist", image_pull_policy="Always", resources=Resources( requests={"nvidia.com/gpu": "0"}, limits={"nvidia.com/gpu": "0"}, ), # command=[] ) ] ) ), ) ] run_policy=RunPolicy(clean_pod_policy="None") pytorch_job = HyperPodPytorchJob( metadata=Metadata(name="demo"), nproc_per_node="1", replica_specs=replica_specs, run_policy=run_policy, ) pytorch_job.create() ``` -------------------------------- ### Get logs from a space resource Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/cli/space/cli_space.md Retrieves logs from a space resource using the hyp get-logs hyp-space command. ```bash hyp get-logs hyp-space --name my-space --namespace default --pod-name my-pod ``` -------------------------------- ### List Available Accelerator Partition Types Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/README.md Lists the available accelerator partition types on the cluster for a specific instance type. ```bash hyp list-accelerator-partition-type --instance-type ``` -------------------------------- ### List all Jumpstart endpoints Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/inference/CLI/inference-jumpstart-init-experience.ipynb Use this command to view all HyperPod jumpstart endpoints currently deployed in your account. ```python # List all jumpstart endpoints in your account !hyp list hyp-jumpstart-endpoint ``` -------------------------------- ### Get logs for a specific pod Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/02-inference-deployment/00-jumpstart-endpoint.md Retrieves logs for a specific pod by defining the pod name and running the get-logs command. ```bash POD_NAME="test-js-endpoint-76588dc9-tzf89" hyp get-logs hyp-jumpstart-endpoint --pod-name $POD_NAME ``` -------------------------------- ### Create a space using the HyperPod CLI Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/space.md Use the hyp create hyp-space command to initialize a new workspace environment. ```bash hyp create hyp-space \ --name myspace \ --display-name "My Space" ``` -------------------------------- ### Get Logs from a Pod via SDK Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/training.md Retrieve a job object and call the get_logs_from_pod method with the target pod name. ```python from sagemaker.hyperpod.training import HyperPodPytorchJob # Get pod logs for a job job = HyperPodPytorchJob.get(name="my-pytorch-job") print(job.get_logs_from_pod("pod-name")) ``` -------------------------------- ### Display Public Hub Models Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/inference/SDK/inference-jumpstart-e2e.ipynb Load and view available JumpStart models from the public hub. ```python # Import the helper module from sagemaker.hyperpod.inference.jumpstart_public_hub_visualization_utils import get_all_public_hub_model_data # Load and display SageMaker public hub models get_all_public_hub_model_data(region="us-east-2") ``` -------------------------------- ### Get Logs from a Pod via CLI Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/training.md Use the hyp get-logs command specifying both the pod name and the job name. ```bash hyp get-logs hyp-pytorch-job --pod-name test-pytorch-job-cli-pod-0 --job-name test-pytorch-job-cli ``` -------------------------------- ### Reset Configuration Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/cluster_management/cluster_creation_init_experience.ipynb The hyp reset command is used to revert to default settings or clean up partial deployments when starting fresh or troubleshooting. ```python # Reset configuration if needed (uncomment to use) # !hyp reset print("Reset command available if configuration changes are needed") ``` -------------------------------- ### Run migration script usage Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/helm_chart/HyperPodHelmChart/charts/inference-operator/migration/README.md Basic command structure for executing the migration script. ```bash ./helm_to_addon.sh [OPTIONS] ``` -------------------------------- ### View job status output Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/03-task-governance/00-task-governance.md Example output showing Team A's job suspended and Team B's job running. ```text NAME NAMESPACE STATUS AGE -------------------------------------------------------------------------------- team-a-qwen3-training-prio hyperpod-ns-team-a Suspended N/A NAME NAMESPACE STATUS AGE -------------------------------------------------------------------------------- team-b-qwen3-training-prio hyperpod-ns-team-b Running 2m ``` -------------------------------- ### Create SageMaker Space Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/04-spaces/00-create-space.md Create a space on a CPU instance with a mounted FSx for Lustre filesystem. The output confirms successful creation in the default namespace. ```bash hyp create hyp-space --name $SPACE_NAME \ --display-name $SPACE_NAME --node-selector '{"node.kubernetes.io/instance-type":"ml.t3.2xlarge"}' \ --volume name=fsx-data,mountPath=/fsx,persistentVolumeClaimName=fsx-claim ``` ```text Space 'my-jupyterlab-space' created successfully in namespace 'default' ``` -------------------------------- ### Review generated configuration Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/01-training-job-submission/02-recipe-job-cli.ipynb Display the contents of the generated config.yaml file. ```python # Review the generated config !cat {JOB_DIR}/config.yaml ``` -------------------------------- ### Get cluster context Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/cli/cluster_management/cli_cluster_management.md Retrieves context information for the currently connected cluster. Use the --debug flag to enable debug logging. ```bash hyp get-cluster-context [OPTIONS] ``` -------------------------------- ### Initialize Recipe Job with HuggingFace model ID Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/training.md Initializes a new recipe job directory using a HuggingFace model ID, technique, and instance type. ```bash mkdir my-recipe-job cd my-recipe-job hyp init hyp-recipe-job . \ --huggingface-model-id Qwen/Qwen3-0.6B \ --technique SFT \ --instance-type ml.g5.48xlarge ``` -------------------------------- ### Get inference operator logs Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/end_to_end_walkthrough/02-inference-deployment/00-jumpstart-endpoint.md Retrieves logs from the inference operator to monitor deployment progress and troubleshoot issues, filtered by the last hour. ```bash hyp get-operator-logs hyp-custom-endpoint --since-hours 1 ``` -------------------------------- ### Initialize HPEndpoint object Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/inference/SDK/inference-fsx-model-e2e.ipynb Create the HPEndpoint instance with the previously defined configurations. ```python fsx_endpoint = HPEndpoint( metadata=metadata, endpoint_name='', instance_type='ml.g5.8xlarge', model_name='deepseek15b-fsx-test-pysdk', tls_config=tls_config, model_source_config=model_source_config, worker=worker, ) ``` -------------------------------- ### Get custom endpoint operator logs Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/cli/inference/cli_inference.md Retrieves operator logs for a custom endpoint. Requires the --since-hours parameter to specify the time frame. ```bash hyp get-operator-logs hyp-custom-endpoint [OPTIONS] ``` -------------------------------- ### Create the cluster Source: https://github.com/aws/sagemaker-hyperpod-cli/blob/main/doc/getting_started/cluster_management.rst Validates configuration and initializes the cluster creation process in the specified region. ```bash hyp create --region your-region ```