Skip to content

Commit bdc2ab6

Browse files
authored
Merge branch 'zwei' into migration-tool-airflow-image-uri
2 parents d81d464 + 15f5358 commit bdc2ab6

17 files changed

+52
-395
lines changed

doc/algorithms/factorization_machines.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Amazon SageMaker Factorization Machines algorithm.
88
:undoc-members:
99
:show-inheritance:
1010
:inherited-members:
11-
:exclude-members: image, num_factors, predictor_type, epochs, clip_gradient, mini_batch_size, feature_dim, eps, rescale_grad, bias_lr, linear_lr, factors_lr, bias_wd, linear_wd, factors_wd, bias_init_method, bias_init_scale, bias_init_sigma, bias_init_value, linear_init_method, linear_init_scale, linear_init_sigma, linear_init_value, factors_init_method, factors_init_scale, factors_init_sigma, factors_init_value
11+
:exclude-members: image_uri, num_factors, predictor_type, epochs, clip_gradient, mini_batch_size, feature_dim, eps, rescale_grad, bias_lr, linear_lr, factors_lr, bias_wd, linear_wd, factors_wd, bias_init_method, bias_init_scale, bias_init_sigma, bias_init_value, linear_init_method, linear_init_scale, linear_init_sigma, linear_init_value, factors_init_method, factors_init_scale, factors_init_sigma, factors_init_value
1212

1313

1414
.. autoclass:: sagemaker.FactorizationMachinesModel

doc/algorithms/ipinsights.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Amazon SageMaker IP Insights algorithm.
88
:undoc-members:
99
:show-inheritance:
1010
:inherited-members:
11-
:exclude-members: image, num_entity_vectors, vector_dim, batch_metrics_publish_interval, epochs, learning_rate,
11+
:exclude-members: image_uri, num_entity_vectors, vector_dim, batch_metrics_publish_interval, epochs, learning_rate,
1212
num_ip_encoder_layers, random_negative_sampling_rate, shuffled_negative_sampling_rate, weight_decay
1313

1414
.. autoclass:: sagemaker.IPInsightsModel

doc/algorithms/kmeans.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Amazon SageMaker K-means algorithm.
88
:undoc-members:
99
:show-inheritance:
1010
:inherited-members:
11-
:exclude-members: image, k, init_method, max_iterations, tol, num_trials, local_init_method, half_life_time_size, epochs, center_factor, mini_batch_size, feature_dim, MAX_DEFAULT_BATCH_SIZE
11+
:exclude-members: image_uri, k, init_method, max_iterations, tol, num_trials, local_init_method, half_life_time_size, epochs, center_factor, mini_batch_size, feature_dim, MAX_DEFAULT_BATCH_SIZE
1212

1313
.. autoclass:: sagemaker.KMeansModel
1414
:members:

doc/algorithms/knn.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Amazon SageMaker K-Nearest Neighbors (k-NN) algorithm.
88
:undoc-members:
99
:show-inheritance:
1010
:inherited-members:
11-
:exclude-members: image, k, sample_size, predictor_type, dimension_reduction_target, dimension_reduction_type,
11+
:exclude-members: image_uri, k, sample_size, predictor_type, dimension_reduction_target, dimension_reduction_type,
1212
index_metric, index_type, faiss_index_ivf_nlists, faiss_index_pq_m
1313

1414
.. autoclass:: sagemaker.KNNModel

doc/algorithms/lda.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Amazon SageMaker LDA algorithm.
88
:undoc-members:
99
:show-inheritance:
1010
:inherited-members:
11-
:exclude-members: image, num_topics, alpha0, max_restarts, max_iterations, mini_batch_size, feature_dim, tol
11+
:exclude-members: image_uri, num_topics, alpha0, max_restarts, max_iterations, mini_batch_size, feature_dim, tol
1212

1313

1414
.. autoclass:: sagemaker.LDAModel

doc/algorithms/linear_learner.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Amazon SageMaker LinearLearner algorithm.
88
:undoc-members:
99
:show-inheritance:
1010
:inherited-members:
11-
:exclude-members: image, train_instance_count, train_instance_type, predictor_type, binary_classifier_model_selection_criteria, target_recall, target_precision, positive_example_weight_mult, epochs, use_bias, num_models, parameter, num_calibration_samples, calibration, init_method, init_scale, init_sigma, init_bias, optimizer, loss, wd, l1, momentum, learning_rate, beta_1, beta_2, bias_lr_mult, use_lr_scheduler, lr_scheduler_step, lr_scheduler_factor, lr_scheduler_minimum_lr, lr_scheduler_minimum_lr, mini_batch_size, feature_dim, bias_wd_mult, MAX_DEFAULT_BATCH_SIZE
11+
:exclude-members: image_uri, train_instance_count, train_instance_type, predictor_type, binary_classifier_model_selection_criteria, target_recall, target_precision, positive_example_weight_mult, epochs, use_bias, num_models, parameter, num_calibration_samples, calibration, init_method, init_scale, init_sigma, init_bias, optimizer, loss, wd, l1, momentum, learning_rate, beta_1, beta_2, bias_lr_mult, use_lr_scheduler, lr_scheduler_step, lr_scheduler_factor, lr_scheduler_minimum_lr, lr_scheduler_minimum_lr, mini_batch_size, feature_dim, bias_wd_mult, MAX_DEFAULT_BATCH_SIZE
1212

1313
.. autoclass:: sagemaker.LinearLearnerModel
1414
:members:

doc/algorithms/ntm.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ The Amazon SageMaker NTM algorithm.
88
:undoc-members:
99
:show-inheritance:
1010
:inherited-members:
11-
:exclude-members: image, num_topics, encoder_layers, epochs, encoder_layers_activation, optimizer, tolerance,
12-
num_patience_epochs, batch_norm, rescale_gradient, clip_gradient, weight_decay, learning_rate
11+
:exclude-members: image_uri, num_topics, encoder_layers, epochs, encoder_layers_activation, optimizer, tolerance,
12+
num_patience_epochs, batch_norm, rescale_gradient, clip_gradient, weight_decay, learning_rate
1313

1414

1515
.. autoclass:: sagemaker.NTMModel

doc/algorithms/object2vec.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Amazon SageMaker Object2Vec algorithm.
88
:undoc-members:
99
:show-inheritance:
1010
:inherited-members:
11-
:exclude-members: image, enc_dim, mini_batch_size, epochs, early_stopping_patience, early_stopping_tolerance,
11+
:exclude-members: image_uri, enc_dim, mini_batch_size, epochs, early_stopping_patience, early_stopping_tolerance,
1212
dropout, weight_decay, bucket_width, num_classes, mlp_layers, mlp_dim, mlp_activation,
1313
output_layer, optimizer, learning_rate, enc0_network, enc1_network, enc0_cnn_filter_width,
1414
enc1_cnn_filter_width, enc0_max_seq_len, enc1_max_seq_len, enc0_token_embedding_dim,

doc/algorithms/pca.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Amazon SageMaker PCA algorithm.
88
:undoc-members:
99
:show-inheritance:
1010
:inherited-members:
11-
:exclude-members: image, num_components, algorithm_mode, subtract_mean, extra_components, mini_batch_size, feature_dim, MAX_DEFAULT_BATCH_SIZE
11+
:exclude-members: image_uri, num_components, algorithm_mode, subtract_mean, extra_components, mini_batch_size, feature_dim, MAX_DEFAULT_BATCH_SIZE
1212

1313

1414
.. autoclass:: sagemaker.PCAModel

doc/algorithms/randomcutforest.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Amazon SageMaker Random Cut Forest algorithm.
88
:undoc-members:
99
:show-inheritance:
1010
:inherited-members:
11-
:exclude-members: image, num_trees, num_samples_per_tree, eval_metrics, feature_dim, MINI_BATCH_SIZE
11+
:exclude-members: image_uri, num_trees, num_samples_per_tree, eval_metrics, feature_dim, MINI_BATCH_SIZE
1212

1313

1414
.. autoclass:: sagemaker.RandomCutForestModel

doc/frameworks/chainer/using_chainer.rst

+12-116
Original file line numberDiff line numberDiff line change
@@ -492,41 +492,15 @@ The following code sample shows how to do this, using the ``ChainerModel`` class
492492

