Skip to content

documentation: add more info about volume_size #3289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 30, 2022
86 changes: 77 additions & 9 deletions src/sagemaker/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,44 @@ def __init__(
instance_type (str): Type of EC2 instance to use for training,
for example, ``'ml.c4.xlarge'``. Required if instance_groups is
not set.
volume_size (int): Size in GB of the EBS volume to use for
storing input data during training (default: 30). Must be large
enough to store training data if File Mode is used (which is the
default).
volume_size (int): Size in GB of the storage volume to use for
storing input and output data during training (default: 30).

Must be large enough to store training data if File mode is
used, which is the default mode.

When you use an ML instance with the EBS-only storage option
such as ``ml.c5`` and ``ml.p2``,
you must define the size of the EBS
volume through the ``volume_size`` parameter in the estimator class.

.. note::

When you use an ML instance with `NVMe SSD volumes
<https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ssd-instance-store.html#nvme-ssd-volumes>`_
such as ``ml.p4d``, ``ml.g4dn``, and ``ml.g5``,
do not include this parameter in the estimator configuration.
If you use one of those ML instance types,
SageMaker doesn't provision Amazon EBS General Purpose SSD
(gp2) storage nor take this parameter to adjust the NVMe instance storage.
Available storage is fixed to the NVMe instance storage
capacity. SageMaker configures storage paths for training
datasets, checkpoints, model artifacts, and outputs to use the
entire capacity of the instance storage.

Note that if you include this parameter and specify a number that
exceeds the size of the NVMe volume attached to the instance type,
SageMaker returns an ``Invalid VolumeSizeInGB`` error.

To look up instance types and their instance storage types
and volumes, see `Amazon EC2 Instance Types
<http://aws.amazon.com/ec2/instance-types/>`_.

To find the default local paths defined by the SageMaker
training platform, see `Amazon SageMaker Training Storage
Folders for Training Datasets, Checkpoints, Model Artifacts,
and Outputs
<https://docs.aws.amazon.com/sagemaker/latest/dg/model-train-storage.html>`_.
volume_kms_key (str): Optional. KMS key ID for encrypting EBS
volume attached to the training instance (default: None).
max_run (int): Timeout in seconds for training (default: 24 *
Expand Down Expand Up @@ -2232,12 +2266,46 @@ def __init__(
instance_count (int): Number of Amazon EC2 instances to use
for training. Required if instance_groups is not set.
instance_type (str): Type of EC2 instance to use for training,
for example, 'ml.c4.xlarge'. Required if instance_groups is
for example, ``'ml.c4.xlarge'``. Required if instance_groups is
not set.
volume_size (int): Size in GB of the EBS volume to use for
storing input data during training (default: 30). Must be large
enough to store training data if File Mode is used (which is the
default).
volume_size (int): Size in GB of the storage volume to use for
storing input and output data during training (default: 30).

Must be large enough to store training data if File mode is
used, which is the default mode.

When you use an ML instance with the EBS-only storage option
such as ``ml.c5`` and ``ml.p2``,
you must define the size of the EBS
volume through the ``volume_size`` parameter in the estimator class.

.. note::

When you use an ML instance with `NVMe SSD volumes
<https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ssd-instance-store.html#nvme-ssd-volumes>`_
such as ``ml.p4d``, ``ml.g4dn``, and ``ml.g5``,
do not include this parameter in the estimator configuration.
If you use one of those ML instance types,
SageMaker doesn't provision Amazon EBS General Purpose SSD
(gp2) storage nor take this parameter to adjust the NVMe instance storage.
Available storage is fixed to the NVMe instance storage
capacity. SageMaker configures storage paths for training
datasets, checkpoints, model artifacts, and outputs to use the
entire capacity of the instance storage.

Note that if you include this parameter and specify a number that
exceeds the size of the NVMe volume attached to the instance type,
SageMaker returns an ``Invalid VolumeSizeInGB`` error.

To look up instance types and their instance storage types
and volumes, see `Amazon EC2 Instance Types
<http://aws.amazon.com/ec2/instance-types/>`_.

To find the default local paths defined by the SageMaker
training platform, see `Amazon SageMaker Training Storage
Folders for Training Datasets, Checkpoints, Model Artifacts,
and Outputs
<https://docs.aws.amazon.com/sagemaker/latest/dg/model-train-storage.html>`_.
volume_kms_key (str): Optional. KMS key ID for encrypting EBS
volume attached to the training instance (default: None).
max_run (int): Timeout in seconds for training (default: 24 *
Expand Down