AWS sagemaker documentation change
Summary
Reorganized content with new SageMaker Python SDK v3 examples and preserved legacy SDK examples under new headings
Security assessment
Changes only restructure documentation and add new code samples for Debugger configuration. No security-related content or vulnerabilities are addressed.
Diff
diff --git a/sagemaker/latest/dg/debugger-configuration-for-debugging.md b/sagemaker/latest/dg/debugger-configuration-for-debugging.md index 344c52536..194b6fbf5 100644 --- a//sagemaker/latest/dg/debugger-configuration-for-debugging.md +++ b//sagemaker/latest/dg/debugger-configuration-for-debugging.md @@ -25 +25 @@ The following code examples are templates for constructing the SageMaker AI fram -PyTorch +SageMaker Python SDK v3 @@ -28,0 +29,58 @@ PyTorch + # An example of creating a training job with debugger configuration + import boto3 + from sagemaker.core import image_uris + from sagemaker.core.resources import TrainingJob + from sagemaker.core.shapes import ( + AlgorithmSpecification, + ResourceConfig, + OutputDataConfig, + StoppingCondition, + DebugHookConfig, + CollectionConfiguration, + DebugRuleConfiguration, + ) + + session=boto3.session.Session() + region=session.region_name + + # Retrieve the training image for your framework + # Change framework to "tensorflow", "mxnet", "xgboost", etc. as needed + training_image = image_uris.retrieve( + framework="pytorch", # or "tensorflow", "mxnet", "xgboost" + region=region, + version="1.12.0", + py_version="py37", + instance_type="ml.p3.2xlarge", + image_scope="training" + ) + + debug_hook_config=DebugHookConfig(...) + debug_rule_configurations=[ + DebugRuleConfiguration( + rule_configuration_name="built_in_rule", + rule_evaluator_image="rule-evaluator-image-uri", + ) + ] + + TrainingJob.create( + training_job_name="debugger-demo", + algorithm_specification=AlgorithmSpecification( + training_image=training_image, + training_input_mode="File", + ), + role_arn="arn:aws:iam::123456789012:role/SageMakerRole", + resource_config=ResourceConfig(instance_type="ml.p3.2xlarge", instance_count=1, volume_size_in_gb=30), + output_data_config=OutputDataConfig(s3_output_path="s3://bucket/output"), + stopping_condition=StoppingCondition(max_runtime_in_seconds=3600), + + # Debugger-specific parameters + debug_hook_config=debug_hook_config, + debug_rule_configurations=debug_rule_configurations, + ) + +SageMaker Python SDK v2 (Legacy) + + +**PyTorch:** + + @@ -59,2 +117 @@ PyTorch -TensorFlow - +**TensorFlow:** @@ -94,2 +151 @@ TensorFlow -MXNet - +**MXNet:** @@ -124,2 +180 @@ MXNet -XGBoost - +**XGBoost:** @@ -153,2 +208 @@ XGBoost -Generic estimator - +**Generic estimator:**