diff --git a/doc/_static/custom.css b/doc/_static/custom.css index 53dea4ed..4fa4614e 100644 --- a/doc/_static/custom.css +++ b/doc/_static/custom.css @@ -22,22 +22,22 @@ /* Header styling */ header { background-color: white; - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); /* shadow-sm */ + + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); position: sticky; top: 0; z-index: 50; } -/* Preserving your existing typography */ h1 { - font-size: 1.875rem; /* text-3xl */ - font-weight: 700; /* font-bold */ - color: #111827; /* text-gray-900 */ + font-size: 1.875rem; + font-weight: 700; + color: #111827; } h2 { - font-size: 1.5rem; /* text-2xl */ - font-weight: 700; /* font-bold */ + font-size: 1.5rem; + font-weight: 700; color: #111827; } @@ -48,6 +48,6 @@ h3 { } p { - font-size: 0.875rem; /* Tailwind's text-sm */ - color: #4b5563; /* Tailwind's gray-600 */ + font-size: 0.875rem; + color: #4b5563; } diff --git a/doc/getting_started.md b/doc/getting_started.md index e3e8d6c8..1ba925ce 100644 --- a/doc/getting_started.md +++ b/doc/getting_started.md @@ -10,18 +10,22 @@ This guide will help you get started with the SageMaker HyperPod CLI and SDK to List all available SageMaker HyperPod clusters in your account: -**CLI** +`````{tab-set} +````{tab-item} CLI ```bash hyp list-cluster [--region ] [--namespace ] [--output ] ``` +```` -**SDK** +````{tab-item} SDK ```python from sagemaker.hyperpod.hyperpod_manager import HyperPodManager clusters = HyperPodManager.list_clusters(region='us-east-2') print(clusters) ``` +```` +````` **Parameters:** - `region` (string) - Optional. The AWS region where the SageMaker HyperPod and EKS clusters are located. If not specified, uses the region from your current AWS account credentials. @@ -32,17 +36,21 @@ print(clusters) Configure your local kubectl environment to interact with a specific SageMaker HyperPod cluster and namespace: -**CLI** +`````{tab-set} +````{tab-item} CLI ```bash hyp set-cluster-context --cluster-name [--namespace ] ``` +```` -**SDK** +````{tab-item} SDK ```python from sagemaker.hyperpod.hyperpod_manager import HyperPodManager HyperPodManager.set_context('', region='us-east-2') ``` +```` +````` **Parameters:** - `cluster-name` (string) - Required. The SageMaker HyperPod cluster name to configure with. @@ -52,12 +60,14 @@ HyperPodManager.set_context('', region='us-east-2') View information about the currently configured cluster context: -**CLI** +`````{tab-set} +````{tab-item} CLI ```bash hyp get-cluster-context ``` +```` -**SDK** +````{tab-item} SDK ```python from sagemaker.hyperpod.hyperpod_manager import HyperPodManager @@ -65,6 +75,8 @@ from sagemaker.hyperpod.hyperpod_manager import HyperPodManager context = HyperPodManager.get_context() print(context) ``` +```` +````` ## Job Management @@ -72,16 +84,20 @@ print(context) View all pods associated with a specific training job: -**CLI** +`````{tab-set} +````{tab-item} CLI ```bash hyp list-pods hyp-pytorch-job --job-name ``` +```` -**SDK** +````{tab-item} SDK ```python # List all pods created for this job pytorch_job.list_pods() ``` +```` +````` **Parameters:** - `job-name` (string) - Required. The name of the job to list pods for. @@ -90,16 +106,20 @@ pytorch_job.list_pods() View logs for a specific pod within a training job: -**CLI** +`````{tab-set} +````{tab-item} CLI ```bash hyp get-logs hyp-pytorch-job --pod-name --job-name ``` +```` -**SDK** +````{tab-item} SDK ```python # Check the logs from pod0 pytorch_job.get_logs_from_pod("demo-pod-0") ``` +```` +````` **Parameters:** - `job-name` (string) - Required. The name of the job to get logs for. diff --git a/doc/index.md b/doc/index.md index 1e507b88..d39c7541 100644 --- a/doc/index.md +++ b/doc/index.md @@ -16,6 +16,8 @@ API reference <_apidoc/modules> SageMaker HyperPod CLI and SDK provide a seamless way to manage distributed training and inference workloads on EKS-hosted SageMaker HyperPod clusters—without needing Kubernetes expertise. Use the powerful CLI to launch and monitor training jobs and endpoints, or leverage the Python SDK to do the same programmatically with minimal code, including support for JumpStart models, custom endpoints, and built-in monitoring. +## Start Here + ::::{container} ::::{grid} 1 2 4 4 :gutter: 3 diff --git a/doc/inference.md b/doc/inference.md index 67237385..3edb2a7d 100644 --- a/doc/inference.md +++ b/doc/inference.md @@ -21,7 +21,8 @@ You can create inference endpoints using either JumpStart models or custom model ### JumpStart Model Endpoints -**CLI** +`````{tab-set} +````{tab-item} CLI ```bash hyp create hyp-jumpstart-endpoint \ --version 1.0 \ @@ -30,8 +31,9 @@ hyp create hyp-jumpstart-endpoint \ --endpoint-name endpoint-jumpstart \ --tls-output-s3-uri s3://sample-bucket ``` +```` -**SDK** +````{tab-item} SDK ```python from sagemaker.hyperpod.inference import HyperPodJumpstartEndpoint @@ -46,10 +48,13 @@ endpoint = HyperPodJumpstartEndpoint( # Deploy the endpoint endpoint.create() ``` +```` +````` ### Custom Model Endpoints -**CLI** +`````{tab-set} +````{tab-item} CLI ```bash hyp create hyp-custom-endpoint \ --version 1.0 \ @@ -59,8 +64,9 @@ hyp create hyp-custom-endpoint \ --instance-type ml.g5.8xlarge \ --tls-output-s3-uri s3://sample-bucket ``` +```` -**SDK** +````{tab-item} SDK ```python from sagemaker.hyperpod.inference import HyperPodCustomEndpoint @@ -76,6 +82,8 @@ endpoint = HyperPodCustomEndpoint( # Deploy the endpoint endpoint.create() ``` +```` +````` ## Key Parameters @@ -92,7 +100,8 @@ When creating an inference endpoint, you'll need to specify: ### List Endpoints -**CLI** +`````{tab-set} +````{tab-item} CLI ```bash # List JumpStart endpoints hyp list hyp-jumpstart-endpoint @@ -100,8 +109,9 @@ hyp list hyp-jumpstart-endpoint # List custom endpoints hyp list hyp-custom-endpoint ``` +```` -**SDK** +````{tab-item} SDK ```python from sagemaker.hyperpod.inference import HyperPodJumpstartEndpoint, HyperPodCustomEndpoint @@ -113,10 +123,13 @@ print(jumpstart_endpoints) custom_endpoints = HyperPodCustomEndpoint.list() print(custom_endpoints) ``` +```` +````` ### Describe an Endpoint -**CLI** +`````{tab-set} +````{tab-item} CLI ```bash # Describe JumpStart endpoint hyp describe hyp-jumpstart-endpoint --endpoint-name @@ -124,8 +137,9 @@ hyp describe hyp-jumpstart-endpoint --endpoint-name # Describe custom endpoint hyp describe hyp-custom-endpoint --endpoint-name ``` +```` -**SDK** +````{tab-item} SDK ```python from sagemaker.hyperpod.inference import HyperPodJumpstartEndpoint, HyperPodCustomEndpoint @@ -139,10 +153,13 @@ custom_endpoint = HyperPodCustomEndpoint.load(endpoint_name="endpoint-custom") custom_details = custom_endpoint.describe() print(custom_details) ``` +```` +````` ### Invoke an Endpoint -**CLI** +`````{tab-set} +````{tab-item} CLI ```bash # Invoke custom endpoint hyp invoke hyp-custom-endpoint \ @@ -150,8 +167,9 @@ hyp invoke hyp-custom-endpoint \ --content-type "application/json" \ --payload '{"inputs": "What is machine learning?"}' ``` +```` -**SDK** +````{tab-item} SDK ```python from sagemaker.hyperpod.inference import HyperPodCustomEndpoint @@ -165,10 +183,13 @@ response = endpoint.invoke( ) print(response) ``` +```` +````` ### Delete an Endpoint -**CLI** +`````{tab-set} +````{tab-item} CLI ```bash # Delete JumpStart endpoint hyp delete hyp-jumpstart-endpoint --endpoint-name @@ -176,8 +197,9 @@ hyp delete hyp-jumpstart-endpoint --endpoint-name # Delete custom endpoint hyp delete hyp-custom-endpoint --endpoint-name ``` +```` -**SDK** +````{tab-item} SDK ```python from sagemaker.hyperpod.inference import HyperPodJumpstartEndpoint, HyperPodCustomEndpoint @@ -189,6 +211,8 @@ jumpstart_endpoint.delete() custom_endpoint = HyperPodCustomEndpoint.load(endpoint_name="endpoint-custom") custom_endpoint.delete() ``` +```` +````` ## Inference Example Notebooks diff --git a/doc/training.md b/doc/training.md index 6cdc0332..76bb4c79 100644 --- a/doc/training.md +++ b/doc/training.md @@ -20,7 +20,8 @@ SageMaker HyperPod training jobs allow you to: You can create training jobs using either the CLI or SDK approach: -**CLI** +`````{tab-set} +````{tab-item} CLI ```bash hyp create hyp-pytorch-job \ --version 1.0 \ @@ -42,8 +43,8 @@ hyp create hyp-pytorch-job \ --persistent-volume-claims '["shared-data-pvc", "model-registry-pvc"]' \ --output-s3-uri s3://my-bucket/model-artifacts ``` - -**SDK** +```` +````{tab-item} SDK ```python from sagemaker.hyperpod import HyperPodPytorchJob from sagemaker.hyperpod.job import ReplicaSpec, Template, Spec, Container, Resources, RunPolicy, Metadata @@ -94,6 +95,8 @@ pytorch_job = HyperPodPytorchJob( # Submit the job pytorch_job.create() ``` +```` +````` ## Key Parameters @@ -111,12 +114,13 @@ When creating a training job, you'll need to specify: ### List Training Jobs -**CLI** +`````{tab-set} +````{tab-item} CLI ```bash hyp list hyp-pytorch-job ``` - -**SDK** +```` +````{tab-item} SDK ```python from sagemaker.hyperpod import HyperPodManager @@ -124,15 +128,18 @@ from sagemaker.hyperpod import HyperPodManager jobs = HyperPodManager.list_jobs(job_type="hyp-pytorch-job") print(jobs) ``` +```` +````` ### Describe a Training Job -**CLI** +`````{tab-set} +````{tab-item} CLI ```bash hyp describe hyp-pytorch-job --job-name ``` - -**SDK** +```` +````{tab-item} SDK ```python from sagemaker.hyperpod import HyperPodPytorchJob @@ -143,15 +150,18 @@ job = HyperPodPytorchJob.load(job_name="my-pytorch-job") job_details = job.describe() print(job_details) ``` +```` +````` ### Delete a Training Job -**CLI** +`````{tab-set} +````{tab-item} CLI ```bash hyp delete hyp-pytorch-job --job-name ``` - -**SDK** +```` +````{tab-item} SDK ```python from sagemaker.hyperpod import HyperPodPytorchJob @@ -161,6 +171,8 @@ job = HyperPodPytorchJob.load(job_name="my-pytorch-job") # Delete the job job.delete() ``` +```` +````` ## Training Example Notebooks