493493
.. code:: python
494494
495-
chainer_model = ChainerModel(model_data="s3://bucket/model.tar.gz", role="SageMakerRole",
496-
entry_point="transform_script.py")
495+
chainer_model = ChainerModel(
496+
model_data="s3://bucket/model.tar.gz",
497+
role="SageMakerRole",
498+
entry_point="transform_script.py",
499+
)
497500
498501
predictor = chainer_model.deploy(instance_type="ml.c4.xlarge", initial_instance_count=1)
499502
500-
The ChainerModel constructor takes the following arguments:
501-
502-
- ``model_data (str):`` An S3 location of a SageMaker model data
503-
.tar.gz file
504-
- ``image (str):`` A Docker image URI
505-
- ``role (str):`` An IAM role name or Arn for SageMaker to access AWS
506-
resources on your behalf.
507-
- ``predictor_cls (callable[string,sagemaker.Session]):`` A function to
508-
call to create a predictor. If not None, ``deploy`` will return the
509-
result of invoking this function on the created endpoint name
510-
- ``env (dict[string,string]):`` Environment variables to run with
511-
``image`` when hosted in SageMaker.
512-
- ``name (str):`` The model name. If None, a default model name will be
513-
selected on each ``deploy.``
514-
- ``entry_point (str):`` Path (absolute or relative) to the Python file
515-
which should be executed as the entry point to model hosting.
516-
- ``source_dir (str):`` Optional. Path (absolute or relative) to a
517-
directory with any other training source code dependencies including
518-
the entry point file. Structure within this directory will be
519-
preserved when training on SageMaker.
520-
- ``enable_cloudwatch_metrics (boolean):`` Optional. If true, training
521-
and hosting containers will generate Cloudwatch metrics under the
522-
AWS/SageMakerContainer namespace.
523-
- ``container_log_level (int):`` Log level to use within the container.
524-
Valid values are defined in the Python logging module.
525-
- ``code_location (str):`` Optional. Name of the S3 bucket where your
526-
custom code will be uploaded to. If not specified, will use the
527-
SageMaker default bucket created by sagemaker.Session.
528-
- ``sagemaker_session (sagemaker.Session):`` The SageMaker Session
529-
object, used for SageMaker interaction"""
503+
To see what arguments are accepted by the ``ChainerModel`` constructor, see :class:`sagemaker.chainer.model.ChainerModel`.
530504

531505
Your model data must be a .tar.gz file in S3. SageMaker Training Job model data is saved to .tar.gz files in S3,
532506
however if you have local data you want to deploy, you can prepare the data yourself.
@@ -556,89 +530,11 @@ https://github.com/awslabs/amazon-sagemaker-examples/tree/master/sagemaker-pytho
556530

557531
These are also available in SageMaker Notebook Instance hosted Jupyter notebooks under the "sample notebooks" folder.
558532

559-
*******************************
560-
sagemaker.chainer.Chainer Class
561-
*******************************
562-
563-
The `Chainer` constructor takes both required and optional arguments.
564-
565-
Required arguments
566-
==================
567-
568-
The following are required arguments to the ``Chainer`` constructor. When you create a Chainer object, you must include
569-
these in the constructor, either positionally or as keyword arguments.
570-
571-
- ``entry_point`` Path (absolute or relative) to the Python file which
572-
should be executed as the entry point to training.
573-
- ``role`` An AWS IAM role (either name or full ARN). The Amazon
574-
SageMaker training jobs and APIs that create Amazon SageMaker
575-
endpoints use this role to access training data and model artifacts.
576-
After the endpoint is created, the inference code might use the IAM
577-
role, if accessing AWS resource.
578-
- ``train_instance_count`` Number of Amazon EC2 instances to use for
579-
training.
580-
- ``train_instance_type`` Type of EC2 instance to use for training, for
581-
example, 'ml.m4.xlarge'.
582-
583-
Optional arguments
584-
==================
585-
586-
The following are optional arguments. When you create a ``Chainer`` object, you can specify these as keyword arguments.
587-
588-
- ``source_dir`` Path (absolute or relative) to a directory with any
589-
other training source code dependencies including the entry point
590-
file. Structure within this directory will be preserved when training
591-
on SageMaker.
592-
- ``dependencies (list[str])`` A list of paths to directories (absolute or relative) with
593-
any additional libraries that will be exported to the container (default: []).
594-
The library folders will be copied to SageMaker in the same folder where the entrypoint is copied.
595-
If the ```source_dir``` points to S3, code will be uploaded and the S3 location will be used
596-
instead. Example:
597-
598-
The following call
599-
>>> Chainer(entry_point='train.py', dependencies=['my/libs/common', 'virtual-env'])
600-
results in the following inside the container:
601-
602-
>>> $ ls
603-
604-
>>> opt/ml/code
605-
>>> ├── train.py
606-
>>> ├── common
607-
>>> └── virtual-env
608-
609-
- ``hyperparameters`` Hyperparameters that will be used for training.
610-
Will be made accessible as a dict[str, str] to the training code on
611-
SageMaker. For convenience, accepts other types besides str, but
612-
str() will be called on keys and values to convert them before
613-
training.
614-
- ``py_version`` Python version you want to use for executing your
615-
model training code.
616-
- ``train_volume_size`` Size in GB of the EBS volume to use for storing
617-
input data during training. Must be large enough to store training
618-
data if input_mode='File' is used (which is the default).
619-
- ``train_max_run`` Timeout in seconds for training, after which Amazon
620-
SageMaker terminates the job regardless of its current status.
621-
- ``input_mode`` The input mode that the algorithm supports. Valid
622-
modes: 'File' - Amazon SageMaker copies the training dataset from the
623-
s3 location to a directory in the Docker container. 'Pipe' - Amazon
624-
SageMaker streams data directly from s3 to the container via a Unix
625-
named pipe.
626-
- ``output_path`` s3 location where you want the training result (model
627-
artifacts and optional output files) saved. If not specified, results
628-
are stored to a default bucket. If the bucket with the specific name
629-
does not exist, the estimator creates the bucket during the fit()
630-
method execution.
631-
- ``output_kms_key`` Optional KMS key ID to optionally encrypt training
632-
output with.
633-
- ``job_name`` Name to assign for the training job that the fit()
634-
method launches. If not specified, the estimator generates a default
635-
job name, based on the training image name and current timestamp
636-
- ``image_name`` An alternative docker image to use for training and
637-
serving. If specified, the estimator will use this image for training and
638-
hosting, instead of selecting the appropriate SageMaker official image based on
639-
framework_version and py_version. Refer to: `SageMaker Chainer Docker Containers
640-
<#sagemaker-chainer-docker-containers>`__ for details on what the Official images support
641-
and where to find the source code to build your custom image.
533+
*************************
534+
SageMaker Chainer Classes
535+
*************************
536+
537+
For information about the different Chainer-related classes in the SageMaker Python SDK, see https://sagemaker.readthedocs.io/en/stable/frameworks/chainer/sagemaker.chainer.html.
642538

643539
***********************************
644540
SageMaker Chainer Docker containers
@@ -689,6 +585,6 @@ specify major and minor version, which will cause your training script to be run
689585
version of that minor version.
690586

691587
Alternatively, you can build your own image by following the instructions in the SageMaker Chainer containers
692-
repository, and passing ``image_name`` to the Chainer Estimator constructor.
588+
repository, and passing ``image_uri`` to the Chainer Estimator constructor.
693589

694590
You can visit the SageMaker Chainer containers repository at https://github.com/aws/sagemaker-chainer-container

doc/frameworks/pytorch/using_pytorch.rst

+5-86
Original file line numberDiff line numberDiff line change
@@ -667,92 +667,11 @@ https://github.com/awslabs/amazon-sagemaker-examples/tree/master/sagemaker-pytho
667667

668668
These are also available in SageMaker Notebook Instance hosted Jupyter notebooks under the sample notebooks folder.
669669

670-
******************
671-
PyTorch Estimators
672-
******************
673-
674-
The `PyTorch` constructor takes both required and optional arguments.
675-
676-
Required arguments
677-
==================
678-
679-
The following are required arguments to the ``PyTorch`` constructor. When you create a PyTorch object, you must include
680-
these in the constructor, either positionally or as keyword arguments.
681-
682-
- ``entry_point`` Path (absolute or relative) to the Python file which
683-
should be executed as the entry point to training.
684-
- ``role`` An AWS IAM role (either name or full ARN). The Amazon
685-
SageMaker training jobs and APIs that create Amazon SageMaker
686-
endpoints use this role to access training data and model artifacts.
687-
After the endpoint is created, the inference code might use the IAM
688-
role, if accessing AWS resource.
689-
- ``train_instance_count`` Number of Amazon EC2 instances to use for
690-
training.
691-
- ``train_instance_type`` Type of EC2 instance to use for training, for
692-
example, 'ml.m4.xlarge'.
693-
694-
Optional arguments
695-
==================
696-
697-
The following are optional arguments. When you create a ``PyTorch`` object, you can specify these as keyword arguments.
698-
699-
- ``source_dir`` Path (absolute or relative) to a directory with any
700-
other training source code dependencies including the entry point
701-
file. Structure within this directory will be preserved when training
702-
on SageMaker.
703-
- ``dependencies (list[str])`` A list of paths to directories (absolute or relative) with
704-
any additional libraries that will be exported to the container (default: []).
705-
The library folders will be copied to SageMaker in the same folder where the entrypoint is copied.
706-
If the ```source_dir``` points to S3, code will be uploaded and the S3 location will be used
707-
instead. Example:
708-
709-
The following call
710-
>>> PyTorch(entry_point='train.py', dependencies=['my/libs/common', 'virtual-env'])
711-
results in the following inside the container:
712-
713-
>>> $ ls
714-
715-
>>> opt/ml/code
716-
>>> ├── train.py
717-
>>> ├── common
718-
>>> └── virtual-env
719-
720-
- ``hyperparameters`` Hyperparameters that will be used for training.
721-
Will be made accessible as a dict[str, str] to the training code on
722-
SageMaker. For convenience, accepts other types besides strings, but
723-
``str`` will be called on keys and values to convert them before
724-
training.
725-
- ``py_version`` Python version you want to use for executing your
726-
model training code.
727-
- ``framework_version`` PyTorch version you want to use for executing
728-
your model training code. You can find the list of supported versions
729-
in `SageMaker PyTorch Docker Containers <https://github.com/aws/sagemaker-python-sdk/tree/master/src/sagemaker/pytorch#sagemaker-pytorch-docker-containers>`_.
730-
- ``train_volume_size`` Size in GB of the EBS volume to use for storing
731-
input data during training. Must be large enough to store training
732-
data if input_mode='File' is used (which is the default).
733-
- ``train_max_run`` Timeout in seconds for training, after which Amazon
734-
SageMaker terminates the job regardless of its current status.
735-
- ``input_mode`` The input mode that the algorithm supports. Valid
736-
modes: 'File' - Amazon SageMaker copies the training dataset from the
737-
S3 location to a directory in the Docker container. 'Pipe' - Amazon
738-
SageMaker streams data directly from S3 to the container via a Unix
739-
named pipe.
740-
- ``output_path`` S3 location where you want the training result (model
741-
artifacts and optional output files) saved. If not specified, results
742-
are stored to a default bucket. If the bucket with the specific name
743-
does not exist, the estimator creates the bucket during the ``fit``
744-
method execution.
745-
- ``output_kms_key`` Optional KMS key ID to optionally encrypt training
746-
output with.
747-
- ``job_name`` Name to assign for the training job that the ``fit```
748-
method launches. If not specified, the estimator generates a default
749-
job name, based on the training image name and current timestamp
750-
- ``image_name`` An alternative docker image to use for training and
751-
serving. If specified, the estimator will use this image for training and
752-
hosting, instead of selecting the appropriate SageMaker official image based on
753-
framework_version and py_version. Refer to: `SageMaker PyTorch Docker Containers
754-
<https://github.com/aws/sagemaker-python-sdk/tree/master/src/sagemaker/pytorch#sagemaker-pytorch-docker-containers>`_ for details on what the Official images support
755-
and where to find the source code to build your custom image.
670+
*************************
671+
SageMaker PyTorch Classes
672+
*************************
673+
674+
For information about the different PyTorch-related classes in the SageMaker Python SDK, see https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/sagemaker.pytorch.html.
756675

757676
***********************************
758677
SageMaker PyTorch Docker Containers

0 commit comments

Comments
 (0)