Skip to content

How to set the num_gpus? #34

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

Closed
wmlba opened this issue Dec 27, 2017 · 3 comments
Closed

How to set the num_gpus? #34

wmlba opened this issue Dec 27, 2017 · 3 comments

Comments

@wmlba
Copy link

wmlba commented Dec 27, 2017

I am not sure how to set the num_gpus? It's not mentioned anywhere in the docs.

@andremoeller
Copy link
Contributor

Hi @willbadr ,

Thanks for using Amazon SageMaker!

I take it you mean for running MXNet training scripts, right? You don't have to set this since the SageMaker MXNet Container gets this value from the container's environment and injects it into your MXNet script's train() function for you.

Please let us know if this doesn't solve your question. Thanks!

@wmlba
Copy link
Author

wmlba commented Dec 27, 2017 via email

@andremoeller
Copy link
Contributor

andremoeller commented Dec 27, 2017

Hi @willbadr,

You could use the hyperparameters dictionary in your MXNet script's train() function. Since this is just a dict[string,string], you can choose whatever key you'd like and parse the number of GPUs from that entry's value. You can pass in this dictionary to the MXNet predictor's constructor:

class MXNet(Framework):
"""Handle end-to-end training and deployment of custom MXNet code."""
__framework_name__ = "mxnet"
def __init__(self, entry_point, source_dir=None, hyperparameters=None, py_version='py2', **kwargs):

laurenyu pushed a commit to laurenyu/sagemaker-python-sdk that referenced this issue May 31, 2018
apacker pushed a commit to apacker/sagemaker-python-sdk that referenced this issue Nov 15, 2018
Updated: Linear Time Series Forecast Notebook

Pushing to prepare for Monday's meeting.
athewsey added a commit to athewsey/sagemaker-python-sdk that referenced this issue May 28, 2021
Also add an integration test for XGBoost (clearly we needed one!);
add convenience imports for framework processors like Estimators
already have; replace placeholder docstrings.

Fixes verdimrc/aws#34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants