[英]Sagemaker - Distributed training
当未明确指定分布式训练时,我找不到有关 Sagemaker 行为的文档。
具体来说,
from sagemaker.tensorflow import TensorFlow
estimator = TensorFlow(
role=role,
py_version="py37",
framework_version="2.4.1",
# For training with multinode distributed training, set this count. Example: 2
instance_count=4,
instance_type="ml.p3.16xlarge",
sagemaker_session=sagemaker_session,
# Training using SMDataParallel Distributed Training Framework
distribution={"smdistributed": {"dataparallel": {"enabled": True}}},
)
estimator = TensorFlow(
py_version="py3",
entry_point="mnist.py",
role=role,
framework_version="1.12.0",
instance_count=4,
instance_type="ml.m4.xlarge",
)
谢谢!
“我不确定当未指定分布参数但 instance_count > 1 时会发生什么,如下所示” -> SageMaker 将在 4 台机器上运行您的代码。 除非您有专门为分布式计算构建的代码,否则这是无用的(简单复制)。
它在以下情况下变得非常有趣:
ShardedByS3Key
的输入上运行相同的代码,您的代码将在均匀分布在机器上的 S3 数据的不同部分上运行。 这使得 SageMaker Training/Estimators 成为运行任意无共享分布式任务(例如文件转换和批量推理)的好地方。将机器集群在一起还允许您启动开源分布式培训软件,如 PyTorch DDP
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.