Skip to content

Commit 7a8ad4a

Browse files
authored
Merge branch 'master' into add_tf214_graviton
2 parents 9006e1c + 992787d commit 7a8ad4a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+2439
-397
lines changed

.github/workflows/codebuild-ci-health.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,4 @@ jobs:
8181
- name: Run Local Mode Tests
8282
uses: aws-actions/aws-codebuild-run-build@v1
8383
with:
84-
project-name: sagemaker-python-sdk-ci-health-localmode-tests
85-
notebook-tests:
86-
runs-on: ubuntu-latest
87-
steps:
88-
- name: Configure AWS Credentials
89-
uses: aws-actions/configure-aws-credentials@v4
90-
with:
91-
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
92-
aws-region: us-west-2
93-
role-duration-seconds: 10800
94-
- name: Run Notebook Tests
95-
uses: aws-actions/aws-codebuild-run-build@v1
96-
with:
97-
project-name: sagemaker-python-sdk-ci-health-notebook-tests
84+
project-name: sagemaker-python-sdk-ci-health-localmode-tests

.github/workflows/codebuild-ci.yml

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: PR Checks
22
on:
33
pull_request_target:
4+
branches:
5+
- "master*"
46

57
concurrency:
68
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.head_ref }}
@@ -10,9 +12,39 @@ permissions:
1012
id-token: write # This is required for requesting the JWT
1113

1214
jobs:
13-
codestyle-doc-tests:
15+
collab-check:
16+
runs-on: ubuntu-latest
17+
outputs:
18+
approval-env: ${{ steps.collab-check.outputs.result }}
19+
steps:
20+
- name: Collaborator Check
21+
uses: actions/github-script@v7
22+
id: collab-check
23+
with:
24+
result-encoding: string
25+
script: |
26+
try {
27+
const res = await github.rest.repos.checkCollaborator({
28+
owner: context.repo.owner,
29+
repo: context.repo.repo,
30+
username: "${{ github.event.pull_request.user.login }}",
31+
});
32+
console.log("Verifed ${{ github.event.pull_request.user.login }} is a repo collaborator. Auto Approving PR Checks.")
33+
return res.status == "204" ? "auto-approve" : "manual-approval"
34+
} catch (error) {
35+
console.log("${{ github.event.pull_request.user.login }} is not a collaborator. Requiring Manual Approval to run PR Checks.")
36+
return "manual-approval"
37+
}
38+
wait-for-approval:
1439
runs-on: ubuntu-latest
40+
needs: [collab-check]
41+
environment: ${{ needs.collab-check.outputs.approval-env }}
1542
steps:
43+
- run: echo "Workflow Approved! Starting PR Checks."
44+
codestyle-doc-tests:
45+
runs-on: ubuntu-latest
46+
needs: [wait-for-approval]
47+
steps:
1648
- name: Configure AWS Credentials
1749
uses: aws-actions/configure-aws-credentials@v4
1850
with:
@@ -23,9 +55,10 @@ jobs:
2355
uses: aws-actions/aws-codebuild-run-build@v1
2456
with:
2557
project-name: sagemaker-python-sdk-ci-codestyle-doc-tests
26-
source-version-override: 'pr/${{ github.event.pull_request.number }}'
58+
source-version-override: 'refs/pull/${{ github.event.pull_request.number }}/head^{${{ github.event.pull_request.head.sha }}}'
2759
unit-tests:
2860
runs-on: ubuntu-latest
61+
needs: [wait-for-approval]
2962
strategy:
3063
fail-fast: false
3164
matrix:
@@ -41,8 +74,23 @@ jobs:
4174
uses: aws-actions/aws-codebuild-run-build@v1
4275
with:
4376
project-name: sagemaker-python-sdk-ci-unit-tests
44-
source-version-override: 'pr/${{ github.event.pull_request.number }}'
77+
source-version-override: 'refs/pull/${{ github.event.pull_request.number }}/head^{${{ github.event.pull_request.head.sha }}}'
4578
env-vars-for-codebuild: |
4679
PY_VERSION
4780
env:
4881
PY_VERSION: ${{ matrix.python-version }}
82+
integ-tests:
83+
runs-on: ubuntu-latest
84+
needs: [wait-for-approval]
85+
steps:
86+
- name: Configure AWS Credentials
87+
uses: aws-actions/configure-aws-credentials@v4
88+
with:
89+
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
90+
aws-region: us-west-2
91+
role-duration-seconds: 10800
92+
- name: Run Integ Tests
93+
uses: aws-actions/aws-codebuild-run-build@v1
94+
with:
95+
project-name: sagemaker-python-sdk-ci-integ-tests
96+
source-version-override: 'refs/pull/${{ github.event.pull_request.number }}/head^{${{ github.event.pull_request.head.sha }}}'

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# Changelog
22

3+
## v2.215.0 (2024-04-12)
4+
5+
### Features
6+
7+
* JumpStart Gated Model Support in ModelBuilder Local Modes
8+
* Changes to support remote schema retrieval for task types (question-answering, fill-mask) and added e2e tests for both local and remote hf schema logic.
9+
* Upgrade smp to version 2.3.0
10+
11+
### Bug Fixes and Other Changes
12+
13+
* disable modelbuilder mlflow local integ tests
14+
* add integ-tests to codebuild-ci.yml
15+
* [Feat] Support MLflow Model Format Through ModelBuilder
16+
* Test SM PySDK Variations
17+
* typo in jumpstart manifest and refine tests
18+
* add kix to launched regions
19+
* Remove space specific business logic from Python SDK function to fetch execution role
20+
* Remove notebook tests from CI health check and the script
21+
22+
## v2.214.3 (2024-04-04)
23+
24+
### Bug Fixes and Other Changes
25+
26+
* [Fix] Switch to subprocess in ModelBuilder when capturing dependencies
27+
* chore: skip flaky test
28+
329
## v2.214.2 (2024-04-01)
430

531
### Bug Fixes and Other Changes

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.214.3.dev0
1+
2.215.1.dev0
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
accelerate>=0.24.1,<=0.27.0
2+
sagemaker_schema_inference_artifacts>=0.0.5

src/sagemaker/fw_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@
142142
"2.1.0",
143143
"2.1.2",
144144
"2.2.0",
145+
"2.3.0",
145146
],
146147
}
147148

@@ -168,6 +169,7 @@
168169
"2.1.0",
169170
"2.1.2",
170171
"2.2.0",
172+
"2.3.0",
171173
]
172174

173175
TRAINIUM_SUPPORTED_DISTRIBUTION_STRATEGIES = ["torch_distributed"]

src/sagemaker/image_uri_config/huggingface-llm.json

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"1.1": "1.1.0",
1212
"1.2": "1.2.0",
1313
"1.3": "1.3.3",
14-
"1.4": "1.4.2"
14+
"1.4": "1.4.5"
1515
},
1616
"versions": {
1717
"0.6.0": {
@@ -483,6 +483,53 @@
483483
"container_version": {
484484
"gpu": "cu121-ubuntu22.04"
485485
}
486+
},
487+
"1.4.5": {
488+
"py_versions": [
489+
"py310"
490+
],
491+
"registries": {
492+
"af-south-1": "626614931356",
493+
"il-central-1": "780543022126",
494+
"ap-east-1": "871362719292",
495+
"ap-northeast-1": "763104351884",
496+
"ap-northeast-2": "763104351884",
497+
"ap-northeast-3": "364406365360",
498+
"ap-south-1": "763104351884",
499+
"ap-south-2": "772153158452",
500+
"ap-southeast-1": "763104351884",
501+
"ap-southeast-2": "763104351884",
502+
"ap-southeast-3": "907027046896",
503+
"ap-southeast-4": "457447274322",
504+
"ca-central-1": "763104351884",
505+
"cn-north-1": "727897471807",
506+
"cn-northwest-1": "727897471807",
507+
"eu-central-1": "763104351884",
508+
"eu-central-2": "380420809688",
509+
"eu-north-1": "763104351884",
510+
"eu-west-1": "763104351884",
511+
"eu-west-2": "763104351884",
512+
"eu-west-3": "763104351884",
513+
"eu-south-1": "692866216735",
514+
"eu-south-2": "503227376785",
515+
"me-south-1": "217643126080",
516+
"me-central-1": "914824155844",
517+
"sa-east-1": "763104351884",
518+
"us-east-1": "763104351884",
519+
"us-east-2": "763104351884",
520+
"us-gov-east-1": "446045086412",
521+
"us-gov-west-1": "442386744353",
522+
"us-iso-east-1": "886529160074",
523+
"us-isob-east-1": "094389454867",
524+
"us-west-1": "763104351884",
525+
"us-west-2": "763104351884",
526+
"ca-west-1": "204538143572"
527+
},
528+
"tag_prefix": "2.1.1-tgi1.4.5",
529+
"repository": "huggingface-pytorch-tgi-inference",
530+
"container_version": {
531+
"gpu": "cu121-ubuntu22.04"
532+
}
486533
}
487534
}
488535
}

src/sagemaker/image_uri_config/pytorch-smp.json

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"version_aliases": {
77
"2.0": "2.0.1",
88
"2.1": "2.1.2",
9-
"2.2": "2.2.0"
9+
"2.2": "2.3.0",
10+
"2.2.0": "2.3.0"
1011
},
1112
"versions": {
1213
"2.0.1": {
@@ -83,6 +84,31 @@
8384
"us-west-2": "658645717510"
8485
},
8586
"repository": "smdistributed-modelparallel"
87+
},
88+
"2.3.0": {
89+
"py_versions": [
90+
"py310"
91+
],
92+
"registries": {
93+
"ap-northeast-1": "658645717510",
94+
"ap-northeast-2": "658645717510",
95+
"ap-northeast-3": "658645717510",
96+
"ap-south-1": "658645717510",
97+
"ap-southeast-1": "658645717510",
98+
"ap-southeast-2": "658645717510",
99+
"ca-central-1": "658645717510",
100+
"eu-central-1": "658645717510",
101+
"eu-north-1": "658645717510",
102+
"eu-west-1": "658645717510",
103+
"eu-west-2": "658645717510",
104+
"eu-west-3": "658645717510",
105+
"sa-east-1": "658645717510",
106+
"us-east-1": "658645717510",
107+
"us-east-2": "658645717510",
108+
"us-west-1": "658645717510",
109+
"us-west-2": "658645717510"
110+
},
111+
"repository": "smdistributed-modelparallel"
86112
}
87113
}
88114
}

