sagemaker-python-sdk icon indicating copy to clipboard operation
sagemaker-python-sdk copied to clipboard

PyTorch Estimator `max_run` parameter not working at all

Open yiphei opened this issue 2 years ago • 2 comments

Describe the bug I tried to use the max_run parameter of sagemaker.pytorch.estimator.PyTorch to define the max run time in seconds, but it doesnt work. See the attached screenshot for an example. In the screenshot, I set max_run to be 603 seconds. But it didnt stop at 603, evidenced by the training time at 841s (at which I manually terminated the run) Screenshot 2024-02-23 at 6 47 13 PM

To reproduce Just set max_run of sagemaker.pytorch.estimator.PyTorch to be any integer value

Expected behavior I expect the sagemaker training run to terminate when it has elapsed the seconds set in max_run

Screenshots or logs See screenshot in description

System information A description of your system. Please provide:

  • SageMaker Python SDK version: 2.207.1
  • Framework name (eg. PyTorch) or algorithm (eg. KMeans): Pytorch
  • Framework version: 2.2.0
  • Python version: 3.10.1
  • CPU or GPU: CPU locally, and GPU instance on Sagemaker
  • Custom Docker image (Y/N): N

Additional context NA

yiphei avatar Feb 24 '24 02:02 yiphei

+1 Can anybody explain how this works?

sarseniy avatar Oct 04 '24 14:10 sarseniy

Hi @yiphei

Great news! This issue has been resolved with the release of SageMaker Python SDK v3.

How to Get the Latest Version

You can upgrade to the latest v3 package using pip:

pip install --upgrade sagemaker

##Or specify the version explicitly:
pip install sagemaker>=3.0.0

Additional Resources:

 PyPI: https://pypi.org/project/sagemaker/  Documentation: https://sagemaker.readthedocs.io/

If you're still experiencing this issue after upgrading, please feel free to reopen this issue or create a new one with updated details.

mollyheamazon avatar Feb 03 '26 07:02 mollyheamazon