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

feature: make estimator accept json file as modelparallel config

Open yongyanrao opened this issue 2 years ago • 33 comments

Issue #, if available:

Description of changes: When passing distribution dict to estimator API PyTorch, we can let smp_config be either a dict (current behavior) or a string representing a config file.

            distribution = {
                "smdistributed": {
                    "modelparallel": {
                        "enabled": True,
                        "parameters": smp_config,
                    },
                },
                ...
            }

The config file needs to be a json file. e.g., params.json

{"partitions": 1, "tensor_parallel_degree": 2, "microbatches": 1, "optimize": "speed", "pipeline": "interleaved", "ddp": 1, "auto_partition": false, "default_partition": 0}

Testing done: local unit tests

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

  • [x] I have read the CONTRIBUTING doc
  • [x] I certify that the changes I am introducing will be backword compatible, and I have discussed concerns about this, if any, with the Python SDK team
  • [x] I used the commit message format described in CONTRIBUTING
  • [ ] I have passed the region in to all S3 and STS clients that I've initialized as part of this change.
  • [ ] I have updated any necessary documentation, including READMEs and API docs (if appropriate)

Tests

  • [x] I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • [x] I have added unit and/or integration tests as appropriate to ensure backward compatibility of the changes
  • [x] I have checked that my tests are not configured for a specific region or account (if appropriate)
  • [ ] I have used unique_name_from_base to create resource names in integ tests (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

yongyanrao avatar Jul 26 '22 14:07 yongyanrao

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-slow-tests
  • Commit ID: a74160998675df1fe87dff39f9254e1413686907
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Jul 26 '22 15:07 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: a74160998675df1fe87dff39f9254e1413686907
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Jul 26 '22 15:07 sagemaker-bot

Codecov Report

Merging #3265 (46ee21e) into master (1fa2377) will decrease coverage by 0.01%. The diff coverage is 75.00%.

:exclamation: Current head 46ee21e differs from pull request most recent head 05604ec. Consider uploading reports for the commit 05604ec to get more accurate results

@@            Coverage Diff             @@
##           master    #3265      +/-   ##
==========================================
- Coverage   89.17%   89.15%   -0.02%     
==========================================
  Files         204      204              
  Lines       18979    18922      -57     
==========================================
- Hits        16924    16870      -54     
+ Misses       2055     2052       -3     
Impacted Files Coverage Δ
src/sagemaker/fw_utils.py 90.15% <75.00%> (-0.98%) :arrow_down:
src/sagemaker/training_compiler/config.py 82.05% <0.00%> (-1.29%) :arrow_down:
src/sagemaker/huggingface/estimator.py 93.18% <0.00%> (-1.27%) :arrow_down:
src/sagemaker/model.py 92.87% <0.00%> (-0.25%) :arrow_down:
src/sagemaker/estimator.py 89.41% <0.00%> (-0.10%) :arrow_down:
src/sagemaker/workflow/clarify_check_step.py 96.87% <0.00%> (-0.04%) :arrow_down:
src/sagemaker/clarify.py 95.65% <0.00%> (-0.03%) :arrow_down:
src/sagemaker/workflow/quality_check_step.py 99.20% <0.00%> (-0.02%) :arrow_down:
src/sagemaker/inputs.py 100.00% <0.00%> (ø)
src/sagemaker/network.py 100.00% <0.00%> (ø)
... and 27 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov-commenter avatar Jul 26 '22 15:07 codecov-commenter

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-pr
  • Commit ID: a74160998675df1fe87dff39f9254e1413686907
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Jul 26 '22 15:07 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-local-mode-tests
  • Commit ID: a74160998675df1fe87dff39f9254e1413686907
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Jul 26 '22 15:07 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-notebook-tests
  • Commit ID: a74160998675df1fe87dff39f9254e1413686907
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Jul 26 '22 16:07 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: c1210859423355b505bba2393510f95df2f1e0fd
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Aug 02 '22 02:08 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-pr
  • Commit ID: c1210859423355b505bba2393510f95df2f1e0fd
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Aug 02 '22 02:08 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-local-mode-tests
  • Commit ID: c1210859423355b505bba2393510f95df2f1e0fd
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Aug 02 '22 02:08 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-slow-tests
  • Commit ID: c1210859423355b505bba2393510f95df2f1e0fd
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Aug 02 '22 03:08 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-notebook-tests
  • Commit ID: c1210859423355b505bba2393510f95df2f1e0fd
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Aug 02 '22 03:08 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: 9d575ab63f632baa699f3c34eb193f7969b8d096
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Aug 02 '22 05:08 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-pr
  • Commit ID: 9d575ab63f632baa699f3c34eb193f7969b8d096
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Aug 02 '22 05:08 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-local-mode-tests
  • Commit ID: 9d575ab63f632baa699f3c34eb193f7969b8d096
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Aug 02 '22 05:08 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-notebook-tests
  • Commit ID: 9d575ab63f632baa699f3c34eb193f7969b8d096
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Aug 02 '22 06:08 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-slow-tests
  • Commit ID: 9d575ab63f632baa699f3c34eb193f7969b8d096
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Aug 02 '22 07:08 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: a42bfbdb8381c5c13415c8bffbfdfa6e8a6e94fb
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Aug 02 '22 21:08 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-pr
  • Commit ID: a42bfbdb8381c5c13415c8bffbfdfa6e8a6e94fb
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Aug 02 '22 22:08 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-local-mode-tests
  • Commit ID: a42bfbdb8381c5c13415c8bffbfdfa6e8a6e94fb
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Aug 02 '22 22:08 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-slow-tests
  • Commit ID: a42bfbdb8381c5c13415c8bffbfdfa6e8a6e94fb
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Aug 02 '22 22:08 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-notebook-tests
  • Commit ID: a42bfbdb8381c5c13415c8bffbfdfa6e8a6e94fb
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Aug 02 '22 22:08 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: 046ee19eb844b1a271222c22c66b519b50c7b2a6
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Aug 04 '22 17:08 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-pr
  • Commit ID: 046ee19eb844b1a271222c22c66b519b50c7b2a6
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Aug 04 '22 17:08 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-local-mode-tests
  • Commit ID: 046ee19eb844b1a271222c22c66b519b50c7b2a6
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Aug 04 '22 17:08 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-notebook-tests
  • Commit ID: 046ee19eb844b1a271222c22c66b519b50c7b2a6
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Aug 04 '22 17:08 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-slow-tests
  • Commit ID: 046ee19eb844b1a271222c22c66b519b50c7b2a6
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Aug 04 '22 19:08 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-slow-tests
  • Commit ID: 046ee19eb844b1a271222c22c66b519b50c7b2a6
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Aug 05 '22 20:08 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-notebook-tests
  • Commit ID: 046ee19eb844b1a271222c22c66b519b50c7b2a6
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Aug 05 '22 20:08 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: 46ee21e68890d6c716b61d876617595ed6d5703f
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Aug 18 '22 07:08 sagemaker-bot

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-local-mode-tests
  • Commit ID: 46ee21e68890d6c716b61d876617595ed6d5703f
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

sagemaker-bot avatar Aug 18 '22 07:08 sagemaker-bot