src/sagemaker/image_uri_config/pytorch.json

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"1.11": "1.11.0",
8181
"1.12": "1.12.1",
8282
"1.13": "1.13.1",
83-
"2.0": "2.0.1",
83+
"2.0": "2.0.0",
8484
"2.1": "2.1.0"
8585
},
8686
"versions": {
@@ -920,48 +920,6 @@
920920
},
921921
"repository": "pytorch-inference"
922922
},
923-
"2.0.1": {
924-
"py_versions": [
925-
"py310"
926-
],
927-
"registries": {
928-
"af-south-1": "626614931356",
929-
"il-central-1": "780543022126",
930-
"ap-east-1": "871362719292",
931-
"ap-northeast-1": "763104351884",
932-
"ap-northeast-2": "763104351884",
933-
"ap-northeast-3": "364406365360",
934-
"ap-south-1": "763104351884",
935-
"ap-south-2": "772153158452",
936-
"ap-southeast-1": "763104351884",
937-
"ap-southeast-2": "763104351884",
938-
"ap-southeast-3": "907027046896",
939-
"ap-southeast-4": "457447274322",
940-
"ca-central-1": "763104351884",
941-
"cn-north-1": "727897471807",
942-
"cn-northwest-1": "727897471807",
943-
"eu-central-1": "763104351884",
944-
"eu-central-2": "380420809688",
945-
"eu-north-1": "763104351884",
946-
"eu-west-1": "763104351884",
947-
"eu-west-2": "763104351884",
948-
"eu-west-3": "763104351884",
949-
"eu-south-1": "692866216735",
950-
"eu-south-2": "503227376785",
951-
"me-south-1": "217643126080",
952-
"sa-east-1": "763104351884",
953-
"us-east-1": "763104351884",
954-
"us-east-2": "763104351884",
955-
"us-gov-east-1": "446045086412",
956-
"us-gov-west-1": "442386744353",
957-
"us-iso-east-1": "886529160074",
958-
"us-isob-east-1": "094389454867",
959-
"us-west-1": "763104351884",
960-
"us-west-2": "763104351884",
961-
"ca-west-1": "204538143572"
962-
},
963-
"repository": "pytorch-inference"
964-
},
965923
"2.1.0": {
966924
"py_versions": [
967925
"py310"

src/sagemaker/jumpstart/constants.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@
104104
content_bucket="jumpstart-cache-prod-ap-northeast-2",
105105
gated_content_bucket="jumpstart-private-cache-prod-ap-northeast-2",
106106
),
107+
JumpStartLaunchedRegionInfo(
108+
region_name="ap-northeast-3",
109+
content_bucket="jumpstart-cache-prod-ap-northeast-3",
110+
gated_content_bucket="jumpstart-private-cache-prod-ap-northeast-3",
111+
),
107112
JumpStartLaunchedRegionInfo(
108113
region_name="eu-west-2",
109114
content_bucket="jumpstart-cache-prod-eu-west-2",

src/sagemaker/jumpstart/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class JumpStartS3FileType(str, Enum):
105105

106106
OPEN_WEIGHT_MANIFEST = "manifest"
107107
OPEN_WEIGHT_SPECS = "specs"
108-
PROPRIETARY_MANIFEST = "proptietary_manifest"
108+
PROPRIETARY_MANIFEST = "proprietary_manifest"
109109
PROPRIETARY_SPECS = "proprietary_specs"
110110

111111

src/sagemaker/jumpstart/utils.py

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -765,20 +765,6 @@ def validate_model_id_and_get_type(
765765
ValueError: If the script is not supported by JumpStart.
766766
"""
767767

768-
def _get_model_type(
769-
model_id: str,
770-
open_weights_model_ids: Set[str],
771-
proprietary_model_ids: Set[str],
772-
script: enums.JumpStartScriptScope,
773-
) -> Optional[enums.JumpStartModelType]:
774-
if model_id in open_weights_model_ids:
775-
return enums.JumpStartModelType.OPEN_WEIGHTS
776-
if model_id in proprietary_model_ids:
777-
if script == enums.JumpStartScriptScope.INFERENCE:
778-
return enums.JumpStartModelType.PROPRIETARY
779-
raise ValueError(f"Unsupported script for Marketplace models: {script}")
780-
return None
781-
782768
if model_id in {None, ""}:
783769
return None
784770
if not isinstance(model_id, str):
@@ -792,12 +778,19 @@ def _get_model_type(
792778
)
793779
open_weight_model_id_set = {model.model_id for model in models_manifest_list}
794780

781+
if model_id in open_weight_model_id_set:
782+
return enums.JumpStartModelType.OPEN_WEIGHTS
783+
795784
proprietary_manifest_list = accessors.JumpStartModelsAccessor._get_manifest(
796785
region=region, s3_client=s3_client, model_type=enums.JumpStartModelType.PROPRIETARY
797786
)
798787

799788
proprietary_model_id_set = {model.model_id for model in proprietary_manifest_list}
800-
return _get_model_type(model_id, open_weight_model_id_set, proprietary_model_id_set, script)
789+
if model_id in proprietary_model_id_set:
790+
if script == enums.JumpStartScriptScope.INFERENCE:
791+
return enums.JumpStartModelType.PROPRIETARY
792+
raise ValueError(f"Unsupported script for Proprietary models: {script}")
793+
return None
801794

802795

803796
def get_jumpstart_model_id_version_from_resource_arn(

0 commit comments

Comments
 (0)