Skip to content

Tune (local mode) support for Jumpstart Models #4532

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

Merged
merged 36 commits into from
Mar 28, 2024

Conversation

makungaj1
Copy link
Contributor

@makungaj1 makungaj1 commented Mar 25, 2024

Issue #, if available:

Description of changes:
Currently, ModelBuilder provides tune capability only for HF models. This PR extends tune capability to JumpStart Models as well.

To leverage this feature, users bring in JumpStart model id, and create model with ModelBuilder.

model_builder = ModelBuilder(
    model=jumpstart_model_id,
    schema_builder=SchemaBuilder(sample_input, sample_output),
    model_path=m_path,
    mode=Mode.LOCAL_CONTAINER
)

model = model_builder.build()

model.tune()

This feature is only for Local_Mode.

Testing done:

  • Unit tests
  • Notebook (InProgress)
  • Integration tests (InProgress)

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 backward 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
  • [x ] I have passed the region in to all S3 and STS clients that I've initialized as part of this change.
  • [ x] 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)
  • [x ] 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.

@makungaj1 makungaj1 requested a review from a team as a code owner March 25, 2024 15:13
@makungaj1 makungaj1 requested review from akrishna1995 and removed request for a team March 25, 2024 15:13
Copy link

codecov bot commented Mar 25, 2024

Codecov Report

Attention: Patch coverage is 62.72727% with 41 lines in your changes are missing coverage. Please review.

Project coverage is 87.44%. Comparing base (cc5d0dc) to head (d7c85e7).

Files Patch % Lines
src/sagemaker/serve/utils/tuning.py 36.36% 21 Missing ⚠️
src/sagemaker/serve/builder/jumpstart_builder.py 71.01% 20 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4532      +/-   ##
==========================================
+ Coverage   87.38%   87.44%   +0.06%     
==========================================
  Files         389      389              
  Lines       36776    36881     +105     
==========================================
+ Hits        32135    32249     +114     
+ Misses       4641     4632       -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mufaddal-rohawala
Copy link
Member

AWS CodeBuild CI Report

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

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

@mufaddal-rohawala
Copy link
Member

AWS CodeBuild CI Report

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

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

Refactoring

Refactoring

Refactoring
@mufaddal-rohawala
Copy link
Member

AWS CodeBuild CI Report

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

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

@mufaddal-rohawala
Copy link
Member

AWS CodeBuild CI Report

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

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

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@zhaoqizqwang
Copy link
Contributor

Overriding codecov/patch since coverage is affected by logger.info & logger.warning lines

@zhaoqizqwang zhaoqizqwang self-requested a review March 28, 2024 21:43
@zhaoqizqwang zhaoqizqwang merged commit 951d2c4 into aws:master Mar 28, 2024
malav-shastri pushed a commit to malav-shastri/sagemaker-python-sdk that referenced this pull request Jun 20, 2024
* JumpStart TGI tune support

* TGI does not enable multiple model serving internal to the container

* Tune support for JS model with DJL DLC

* Pretty Print JS TGI Benchmark results

* Pretty Print JS DJL Benchmark results

* Debugging

* Refactoring

* Revert "Refactoring"

This reverts commit 4be1679.

* refactoring

* Revert "Debugging"

This reverts commit 1ec29e3.

* Add Tests

* Refactoring

* Refactoring

* Debugging

* Refactoring and Debugging

* Refactoring

* Refactoring

Refactoring

Refactoring

Refactoring

* Refactoring

* Add unit tests

* Address PR Review Comments

* Sharded is not supported for all model types

* Refactoring

* Refactoring

* Refactoring

* Refactoring

* Refactoring

* Addressed PR Review comments

* Sharding support validation for TGI

* Fix unit tests

* Increase code coverage

---------

Co-authored-by: Jonathan Makunga <[email protected]>
jiapinw pushed a commit to jiapinw/sagemaker-python-sdk that referenced this pull request Jun 25, 2024
* JumpStart TGI tune support

* TGI does not enable multiple model serving internal to the container

* Tune support for JS model with DJL DLC

* Pretty Print JS TGI Benchmark results

* Pretty Print JS DJL Benchmark results

* Debugging

* Refactoring

* Revert "Refactoring"

This reverts commit 4be1679.

* refactoring

* Revert "Debugging"

This reverts commit 1ec29e3.

* Add Tests

* Refactoring

* Refactoring

* Debugging

* Refactoring and Debugging

* Refactoring

* Refactoring

Refactoring

Refactoring

Refactoring

* Refactoring

* Add unit tests

* Address PR Review Comments

* Sharded is not supported for all model types

* Refactoring

* Refactoring

* Refactoring

* Refactoring

* Refactoring

* Addressed PR Review comments

* Sharding support validation for TGI

* Fix unit tests

* Increase code coverage

---------

Co-authored-by: Jonathan Makunga <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants