generated from amazon-archives/__template_MIT-0
-
Notifications
You must be signed in to change notification settings - Fork 2
fix: small fixes & docs sagemaker studio #4
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
Open
malte-aws
wants to merge
3
commits into
main
Choose a base branch
from
fix-sagemaker-studio-docker-access
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,10 +65,7 @@ | |
| " get_sagemaker_distribution, \n", | ||
| " SageMakerDistribution, \n", | ||
| " get_python_version, \n", | ||
| " get_aws_account_id_for_region,\n", | ||
| " is_docker_installed,\n", | ||
| " is_docker_compose_installed,\n", | ||
| " check_and_enable_docker_access_sagemaker_studio\n", | ||
| " get_aws_account_id_for_region\n", | ||
| ")" | ||
| ] | ||
| }, | ||
|
|
@@ -389,6 +386,30 @@ | |
| "sagemaker_dist_uri = f\"{sagemaker_distr_account_id}.dkr.ecr.{region}.amazonaws.com/sagemaker-distribution-prod:{sm_distro_version.image_version}-gpu\"" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "id": "04305c64-7ae5-4ffc-be2f-fe0e6e1a398b", | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "instance_type = \"ml.g6e.xlarge\"" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "id": "d0bb0ade-103c-4746-bd48-524a0fe54de5", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "<div style=\"border: 2px solid #006CE0; \n", | ||
| " padding: 10px; \n", | ||
| " border-radius: 5px; \n", | ||
| " max-width: 100%;\n", | ||
| " background: #f0fbff;\">\n", | ||
| " <b>Note:</b> If you run into out of memory errors during inference use a larger instance type. For example if you have trained a larger model. \n", | ||
| "</div>" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "id": "202dfb1b-322c-470d-9191-29490a7ffee6", | ||
|
|
@@ -521,7 +542,7 @@ | |
| " # RoleArn: <replace the role arn here>\n", | ||
| " S3RootUri: {s3_root_uri}\n", | ||
| " ImageUri: {sagemaker_dist_uri} \n", | ||
| " InstanceType: ml.g6e.4xlarge\n", | ||
| " InstanceType: ml.g6e.4xlarge # default instance type to use\n", | ||
| " Dependencies: requirements.txt\n", | ||
| " IncludeLocalWorkDir: true\n", | ||
| " PreExecutionCommands:\n", | ||
|
|
@@ -610,6 +631,22 @@ | |
| "## Batch Inference Function" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "id": "e9050ae0-98eb-48c9-8d76-320a5b4ee86d", | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "inference_kwargs = {\n", | ||
| " \"model_id\":model_config.model_id,\n", | ||
| " \"model_type\":model_config.model_type,\n", | ||
| " \"dataset_s3\":dataset_s3_uri,\n", | ||
| " \"test_data_path\":\"conversations_test_swift_format.json\",\n", | ||
| " \"guided_decoding\":guided_decoding\n", | ||
| "}" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
|
|
@@ -618,11 +655,11 @@ | |
| "outputs": [], | ||
| "source": [ | ||
| "@remote(\n", | ||
| " instance_type=\"ml.g6e.xlarge\", # Powerful GPU for fast inference\n", | ||
| " instance_type=instance_type, # Powerful GPU for fast inference\n", | ||
| " instance_count=1, # Single instance for cost efficiency\n", | ||
| " volume_size=200, # Large volume for model and data storage\n", | ||
| " job_name_prefix=job_name_prefix,\n", | ||
| " # use_spot_instances=True, # Cost efficient inference. Inference can be restarted if no spot capacity. \n", | ||
| " # use_spot_instances=True, # Enable cost efficient inference. Inference can be restarted if no spot capacity. \n", | ||
|
Comment on lines
-625
to
+662
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not a problem, but I wonder if there was a particular reason we have spot enabled by default in training but disabled by default in inference? |
||
| " max_wait_time_in_seconds=172800, # 48 hours max wait\n", | ||
| " max_runtime_in_seconds=172800, # 48 hours max runtime\n", | ||
| ")\n", | ||
|
|
@@ -710,28 +747,12 @@ | |
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "id": "6eb0b491-7f9f-4b83-98d1-daedabe3f311", | ||
| "id": "259ae020-c35d-4470-95ce-0043a1b61893", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "## Run Batch Inference" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "id": "e9050ae0-98eb-48c9-8d76-320a5b4ee86d", | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "inference_kwargs = {\n", | ||
| " \"model_id\":model_config.model_id,\n", | ||
| " \"model_type\":model_config.model_type,\n", | ||
| " \"dataset_s3\":dataset_s3_uri,\n", | ||
| " \"test_data_path\":\"conversations_test_swift_format.json\",\n", | ||
| " \"guided_decoding\":guided_decoding\n", | ||
| "}" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wanted to check, this is an intentional change to the default behaviour - not an accidental check-in, right?