Skip to content
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

feat: add studio manifest to curated hub class #4527

Open
wants to merge 52 commits into
base: master-jumpstart-curated-hub
Choose a base branch
from

Conversation

dewan-c
Copy link
Collaborator

@dewan-c dewan-c commented Mar 22, 2024

Issue #, if available:

Description of changes:
Building on top of this commit to add studio manifest to curated hub class #4522

Testing done:

  • Unit test
  • Custom script. Getting validation error unrelated to this work.

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.
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have added unit and/or integration tests as appropriate to ensure backward compatibility of the changes
  • 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.

jinyoung-lim and others added 30 commits March 8, 2024 17:35
evakravi and others added 17 commits March 21, 2024 14:04
* feat: instance specific jumpstart host requirements

* chore: add js support for copies resource requirement, enforce coupling with ResourceRequirements class

* fix: typing

* fix: pylint
* feat: add proprietary manifest/specs parsing

add unittests for test_cache

small refactoring

address comments and more unittests

fix linting and fix more tests

fix: pylint

feat: JumpStartModel class for prop models

* remove unused imports and fix docstyle

* fix: remove unused args

* fix: remove unused args

* fix: more unused vars

* fix: slow tests

* fix: unittests

* added more tests to cover some lines

* remove estimator warn check

* chore: address comments re performance

* fix: address comments

* complete list experience and other fixes

* fix: pylint

* add doc utils and fix pylint

* fix: docstyle

* fix: doc

* fix: default payloads

* fix: doc and tags and enums

* fix: jumpstart doc

* rename to open_weights and fix filtering

* update filter name

* doc update

* fix: black

* rename to proprietary model and fix unittests

* address comments

* fix: docstyle and flake8

* address more comments and fix doc

* put back doc utils for future refactoring

* add prop model title in doc

* doc update

---------

Co-authored-by: liujiaor <128006184+liujiaorr@users.noreply.github.com>
* first pass at sync function with util classes

* adding tests and update clases

* linting

* file generator class inheritance

* lint

* multipart copy and algorithm updates

* modularize sync

* reformatting folders

* testing for sync

* do not tolerate vulnerable

* remove prints

* handle multithreading progress bar

* update tests

* optimize function and add hub bucket prefix

* docstrings and linting
@dewan-c dewan-c requested a review from a team as a code owner March 22, 2024 21:19
@dewan-c dewan-c requested review from benieric and removed request for a team March 22, 2024 21:19
response = self._s3_client.get_object(
Bucket=utils.get_jumpstart_content_bucket(self.region), Key=key
)
return json.loads(response["Body"].read().decode("utf-8"))

def _find_entry_in_studio_manifest(self, studio_manifest: List[Dict[str,Any]], model_id: str) -> Dict[str,Any]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we create a mapping b/w model id and manifest entry? so we don't have to iterate each time?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, will update.

Copy link

codecov bot commented Mar 22, 2024

Codecov Report

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

❗ No coverage uploaded for pull request base (master-jumpstart-curated-hub@74bbb09). Click here to learn what that means.

Files Patch % Lines
src/sagemaker/jumpstart/types.py 56.49% 241 Missing ⚠️
src/sagemaker/jumpstart/converter_utils.py 61.11% 21 Missing ⚠️
src/sagemaker/jumpstart/curated_hub/curated_hub.py 54.16% 11 Missing ⚠️
src/sagemaker/jumpstart/cache.py 28.57% 10 Missing ⚠️
src/sagemaker/jumpstart/enums.py 92.30% 1 Missing ⚠️
Additional details and impacted files
@@                       Coverage Diff                       @@
##             master-jumpstart-curated-hub    #4527   +/-   ##
===============================================================
  Coverage                                ?   86.68%           
===============================================================
  Files                                   ?      398           
  Lines                                   ?    37788           
  Branches                                ?        0           
===============================================================
  Hits                                    ?    32755           
  Misses                                  ?     5033           
  Partials                                ?        0           

☔ 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: b8d13b0
  • Result: FAILED
  • Build Logs (available for 30 days)

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

@@ -1917,6 +1917,12 @@ def from_manifest(self, studio_manifest_entry: Dict[str, Any]):
self.datatype = studio_manifest_entry["dataType"]
if studio_manifest_entry.get("license"):
self.license = studio_manifest_entry["license"]
task_pattern = r"\| Task: \| (.+?)\|"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be a constant, not a local variable

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: i would prefer to move the regex to _extract_task_value

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, updated

@mufaddal-rohawala
Copy link
Member

AWS CodeBuild CI Report

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

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

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.

None yet

6 participants