下面是我正在努力实现的目标的高级图片:我想用spark作为一个计算后端来训练一个后端模型,所有这些都是在SageMaker中使用他们的训练Job。澄清:
现在,我知道了在SM中运行自定义培训的一般方法:以某种方式构建一个容器,然后从ECR中提取它,并通过sagemaker.Estimator API接口启动一个培训作业/超参数调优任务。现在,在本例中,SM将为您处理资源配置,创建一个实例等等。我感到困惑的是,从本质上说,要使用星火计算后端,我需要运行一个EMR集群,所以SDK也必须处理这个问题。但是,我看不出上面的API是如何做到的。
现在,还有一个叫做Sagemaker Pyspark SDK的东西。但是,该包提供的SageMakerEstimator API也不支持即时集群配置.
有没有人知道如何运行一个使用EMR集群的Sagemaker培训作业,以便以后可以将相同的任务用于超参数调优活动?
我看到的一种方法是在后台运行一个EMR集群,然后创建一个常规的SM估计器作业,它将连接到EMR集群并进行培训,本质上是在SM estimator作业中运行一个火花驱动程序。
过去有没有人做过类似的事?
谢谢
发布于 2022-02-25 12:57:03
谢谢你的提问。以下是答案:
- [SageMaker Processing has a built-in Spark Container](https://sagemaker.readthedocs.io/en/stable/amazon_sagemaker_processing.html#pysparkprocessor), which is easy to use but unfortunately not connected to SageMaker Model Tuning (that works with Training only). If you use this, you will have to find and use a third-party, external parameter search library ; for example [Syne Tune](https://aws.amazon.com/blogs/machine-learning/run-distributed-hyperparameter-and-neural-architecture-tuning-jobs-with-syne-tune/) from AWS itself (that supports bayesian optimization)- SageMaker Training can run custom docker-based jobs, on one or multiple machines. If you can fit your Spark code within SageMaker Training spec, then you will be able to use SageMaker Model Tuning to tune your Spark code. However there is no framework container for Spark on SageMaker Training, so you would have to build your own, and I am not aware of any examples. Maybe you could get inspiration from the [Processing container code here](https://github.com/aws/sagemaker-spark-container) to build a custom Training container您使用培训作业作为客户端启动EMR集群的想法很好,并且应该能够工作(如果SM具有正确的权限),并且确实允许您使用SM模型调优。我建议:
本着同样的精神,我曾经使用SageMaker训练自己启动批处理转换作业,其唯一目的是利用贝叶斯搜索API来找到一种最小化成本的推理配置。
https://stackoverflow.com/questions/70835006
复制相似问题