fix: fix PyTorchModel deployment crash on Windows - #1212

Merged
laurenyu merged 1 commit into
aws:masterfrom
Serhiy-Shekhovtsov:patch-3
Jan 7, 2020
Merged

fix: fix PyTorchModel deployment crash on Windows#1212
laurenyu merged 1 commit into
aws:masterfrom
Serhiy-Shekhovtsov:patch-3

Conversation

@Serhiy-Shekhovtsov

Copy link
Copy Markdown
Contributor

Starting from version 1.2 deployment of PyTorchModel always initiates repacking when uploading the code. It is done by calling _upload_code with repack=True parameter.

On Windows, this will lead to a crash, because os.path.join method used to generate repacked_model_uri will use backslashes instead of slashes. So utils.repack_model will fail to parse it.

Description of changes:
Replaced os.path.join(bucket, key_prefix, "model.tar.gz") with '/'.join(...) for creating repacked_model_uri.

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.

  • I have read the CONTRIBUTING doc
  • I used the commit message format described in CONTRIBUTING
  • I have used the regional endpoint when creating S3 and/or STS clients (if appropriate)
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

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

Starting from version `1.2` deployment of PyTorchModel always initiates repacking when uploading the code. It is done by calling `_upload_code` with `repack=True` parameter. On Windows, this will lead to a crash, because `os.path.join` method used to generate `repacked_model_uri` will use backslashes instead of slashes. So `utils.repack_model` will fail to parse it.
@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@laurenyulaurenyu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks for the contribution!

@laurenyu
laurenyu merged commit 2e81f95 into aws:masterJan 7, 2020
knikure added a commit to knikure/sagemaker-python-sdk that referenced this pull request Oct 26, 2023
…- Galactus (aws#1212)
Co-authored-by: Gary Wang <garywan@amazon.com>
Co-authored-by: Gary Wang <38331932+gwang111@users.noreply.github.com>
Co-authored-by: Raymond Liu <tzujui@amazon.com>
Co-authored-by: John Barboza <johnbarb@amazon.com>
Co-authored-by: Malav Shastri <malavhs@amazon.com>
Co-authored-by: Mufaddal Rohawala <89424143+mufaddal-rohawala@users.noreply.github.com>
Co-authored-by: Mike Schneider <104035434+xncqr@users.noreply.github.com>
Co-authored-by: Bhupendra Singh <bsinghtt@amazon.com>
Co-authored-by: ci <ci>
Co-authored-by: Malav Shastri <57682969+malav-shastri@users.noreply.github.com>
Co-authored-by: Keshav Chandak <chakesh@amazon.com>
Co-authored-by: Zuoyuan Huang <david.hzy97@gmail.com>
Co-authored-by: evakravi <69981223+evakravi@users.noreply.github.com>
Co-authored-by: Keshav Chandak <keshav.chandak1995@gmail.com>
Co-authored-by: Alexander Pivovarov <apivovarov@gmail.com>
Co-authored-by: SSRraymond <105880250+SSRraymond@users.noreply.github.com>
Co-authored-by: Ruilian Gao <ruiliann@amazon.com>
Co-authored-by: Ao Guo <aoguo@amazon.com>
Co-authored-by: qidewenwhen <32910701+qidewenwhen@users.noreply.github.com>
Co-authored-by: mariumof <99500633+mariumof@users.noreply.github.com>
Co-authored-by: matherit <97054789+matherit@users.noreply.github.com>
Co-authored-by: amzn-choeric <105388439+amzn-choeric@users.noreply.github.com>
Co-authored-by: Ao Guo <72373287+aoguo64@users.noreply.github.com>
Co-authored-by: Sally Seok <sallyseo@amazon.com>
Co-authored-by: Erick Benitez-Ramos <141277478+benieric@users.noreply.github.com>
Co-authored-by: Qingzi-Lan <83724147+Qingzi-Lan@users.noreply.github.com>
Co-authored-by: Sally Seok <49303563+sallyseok@users.noreply.github.com>
Co-authored-by: Manu Seth <22492939+mseth10@users.noreply.github.com>
Co-authored-by: Miyoung <myoung8739@gmail.com>
Co-authored-by: Sarah Castillo <67715639+secastillo@users.noreply.github.com>
Co-authored-by: EC2 Default User <ec2-user@ip-172-16-36-195.us-west-2.compute.internal>
Co-authored-by: EC2 Default User <ec2-user@ip-172-16-59-135.us-west-2.compute.internal>
Co-authored-by: EC2 Default User <ec2-user@ip-172-16-54-104.us-west-2.compute.internal>
Co-authored-by: Xin Wang <xwnamz@amazon.com>
Co-authored-by: stacicho <stacicho@amazon.com>
Co-authored-by: martinRenou <martin.renou@gmail.com>
Co-authored-by: jiapinw <jiapinw@amazon.com>
Co-authored-by: Akash Goel <goelakash93@gmail.com>
Co-authored-by: Joseph Zhang <cjz@amazon.com>
Co-authored-by: Harsha Reddy <116772862+sthodimi@users.noreply.github.com>
Co-authored-by: Haixin Wang <98612668+haixiw@users.noreply.github.com>
Co-authored-by: Kalyani Nikure <110067132+knikure@users.noreply.github.com>
Co-authored-by: Xin Wang <mr.xin.wang@gmail.com>
Co-authored-by: Gili Nachum <gilinachum@gmail.com>
Co-authored-by: Jose Pena <josejuan-98@hotmail.com>
Co-authored-by: cansun <80425164+can-sun@users.noreply.github.com>
Co-authored-by: AWS-pratab <110930005+AWS-pratab@users.noreply.github.com>
Co-authored-by: shenlongtang <127143389+shenlongtang@users.noreply.github.com>
Co-authored-by: Zach Kimberg <zachary@kimberg.com>
Co-authored-by: chrivtho-github <106935070+chrivtho-github@users.noreply.github.com>
Co-authored-by: Justin <justinm088@hotmail.com>
Co-authored-by: Duc Trung Le <leductrungxf@gmail.com>
Co-authored-by: HappyAmazonian <91216626+HappyAmazonian@users.noreply.github.com>
Co-authored-by: cj-zhang <32367995+cj-zhang@users.noreply.github.com>
Co-authored-by: Matthew <117945769+mwfongAWS@users.noreply.github.com>
Co-authored-by: Zach Kimberg <kimbergz@amazon.com>
Co-authored-by: Rohith Nadimpally <rnadimp@amazon.com>
Co-authored-by: rohithn1 <35045363+rohithn1@users.noreply.github.com>
Co-authored-by: Victor Zhu <victorvctr.zh@gmail.com>
Co-authored-by: jbarz1 <64875874+jbarz1@users.noreply.github.com>
Co-authored-by: Mohan Gandhi <mohgan@amazon.com>
Co-authored-by: Mohan Gandhi <mohan.sudhan@gmail.com>
Co-authored-by: Barboza <johnbarb@88665a270f35.ant.amazon.com>
Co-authored-by: ruiliann666 <141953824+ruiliann666@users.noreply.github.com>
fixes (aws#963)
fix: skip tensorflow local mode notebook test (aws#4060)
Fix TorchTensorSer/Deser (aws#969)
fix (aws#971)
fix local container mode (aws#972)
Fix auto detect (aws#979)
Fix routing fn (aws#981)
fix: tags for jumpstart model package models (aws#4061)
fix: pipeline variable kms key (aws#4065)
fix: jumpstart cache using sagemaker session s3 client (aws#4051)
fix: gated models unsupported region (aws#4069)
fix local container serialization (aws#989)
fix custom serialiazation with local container. Also remove a lot of unused code (aws#994)
Fix custom serialization for local container mode (aws#1000)
fix pytorch version (aws#1001)
Fix unit test (aws#990)
Fix unit tests (aws#1018)
Fix happy hf test (aws#1026)
fix logic setup (aws#1034)
fixes (aws#1045)
Fix flake error in init (aws#1050)
fix (aws#1053)
fix: pipeline upsert failed to pass parallelism_config to update (aws#4066)
fix: temporarily skip kmeans notebook (aws#4092)
fixes (aws#1051)
Fix missing absolute import error (aws#1057)
Fix flake8 error in unit test (aws#1058)
fixes (aws#1056)
Fix flake8 error in integ test (aws#1060)
Fix black format error in test_pickle_dependencies (aws#1062)
Fix docstyle error under serve (aws#1065)
Fix docstyle error in builder failure (aws#1066)
fix black and flake8 formatting (aws#1069)
Fix format error (aws#1070)
Fix integ test (aws#1074)
fix: HuggingFaceProcessor parameterized instance_type when image_uri is absent (aws#4072)
fix: log message when sdk defaults not applied (aws#4104)
fix: handle bad jumpstart default session (aws#4109)
Fix the version information, whl and flake8 (aws#1085)
Fix JSON serializer error (aws#1088)
Fix unit test (aws#1091)
fix format (aws#1103)
Fix local mode predictor (aws#1107)
Fix DJLPredictor (aws#1108)
Fix modelbuilder unit tests (aws#1118)
fixes (aws#1136)
fixes (aws#1165)
fixes (aws#1166)
fix: auto ml integ tests and add flaky test markers (aws#4136)
fix model data for JumpStartModel (aws#4135)
fix: transform step unit test (aws#4151)
fix: Update pipeline.py and selective_execution_config.py with small fixes (aws#1099)
fix: Fixed bug in _create_training_details (aws#4141)
fix: use correct line endings and s3 uris on windows (aws#4118)
fix: js tagging s3 prefix (aws#4167)
fix: Update Ec2 instance type to g5.4xlarge in test_huggingface_torch_distributed.py (aws#4181)
fix: import error in unsupported js regions (aws#4188)
fix: update local mode schema (aws#4185)
fix: fix flaky Inference Recommender integration tests (aws#4156)
fix: clone distribution in validate_distribution (aws#4205)
Fix hyperlinks in feature_processor.scheduler parameter descriptions (aws#4208)
Fix master merge formatting (aws#1186)
Fix master unit tests (aws#1203)
Fix djl unit tests (aws#1204)
Fix merge conflicts (aws#1217)
fix: fix URL links (aws#4217)
fix: bump urllib3 version (aws#4223)
fix: relax upper bound on urllib in local mode requirements (aws#4219)
fixes (aws#1224)
fix formatting (aws#1233)
fix byoc unit tests (aws#1235)
fix byoc unit tests (aws#1236)
Evan-W-ang added a commit to Evan-W-ang/sagemaker-python-sdk that referenced this pull request Jun 8, 2026
Starting from version `1.2` deployment of PyTorchModel always
initiates repacking when uploading the code. It is done by
calling `_upload_code` with `repack=True` parameter.
On Windows, this will lead to a crash, because
`os.path.join` method used to generate `repacked_model_uri` will
use backslashes instead of slashes. So `utils.repack_model` will fail to parse it.
Sign up for freeto 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.

3 participants

@Serhiy-Shekhovtsov@sagemaker-bot@laurenyu
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

fix: fix PyTorchModel deployment crash on Windows - #1212

Merged
laurenyu merged 1 commit into
aws:masterfrom
Serhiy-Shekhovtsov:patch-3
Jan 7, 2020
Merged

fix: fix PyTorchModel deployment crash on Windows#1212
laurenyu merged 1 commit into
aws:masterfrom
Serhiy-Shekhovtsov:patch-3

Conversation

@Serhiy-Shekhovtsov

Copy link
Copy Markdown
Contributor

Starting from version 1.2 deployment of PyTorchModel always initiates repacking when uploading the code. It is done by calling _upload_code with repack=True parameter.

On Windows, this will lead to a crash, because os.path.join method used to generate repacked_model_uri will use backslashes instead of slashes. So utils.repack_model will fail to parse it.

Description of changes:
Replaced os.path.join(bucket, key_prefix, "model.tar.gz") with '/'.join(...) for creating repacked_model_uri.

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.

  • I have read the CONTRIBUTING doc
  • I used the commit message format described in CONTRIBUTING
  • I have used the regional endpoint when creating S3 and/or STS clients (if appropriate)
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

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

Starting from version `1.2` deployment of PyTorchModel always initiates repacking when uploading the code. It is done by calling `_upload_code` with `repack=True` parameter. On Windows, this will lead to a crash, because `os.path.join` method used to generate `repacked_model_uri` will use backslashes instead of slashes. So `utils.repack_model` will fail to parse it.
@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@laurenyulaurenyu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks for the contribution!

@laurenyu
laurenyu merged commit 2e81f95 into aws:masterJan 7, 2020
knikure added a commit to knikure/sagemaker-python-sdk that referenced this pull request Oct 26, 2023
…- Galactus (aws#1212)
Co-authored-by: Gary Wang <garywan@amazon.com>
Co-authored-by: Gary Wang <38331932+gwang111@users.noreply.github.com>
Co-authored-by: Raymond Liu <tzujui@amazon.com>
Co-authored-by: John Barboza <johnbarb@amazon.com>
Co-authored-by: Malav Shastri <malavhs@amazon.com>
Co-authored-by: Mufaddal Rohawala <89424143+mufaddal-rohawala@users.noreply.github.com>
Co-authored-by: Mike Schneider <104035434+xncqr@users.noreply.github.com>
Co-authored-by: Bhupendra Singh <bsinghtt@amazon.com>
Co-authored-by: ci <ci>
Co-authored-by: Malav Shastri <57682969+malav-shastri@users.noreply.github.com>
Co-authored-by: Keshav Chandak <chakesh@amazon.com>
Co-authored-by: Zuoyuan Huang <david.hzy97@gmail.com>
Co-authored-by: evakravi <69981223+evakravi@users.noreply.github.com>
Co-authored-by: Keshav Chandak <keshav.chandak1995@gmail.com>
Co-authored-by: Alexander Pivovarov <apivovarov@gmail.com>
Co-authored-by: SSRraymond <105880250+SSRraymond@users.noreply.github.com>
Co-authored-by: Ruilian Gao <ruiliann@amazon.com>
Co-authored-by: Ao Guo <aoguo@amazon.com>
Co-authored-by: qidewenwhen <32910701+qidewenwhen@users.noreply.github.com>
Co-authored-by: mariumof <99500633+mariumof@users.noreply.github.com>
Co-authored-by: matherit <97054789+matherit@users.noreply.github.com>
Co-authored-by: amzn-choeric <105388439+amzn-choeric@users.noreply.github.com>
Co-authored-by: Ao Guo <72373287+aoguo64@users.noreply.github.com>
Co-authored-by: Sally Seok <sallyseo@amazon.com>
Co-authored-by: Erick Benitez-Ramos <141277478+benieric@users.noreply.github.com>
Co-authored-by: Qingzi-Lan <83724147+Qingzi-Lan@users.noreply.github.com>
Co-authored-by: Sally Seok <49303563+sallyseok@users.noreply.github.com>
Co-authored-by: Manu Seth <22492939+mseth10@users.noreply.github.com>
Co-authored-by: Miyoung <myoung8739@gmail.com>
Co-authored-by: Sarah Castillo <67715639+secastillo@users.noreply.github.com>
Co-authored-by: EC2 Default User <ec2-user@ip-172-16-36-195.us-west-2.compute.internal>
Co-authored-by: EC2 Default User <ec2-user@ip-172-16-59-135.us-west-2.compute.internal>
Co-authored-by: EC2 Default User <ec2-user@ip-172-16-54-104.us-west-2.compute.internal>
Co-authored-by: Xin Wang <xwnamz@amazon.com>
Co-authored-by: stacicho <stacicho@amazon.com>
Co-authored-by: martinRenou <martin.renou@gmail.com>
Co-authored-by: jiapinw <jiapinw@amazon.com>
Co-authored-by: Akash Goel <goelakash93@gmail.com>
Co-authored-by: Joseph Zhang <cjz@amazon.com>
Co-authored-by: Harsha Reddy <116772862+sthodimi@users.noreply.github.com>
Co-authored-by: Haixin Wang <98612668+haixiw@users.noreply.github.com>
Co-authored-by: Kalyani Nikure <110067132+knikure@users.noreply.github.com>
Co-authored-by: Xin Wang <mr.xin.wang@gmail.com>
Co-authored-by: Gili Nachum <gilinachum@gmail.com>
Co-authored-by: Jose Pena <josejuan-98@hotmail.com>
Co-authored-by: cansun <80425164+can-sun@users.noreply.github.com>
Co-authored-by: AWS-pratab <110930005+AWS-pratab@users.noreply.github.com>
Co-authored-by: shenlongtang <127143389+shenlongtang@users.noreply.github.com>
Co-authored-by: Zach Kimberg <zachary@kimberg.com>
Co-authored-by: chrivtho-github <106935070+chrivtho-github@users.noreply.github.com>
Co-authored-by: Justin <justinm088@hotmail.com>
Co-authored-by: Duc Trung Le <leductrungxf@gmail.com>
Co-authored-by: HappyAmazonian <91216626+HappyAmazonian@users.noreply.github.com>
Co-authored-by: cj-zhang <32367995+cj-zhang@users.noreply.github.com>
Co-authored-by: Matthew <117945769+mwfongAWS@users.noreply.github.com>
Co-authored-by: Zach Kimberg <kimbergz@amazon.com>
Co-authored-by: Rohith Nadimpally <rnadimp@amazon.com>
Co-authored-by: rohithn1 <35045363+rohithn1@users.noreply.github.com>
Co-authored-by: Victor Zhu <victorvctr.zh@gmail.com>
Co-authored-by: jbarz1 <64875874+jbarz1@users.noreply.github.com>
Co-authored-by: Mohan Gandhi <mohgan@amazon.com>
Co-authored-by: Mohan Gandhi <mohan.sudhan@gmail.com>
Co-authored-by: Barboza <johnbarb@88665a270f35.ant.amazon.com>
Co-authored-by: ruiliann666 <141953824+ruiliann666@users.noreply.github.com>
fixes (aws#963)
fix: skip tensorflow local mode notebook test (aws#4060)
Fix TorchTensorSer/Deser (aws#969)
fix (aws#971)
fix local container mode (aws#972)
Fix auto detect (aws#979)
Fix routing fn (aws#981)
fix: tags for jumpstart model package models (aws#4061)
fix: pipeline variable kms key (aws#4065)
fix: jumpstart cache using sagemaker session s3 client (aws#4051)
fix: gated models unsupported region (aws#4069)
fix local container serialization (aws#989)
fix custom serialiazation with local container. Also remove a lot of unused code (aws#994)
Fix custom serialization for local container mode (aws#1000)
fix pytorch version (aws#1001)
Fix unit test (aws#990)
Fix unit tests (aws#1018)
Fix happy hf test (aws#1026)
fix logic setup (aws#1034)
fixes (aws#1045)
Fix flake error in init (aws#1050)
fix (aws#1053)
fix: pipeline upsert failed to pass parallelism_config to update (aws#4066)
fix: temporarily skip kmeans notebook (aws#4092)
fixes (aws#1051)
Fix missing absolute import error (aws#1057)
Fix flake8 error in unit test (aws#1058)
fixes (aws#1056)
Fix flake8 error in integ test (aws#1060)
Fix black format error in test_pickle_dependencies (aws#1062)
Fix docstyle error under serve (aws#1065)
Fix docstyle error in builder failure (aws#1066)
fix black and flake8 formatting (aws#1069)
Fix format error (aws#1070)
Fix integ test (aws#1074)
fix: HuggingFaceProcessor parameterized instance_type when image_uri is absent (aws#4072)
fix: log message when sdk defaults not applied (aws#4104)
fix: handle bad jumpstart default session (aws#4109)
Fix the version information, whl and flake8 (aws#1085)
Fix JSON serializer error (aws#1088)
Fix unit test (aws#1091)
fix format (aws#1103)
Fix local mode predictor (aws#1107)
Fix DJLPredictor (aws#1108)
Fix modelbuilder unit tests (aws#1118)
fixes (aws#1136)
fixes (aws#1165)
fixes (aws#1166)
fix: auto ml integ tests and add flaky test markers (aws#4136)
fix model data for JumpStartModel (aws#4135)
fix: transform step unit test (aws#4151)
fix: Update pipeline.py and selective_execution_config.py with small fixes (aws#1099)
fix: Fixed bug in _create_training_details (aws#4141)
fix: use correct line endings and s3 uris on windows (aws#4118)
fix: js tagging s3 prefix (aws#4167)
fix: Update Ec2 instance type to g5.4xlarge in test_huggingface_torch_distributed.py (aws#4181)
fix: import error in unsupported js regions (aws#4188)
fix: update local mode schema (aws#4185)
fix: fix flaky Inference Recommender integration tests (aws#4156)
fix: clone distribution in validate_distribution (aws#4205)
Fix hyperlinks in feature_processor.scheduler parameter descriptions (aws#4208)
Fix master merge formatting (aws#1186)
Fix master unit tests (aws#1203)
Fix djl unit tests (aws#1204)
Fix merge conflicts (aws#1217)
fix: fix URL links (aws#4217)
fix: bump urllib3 version (aws#4223)
fix: relax upper bound on urllib in local mode requirements (aws#4219)
fixes (aws#1224)
fix formatting (aws#1233)
fix byoc unit tests (aws#1235)
fix byoc unit tests (aws#1236)
Evan-W-ang added a commit to Evan-W-ang/sagemaker-python-sdk that referenced this pull request Jun 8, 2026
Starting from version `1.2` deployment of PyTorchModel always
initiates repacking when uploading the code. It is done by
calling `_upload_code` with `repack=True` parameter.
On Windows, this will lead to a crash, because
`os.path.join` method used to generate `repacked_model_uri` will
use backslashes instead of slashes. So `utils.repack_model` will fail to parse it.
Sign up for freeto 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.

3 participants

@Serhiy-Shekhovtsov@sagemaker-bot@laurenyu
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix: fix PyTorchModel deployment crash on Windows - #1212

Merged
laurenyu merged 1 commit into
aws:masterfrom
Serhiy-Shekhovtsov:patch-3
Jan 7, 2020
Merged

fix: fix PyTorchModel deployment crash on Windows#1212
laurenyu merged 1 commit into
aws:masterfrom
Serhiy-Shekhovtsov:patch-3

Conversation

@Serhiy-Shekhovtsov

Copy link
Copy Markdown
Contributor

Starting from version 1.2 deployment of PyTorchModel always initiates repacking when uploading the code. It is done by calling _upload_code with repack=True parameter.

On Windows, this will lead to a crash, because os.path.join method used to generate repacked_model_uri will use backslashes instead of slashes. So utils.repack_model will fail to parse it.

Description of changes:
Replaced os.path.join(bucket, key_prefix, "model.tar.gz") with '/'.join(...) for creating repacked_model_uri.

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.

  • I have read the CONTRIBUTING doc
  • I used the commit message format described in CONTRIBUTING
  • I have used the regional endpoint when creating S3 and/or STS clients (if appropriate)
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

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

Starting from version `1.2` deployment of PyTorchModel always initiates repacking when uploading the code. It is done by calling `_upload_code` with `repack=True` parameter. On Windows, this will lead to a crash, because `os.path.join` method used to generate `repacked_model_uri` will use backslashes instead of slashes. So `utils.repack_model` will fail to parse it.
@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@laurenyulaurenyu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks for the contribution!

@laurenyu
laurenyu merged commit 2e81f95 into aws:masterJan 7, 2020
knikure added a commit to knikure/sagemaker-python-sdk that referenced this pull request Oct 26, 2023
…- Galactus (aws#1212)
Co-authored-by: Gary Wang <garywan@amazon.com>
Co-authored-by: Gary Wang <38331932+gwang111@users.noreply.github.com>
Co-authored-by: Raymond Liu <tzujui@amazon.com>
Co-authored-by: John Barboza <johnbarb@amazon.com>
Co-authored-by: Malav Shastri <malavhs@amazon.com>
Co-authored-by: Mufaddal Rohawala <89424143+mufaddal-rohawala@users.noreply.github.com>
Co-authored-by: Mike Schneider <104035434+xncqr@users.noreply.github.com>
Co-authored-by: Bhupendra Singh <bsinghtt@amazon.com>
Co-authored-by: ci <ci>
Co-authored-by: Malav Shastri <57682969+malav-shastri@users.noreply.github.com>
Co-authored-by: Keshav Chandak <chakesh@amazon.com>
Co-authored-by: Zuoyuan Huang <david.hzy97@gmail.com>
Co-authored-by: evakravi <69981223+evakravi@users.noreply.github.com>
Co-authored-by: Keshav Chandak <keshav.chandak1995@gmail.com>
Co-authored-by: Alexander Pivovarov <apivovarov@gmail.com>
Co-authored-by: SSRraymond <105880250+SSRraymond@users.noreply.github.com>
Co-authored-by: Ruilian Gao <ruiliann@amazon.com>
Co-authored-by: Ao Guo <aoguo@amazon.com>
Co-authored-by: qidewenwhen <32910701+qidewenwhen@users.noreply.github.com>
Co-authored-by: mariumof <99500633+mariumof@users.noreply.github.com>
Co-authored-by: matherit <97054789+matherit@users.noreply.github.com>
Co-authored-by: amzn-choeric <105388439+amzn-choeric@users.noreply.github.com>
Co-authored-by: Ao Guo <72373287+aoguo64@users.noreply.github.com>
Co-authored-by: Sally Seok <sallyseo@amazon.com>
Co-authored-by: Erick Benitez-Ramos <141277478+benieric@users.noreply.github.com>
Co-authored-by: Qingzi-Lan <83724147+Qingzi-Lan@users.noreply.github.com>
Co-authored-by: Sally Seok <49303563+sallyseok@users.noreply.github.com>
Co-authored-by: Manu Seth <22492939+mseth10@users.noreply.github.com>
Co-authored-by: Miyoung <myoung8739@gmail.com>
Co-authored-by: Sarah Castillo <67715639+secastillo@users.noreply.github.com>
Co-authored-by: EC2 Default User <ec2-user@ip-172-16-36-195.us-west-2.compute.internal>
Co-authored-by: EC2 Default User <ec2-user@ip-172-16-59-135.us-west-2.compute.internal>
Co-authored-by: EC2 Default User <ec2-user@ip-172-16-54-104.us-west-2.compute.internal>
Co-authored-by: Xin Wang <xwnamz@amazon.com>
Co-authored-by: stacicho <stacicho@amazon.com>
Co-authored-by: martinRenou <martin.renou@gmail.com>
Co-authored-by: jiapinw <jiapinw@amazon.com>
Co-authored-by: Akash Goel <goelakash93@gmail.com>
Co-authored-by: Joseph Zhang <cjz@amazon.com>
Co-authored-by: Harsha Reddy <116772862+sthodimi@users.noreply.github.com>
Co-authored-by: Haixin Wang <98612668+haixiw@users.noreply.github.com>
Co-authored-by: Kalyani Nikure <110067132+knikure@users.noreply.github.com>
Co-authored-by: Xin Wang <mr.xin.wang@gmail.com>
Co-authored-by: Gili Nachum <gilinachum@gmail.com>
Co-authored-by: Jose Pena <josejuan-98@hotmail.com>
Co-authored-by: cansun <80425164+can-sun@users.noreply.github.com>
Co-authored-by: AWS-pratab <110930005+AWS-pratab@users.noreply.github.com>
Co-authored-by: shenlongtang <127143389+shenlongtang@users.noreply.github.com>
Co-authored-by: Zach Kimberg <zachary@kimberg.com>
Co-authored-by: chrivtho-github <106935070+chrivtho-github@users.noreply.github.com>
Co-authored-by: Justin <justinm088@hotmail.com>
Co-authored-by: Duc Trung Le <leductrungxf@gmail.com>
Co-authored-by: HappyAmazonian <91216626+HappyAmazonian@users.noreply.github.com>
Co-authored-by: cj-zhang <32367995+cj-zhang@users.noreply.github.com>
Co-authored-by: Matthew <117945769+mwfongAWS@users.noreply.github.com>
Co-authored-by: Zach Kimberg <kimbergz@amazon.com>
Co-authored-by: Rohith Nadimpally <rnadimp@amazon.com>
Co-authored-by: rohithn1 <35045363+rohithn1@users.noreply.github.com>
Co-authored-by: Victor Zhu <victorvctr.zh@gmail.com>
Co-authored-by: jbarz1 <64875874+jbarz1@users.noreply.github.com>
Co-authored-by: Mohan Gandhi <mohgan@amazon.com>
Co-authored-by: Mohan Gandhi <mohan.sudhan@gmail.com>
Co-authored-by: Barboza <johnbarb@88665a270f35.ant.amazon.com>
Co-authored-by: ruiliann666 <141953824+ruiliann666@users.noreply.github.com>
fixes (aws#963)
fix: skip tensorflow local mode notebook test (aws#4060)
Fix TorchTensorSer/Deser (aws#969)
fix (aws#971)
fix local container mode (aws#972)
Fix auto detect (aws#979)
Fix routing fn (aws#981)
fix: tags for jumpstart model package models (aws#4061)
fix: pipeline variable kms key (aws#4065)
fix: jumpstart cache using sagemaker session s3 client (aws#4051)
fix: gated models unsupported region (aws#4069)
fix local container serialization (aws#989)
fix custom serialiazation with local container. Also remove a lot of unused code (aws#994)
Fix custom serialization for local container mode (aws#1000)
fix pytorch version (aws#1001)
Fix unit test (aws#990)
Fix unit tests (aws#1018)
Fix happy hf test (aws#1026)
fix logic setup (aws#1034)
fixes (aws#1045)
Fix flake error in init (aws#1050)
fix (aws#1053)
fix: pipeline upsert failed to pass parallelism_config to update (aws#4066)
fix: temporarily skip kmeans notebook (aws#4092)
fixes (aws#1051)
Fix missing absolute import error (aws#1057)
Fix flake8 error in unit test (aws#1058)
fixes (aws#1056)
Fix flake8 error in integ test (aws#1060)
Fix black format error in test_pickle_dependencies (aws#1062)
Fix docstyle error under serve (aws#1065)
Fix docstyle error in builder failure (aws#1066)
fix black and flake8 formatting (aws#1069)
Fix format error (aws#1070)
Fix integ test (aws#1074)
fix: HuggingFaceProcessor parameterized instance_type when image_uri is absent (aws#4072)
fix: log message when sdk defaults not applied (aws#4104)
fix: handle bad jumpstart default session (aws#4109)
Fix the version information, whl and flake8 (aws#1085)
Fix JSON serializer error (aws#1088)
Fix unit test (aws#1091)
fix format (aws#1103)
Fix local mode predictor (aws#1107)
Fix DJLPredictor (aws#1108)
Fix modelbuilder unit tests (aws#1118)
fixes (aws#1136)
fixes (aws#1165)
fixes (aws#1166)
fix: auto ml integ tests and add flaky test markers (aws#4136)
fix model data for JumpStartModel (aws#4135)
fix: transform step unit test (aws#4151)
fix: Update pipeline.py and selective_execution_config.py with small fixes (aws#1099)
fix: Fixed bug in _create_training_details (aws#4141)
fix: use correct line endings and s3 uris on windows (aws#4118)
fix: js tagging s3 prefix (aws#4167)
fix: Update Ec2 instance type to g5.4xlarge in test_huggingface_torch_distributed.py (aws#4181)
fix: import error in unsupported js regions (aws#4188)
fix: update local mode schema (aws#4185)
fix: fix flaky Inference Recommender integration tests (aws#4156)
fix: clone distribution in validate_distribution (aws#4205)
Fix hyperlinks in feature_processor.scheduler parameter descriptions (aws#4208)
Fix master merge formatting (aws#1186)
Fix master unit tests (aws#1203)
Fix djl unit tests (aws#1204)
Fix merge conflicts (aws#1217)
fix: fix URL links (aws#4217)
fix: bump urllib3 version (aws#4223)
fix: relax upper bound on urllib in local mode requirements (aws#4219)
fixes (aws#1224)
fix formatting (aws#1233)
fix byoc unit tests (aws#1235)
fix byoc unit tests (aws#1236)
Evan-W-ang added a commit to Evan-W-ang/sagemaker-python-sdk that referenced this pull request Jun 8, 2026
Starting from version `1.2` deployment of PyTorchModel always
initiates repacking when uploading the code. It is done by
calling `_upload_code` with `repack=True` parameter.
On Windows, this will lead to a crash, because
`os.path.join` method used to generate `repacked_model_uri` will
use backslashes instead of slashes. So `utils.repack_model` will fail to parse it.
Sign up for freeto 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.

3 participants

@Serhiy-Shekhovtsov@sagemaker-bot@laurenyu
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix: fix PyTorchModel deployment crash on Windows - #1212

Merged
laurenyu merged 1 commit into
aws:masterfrom
Serhiy-Shekhovtsov:patch-3
Jan 7, 2020
Merged

fix: fix PyTorchModel deployment crash on Windows#1212
laurenyu merged 1 commit into
aws:masterfrom
Serhiy-Shekhovtsov:patch-3

Conversation

@Serhiy-Shekhovtsov

Copy link
Copy Markdown
Contributor

Starting from version 1.2 deployment of PyTorchModel always initiates repacking when uploading the code. It is done by calling _upload_code with repack=True parameter.

On Windows, this will lead to a crash, because os.path.join method used to generate repacked_model_uri will use backslashes instead of slashes. So utils.repack_model will fail to parse it.

Description of changes:
Replaced os.path.join(bucket, key_prefix, "model.tar.gz") with '/'.join(...) for creating repacked_model_uri.

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.

  • I have read the CONTRIBUTING doc
  • I used the commit message format described in CONTRIBUTING
  • I have used the regional endpoint when creating S3 and/or STS clients (if appropriate)
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

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

Starting from version `1.2` deployment of PyTorchModel always initiates repacking when uploading the code. It is done by calling `_upload_code` with `repack=True` parameter. On Windows, this will lead to a crash, because `os.path.join` method used to generate `repacked_model_uri` will use backslashes instead of slashes. So `utils.repack_model` will fail to parse it.
@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@laurenyulaurenyu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks for the contribution!

@laurenyu
laurenyu merged commit 2e81f95 into aws:masterJan 7, 2020
knikure added a commit to knikure/sagemaker-python-sdk that referenced this pull request Oct 26, 2023
…- Galactus (aws#1212)
Co-authored-by: Gary Wang <garywan@amazon.com>
Co-authored-by: Gary Wang <38331932+gwang111@users.noreply.github.com>
Co-authored-by: Raymond Liu <tzujui@amazon.com>
Co-authored-by: John Barboza <johnbarb@amazon.com>
Co-authored-by: Malav Shastri <malavhs@amazon.com>
Co-authored-by: Mufaddal Rohawala <89424143+mufaddal-rohawala@users.noreply.github.com>
Co-authored-by: Mike Schneider <104035434+xncqr@users.noreply.github.com>
Co-authored-by: Bhupendra Singh <bsinghtt@amazon.com>
Co-authored-by: ci <ci>
Co-authored-by: Malav Shastri <57682969+malav-shastri@users.noreply.github.com>
Co-authored-by: Keshav Chandak <chakesh@amazon.com>
Co-authored-by: Zuoyuan Huang <david.hzy97@gmail.com>
Co-authored-by: evakravi <69981223+evakravi@users.noreply.github.com>
Co-authored-by: Keshav Chandak <keshav.chandak1995@gmail.com>
Co-authored-by: Alexander Pivovarov <apivovarov@gmail.com>
Co-authored-by: SSRraymond <105880250+SSRraymond@users.noreply.github.com>
Co-authored-by: Ruilian Gao <ruiliann@amazon.com>
Co-authored-by: Ao Guo <aoguo@amazon.com>
Co-authored-by: qidewenwhen <32910701+qidewenwhen@users.noreply.github.com>
Co-authored-by: mariumof <99500633+mariumof@users.noreply.github.com>
Co-authored-by: matherit <97054789+matherit@users.noreply.github.com>
Co-authored-by: amzn-choeric <105388439+amzn-choeric@users.noreply.github.com>
Co-authored-by: Ao Guo <72373287+aoguo64@users.noreply.github.com>
Co-authored-by: Sally Seok <sallyseo@amazon.com>
Co-authored-by: Erick Benitez-Ramos <141277478+benieric@users.noreply.github.com>
Co-authored-by: Qingzi-Lan <83724147+Qingzi-Lan@users.noreply.github.com>
Co-authored-by: Sally Seok <49303563+sallyseok@users.noreply.github.com>
Co-authored-by: Manu Seth <22492939+mseth10@users.noreply.github.com>
Co-authored-by: Miyoung <myoung8739@gmail.com>
Co-authored-by: Sarah Castillo <67715639+secastillo@users.noreply.github.com>
Co-authored-by: EC2 Default User <ec2-user@ip-172-16-36-195.us-west-2.compute.internal>
Co-authored-by: EC2 Default User <ec2-user@ip-172-16-59-135.us-west-2.compute.internal>
Co-authored-by: EC2 Default User <ec2-user@ip-172-16-54-104.us-west-2.compute.internal>
Co-authored-by: Xin Wang <xwnamz@amazon.com>
Co-authored-by: stacicho <stacicho@amazon.com>
Co-authored-by: martinRenou <martin.renou@gmail.com>
Co-authored-by: jiapinw <jiapinw@amazon.com>
Co-authored-by: Akash Goel <goelakash93@gmail.com>
Co-authored-by: Joseph Zhang <cjz@amazon.com>
Co-authored-by: Harsha Reddy <116772862+sthodimi@users.noreply.github.com>
Co-authored-by: Haixin Wang <98612668+haixiw@users.noreply.github.com>
Co-authored-by: Kalyani Nikure <110067132+knikure@users.noreply.github.com>
Co-authored-by: Xin Wang <mr.xin.wang@gmail.com>
Co-authored-by: Gili Nachum <gilinachum@gmail.com>
Co-authored-by: Jose Pena <josejuan-98@hotmail.com>
Co-authored-by: cansun <80425164+can-sun@users.noreply.github.com>
Co-authored-by: AWS-pratab <110930005+AWS-pratab@users.noreply.github.com>
Co-authored-by: shenlongtang <127143389+shenlongtang@users.noreply.github.com>
Co-authored-by: Zach Kimberg <zachary@kimberg.com>
Co-authored-by: chrivtho-github <106935070+chrivtho-github@users.noreply.github.com>
Co-authored-by: Justin <justinm088@hotmail.com>
Co-authored-by: Duc Trung Le <leductrungxf@gmail.com>
Co-authored-by: HappyAmazonian <91216626+HappyAmazonian@users.noreply.github.com>
Co-authored-by: cj-zhang <32367995+cj-zhang@users.noreply.github.com>
Co-authored-by: Matthew <117945769+mwfongAWS@users.noreply.github.com>
Co-authored-by: Zach Kimberg <kimbergz@amazon.com>
Co-authored-by: Rohith Nadimpally <rnadimp@amazon.com>
Co-authored-by: rohithn1 <35045363+rohithn1@users.noreply.github.com>
Co-authored-by: Victor Zhu <victorvctr.zh@gmail.com>
Co-authored-by: jbarz1 <64875874+jbarz1@users.noreply.github.com>
Co-authored-by: Mohan Gandhi <mohgan@amazon.com>
Co-authored-by: Mohan Gandhi <mohan.sudhan@gmail.com>
Co-authored-by: Barboza <johnbarb@88665a270f35.ant.amazon.com>
Co-authored-by: ruiliann666 <141953824+ruiliann666@users.noreply.github.com>
fixes (aws#963)
fix: skip tensorflow local mode notebook test (aws#4060)
Fix TorchTensorSer/Deser (aws#969)
fix (aws#971)
fix local container mode (aws#972)
Fix auto detect (aws#979)
Fix routing fn (aws#981)
fix: tags for jumpstart model package models (aws#4061)
fix: pipeline variable kms key (aws#4065)
fix: jumpstart cache using sagemaker session s3 client (aws#4051)
fix: gated models unsupported region (aws#4069)
fix local container serialization (aws#989)
fix custom serialiazation with local container. Also remove a lot of unused code (aws#994)
Fix custom serialization for local container mode (aws#1000)
fix pytorch version (aws#1001)
Fix unit test (aws#990)
Fix unit tests (aws#1018)
Fix happy hf test (aws#1026)
fix logic setup (aws#1034)
fixes (aws#1045)
Fix flake error in init (aws#1050)
fix (aws#1053)
fix: pipeline upsert failed to pass parallelism_config to update (aws#4066)
fix: temporarily skip kmeans notebook (aws#4092)
fixes (aws#1051)
Fix missing absolute import error (aws#1057)
Fix flake8 error in unit test (aws#1058)
fixes (aws#1056)
Fix flake8 error in integ test (aws#1060)
Fix black format error in test_pickle_dependencies (aws#1062)
Fix docstyle error under serve (aws#1065)
Fix docstyle error in builder failure (aws#1066)
fix black and flake8 formatting (aws#1069)
Fix format error (aws#1070)
Fix integ test (aws#1074)
fix: HuggingFaceProcessor parameterized instance_type when image_uri is absent (aws#4072)
fix: log message when sdk defaults not applied (aws#4104)
fix: handle bad jumpstart default session (aws#4109)
Fix the version information, whl and flake8 (aws#1085)
Fix JSON serializer error (aws#1088)
Fix unit test (aws#1091)
fix format (aws#1103)
Fix local mode predictor (aws#1107)
Fix DJLPredictor (aws#1108)
Fix modelbuilder unit tests (aws#1118)
fixes (aws#1136)
fixes (aws#1165)
fixes (aws#1166)
fix: auto ml integ tests and add flaky test markers (aws#4136)
fix model data for JumpStartModel (aws#4135)
fix: transform step unit test (aws#4151)
fix: Update pipeline.py and selective_execution_config.py with small fixes (aws#1099)
fix: Fixed bug in _create_training_details (aws#4141)
fix: use correct line endings and s3 uris on windows (aws#4118)
fix: js tagging s3 prefix (aws#4167)
fix: Update Ec2 instance type to g5.4xlarge in test_huggingface_torch_distributed.py (aws#4181)
fix: import error in unsupported js regions (aws#4188)
fix: update local mode schema (aws#4185)
fix: fix flaky Inference Recommender integration tests (aws#4156)
fix: clone distribution in validate_distribution (aws#4205)
Fix hyperlinks in feature_processor.scheduler parameter descriptions (aws#4208)
Fix master merge formatting (aws#1186)
Fix master unit tests (aws#1203)
Fix djl unit tests (aws#1204)
Fix merge conflicts (aws#1217)
fix: fix URL links (aws#4217)
fix: bump urllib3 version (aws#4223)
fix: relax upper bound on urllib in local mode requirements (aws#4219)
fixes (aws#1224)
fix formatting (aws#1233)
fix byoc unit tests (aws#1235)
fix byoc unit tests (aws#1236)
Evan-W-ang added a commit to Evan-W-ang/sagemaker-python-sdk that referenced this pull request Jun 8, 2026
Starting from version `1.2` deployment of PyTorchModel always
initiates repacking when uploading the code. It is done by
calling `_upload_code` with `repack=True` parameter.
On Windows, this will lead to a crash, because
`os.path.join` method used to generate `repacked_model_uri` will
use backslashes instead of slashes. So `utils.repack_model` will fail to parse it.
Sign up for freeto 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.

3 participants

@Serhiy-Shekhovtsov@sagemaker-bot@laurenyu
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

fix: fix PyTorchModel deployment crash on Windows - #1212

Merged
laurenyu merged 1 commit into
aws:masterfrom
Serhiy-Shekhovtsov:patch-3
Jan 7, 2020
Merged

fix: fix PyTorchModel deployment crash on Windows#1212
laurenyu merged 1 commit into
aws:masterfrom
Serhiy-Shekhovtsov:patch-3

Conversation

@Serhiy-Shekhovtsov

Copy link
Copy Markdown
Contributor

Starting from version 1.2 deployment of PyTorchModel always initiates repacking when uploading the code. It is done by calling _upload_code with repack=True parameter.

On Windows, this will lead to a crash, because os.path.join method used to generate repacked_model_uri will use backslashes instead of slashes. So utils.repack_model will fail to parse it.

Description of changes:
Replaced os.path.join(bucket, key_prefix, "model.tar.gz") with '/'.join(...) for creating repacked_model_uri.

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.

  • I have read the CONTRIBUTING doc
  • I used the commit message format described in CONTRIBUTING
  • I have used the regional endpoint when creating S3 and/or STS clients (if appropriate)
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

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

Starting from version `1.2` deployment of PyTorchModel always initiates repacking when uploading the code. It is done by calling `_upload_code` with `repack=True` parameter. On Windows, this will lead to a crash, because `os.path.join` method used to generate `repacked_model_uri` will use backslashes instead of slashes. So `utils.repack_model` will fail to parse it.
@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@laurenyulaurenyu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks for the contribution!

@laurenyu
laurenyu merged commit 2e81f95 into aws:masterJan 7, 2020
knikure added a commit to knikure/sagemaker-python-sdk that referenced this pull request Oct 26, 2023
…- Galactus (aws#1212)
Co-authored-by: Gary Wang <garywan@amazon.com>
Co-authored-by: Gary Wang <38331932+gwang111@users.noreply.github.com>
Co-authored-by: Raymond Liu <tzujui@amazon.com>
Co-authored-by: John Barboza <johnbarb@amazon.com>
Co-authored-by: Malav Shastri <malavhs@amazon.com>
Co-authored-by: Mufaddal Rohawala <89424143+mufaddal-rohawala@users.noreply.github.com>
Co-authored-by: Mike Schneider <104035434+xncqr@users.noreply.github.com>
Co-authored-by: Bhupendra Singh <bsinghtt@amazon.com>
Co-authored-by: ci <ci>
Co-authored-by: Malav Shastri <57682969+malav-shastri@users.noreply.github.com>
Co-authored-by: Keshav Chandak <chakesh@amazon.com>
Co-authored-by: Zuoyuan Huang <david.hzy97@gmail.com>
Co-authored-by: evakravi <69981223+evakravi@users.noreply.github.com>
Co-authored-by: Keshav Chandak <keshav.chandak1995@gmail.com>
Co-authored-by: Alexander Pivovarov <apivovarov@gmail.com>
Co-authored-by: SSRraymond <105880250+SSRraymond@users.noreply.github.com>
Co-authored-by: Ruilian Gao <ruiliann@amazon.com>
Co-authored-by: Ao Guo <aoguo@amazon.com>
Co-authored-by: qidewenwhen <32910701+qidewenwhen@users.noreply.github.com>
Co-authored-by: mariumof <99500633+mariumof@users.noreply.github.com>
Co-authored-by: matherit <97054789+matherit@users.noreply.github.com>
Co-authored-by: amzn-choeric <105388439+amzn-choeric@users.noreply.github.com>
Co-authored-by: Ao Guo <72373287+aoguo64@users.noreply.github.com>
Co-authored-by: Sally Seok <sallyseo@amazon.com>
Co-authored-by: Erick Benitez-Ramos <141277478+benieric@users.noreply.github.com>
Co-authored-by: Qingzi-Lan <83724147+Qingzi-Lan@users.noreply.github.com>
Co-authored-by: Sally Seok <49303563+sallyseok@users.noreply.github.com>
Co-authored-by: Manu Seth <22492939+mseth10@users.noreply.github.com>
Co-authored-by: Miyoung <myoung8739@gmail.com>
Co-authored-by: Sarah Castillo <67715639+secastillo@users.noreply.github.com>
Co-authored-by: EC2 Default User <ec2-user@ip-172-16-36-195.us-west-2.compute.internal>
Co-authored-by: EC2 Default User <ec2-user@ip-172-16-59-135.us-west-2.compute.internal>
Co-authored-by: EC2 Default User <ec2-user@ip-172-16-54-104.us-west-2.compute.internal>
Co-authored-by: Xin Wang <xwnamz@amazon.com>
Co-authored-by: stacicho <stacicho@amazon.com>
Co-authored-by: martinRenou <martin.renou@gmail.com>
Co-authored-by: jiapinw <jiapinw@amazon.com>
Co-authored-by: Akash Goel <goelakash93@gmail.com>
Co-authored-by: Joseph Zhang <cjz@amazon.com>
Co-authored-by: Harsha Reddy <116772862+sthodimi@users.noreply.github.com>
Co-authored-by: Haixin Wang <98612668+haixiw@users.noreply.github.com>
Co-authored-by: Kalyani Nikure <110067132+knikure@users.noreply.github.com>
Co-authored-by: Xin Wang <mr.xin.wang@gmail.com>
Co-authored-by: Gili Nachum <gilinachum@gmail.com>
Co-authored-by: Jose Pena <josejuan-98@hotmail.com>
Co-authored-by: cansun <80425164+can-sun@users.noreply.github.com>
Co-authored-by: AWS-pratab <110930005+AWS-pratab@users.noreply.github.com>
Co-authored-by: shenlongtang <127143389+shenlongtang@users.noreply.github.com>
Co-authored-by: Zach Kimberg <zachary@kimberg.com>
Co-authored-by: chrivtho-github <106935070+chrivtho-github@users.noreply.github.com>
Co-authored-by: Justin <justinm088@hotmail.com>
Co-authored-by: Duc Trung Le <leductrungxf@gmail.com>
Co-authored-by: HappyAmazonian <91216626+HappyAmazonian@users.noreply.github.com>
Co-authored-by: cj-zhang <32367995+cj-zhang@users.noreply.github.com>
Co-authored-by: Matthew <117945769+mwfongAWS@users.noreply.github.com>
Co-authored-by: Zach Kimberg <kimbergz@amazon.com>
Co-authored-by: Rohith Nadimpally <rnadimp@amazon.com>
Co-authored-by: rohithn1 <35045363+rohithn1@users.noreply.github.com>
Co-authored-by: Victor Zhu <victorvctr.zh@gmail.com>
Co-authored-by: jbarz1 <64875874+jbarz1@users.noreply.github.com>
Co-authored-by: Mohan Gandhi <mohgan@amazon.com>
Co-authored-by: Mohan Gandhi <mohan.sudhan@gmail.com>
Co-authored-by: Barboza <johnbarb@88665a270f35.ant.amazon.com>
Co-authored-by: ruiliann666 <141953824+ruiliann666@users.noreply.github.com>
fixes (aws#963)
fix: skip tensorflow local mode notebook test (aws#4060)
Fix TorchTensorSer/Deser (aws#969)
fix (aws#971)
fix local container mode (aws#972)
Fix auto detect (aws#979)
Fix routing fn (aws#981)
fix: tags for jumpstart model package models (aws#4061)
fix: pipeline variable kms key (aws#4065)
fix: jumpstart cache using sagemaker session s3 client (aws#4051)
fix: gated models unsupported region (aws#4069)
fix local container serialization (aws#989)
fix custom serialiazation with local container. Also remove a lot of unused code (aws#994)
Fix custom serialization for local container mode (aws#1000)
fix pytorch version (aws#1001)
Fix unit test (aws#990)
Fix unit tests (aws#1018)
Fix happy hf test (aws#1026)
fix logic setup (aws#1034)
fixes (aws#1045)
Fix flake error in init (aws#1050)
fix (aws#1053)
fix: pipeline upsert failed to pass parallelism_config to update (aws#4066)
fix: temporarily skip kmeans notebook (aws#4092)
fixes (aws#1051)
Fix missing absolute import error (aws#1057)
Fix flake8 error in unit test (aws#1058)
fixes (aws#1056)
Fix flake8 error in integ test (aws#1060)
Fix black format error in test_pickle_dependencies (aws#1062)
Fix docstyle error under serve (aws#1065)
Fix docstyle error in builder failure (aws#1066)
fix black and flake8 formatting (aws#1069)
Fix format error (aws#1070)
Fix integ test (aws#1074)
fix: HuggingFaceProcessor parameterized instance_type when image_uri is absent (aws#4072)
fix: log message when sdk defaults not applied (aws#4104)
fix: handle bad jumpstart default session (aws#4109)
Fix the version information, whl and flake8 (aws#1085)
Fix JSON serializer error (aws#1088)
Fix unit test (aws#1091)
fix format (aws#1103)
Fix local mode predictor (aws#1107)
Fix DJLPredictor (aws#1108)
Fix modelbuilder unit tests (aws#1118)
fixes (aws#1136)
fixes (aws#1165)
fixes (aws#1166)
fix: auto ml integ tests and add flaky test markers (aws#4136)
fix model data for JumpStartModel (aws#4135)
fix: transform step unit test (aws#4151)
fix: Update pipeline.py and selective_execution_config.py with small fixes (aws#1099)
fix: Fixed bug in _create_training_details (aws#4141)
fix: use correct line endings and s3 uris on windows (aws#4118)
fix: js tagging s3 prefix (aws#4167)
fix: Update Ec2 instance type to g5.4xlarge in test_huggingface_torch_distributed.py (aws#4181)
fix: import error in unsupported js regions (aws#4188)
fix: update local mode schema (aws#4185)
fix: fix flaky Inference Recommender integration tests (aws#4156)
fix: clone distribution in validate_distribution (aws#4205)
Fix hyperlinks in feature_processor.scheduler parameter descriptions (aws#4208)
Fix master merge formatting (aws#1186)
Fix master unit tests (aws#1203)
Fix djl unit tests (aws#1204)
Fix merge conflicts (aws#1217)
fix: fix URL links (aws#4217)
fix: bump urllib3 version (aws#4223)
fix: relax upper bound on urllib in local mode requirements (aws#4219)
fixes (aws#1224)
fix formatting (aws#1233)
fix byoc unit tests (aws#1235)
fix byoc unit tests (aws#1236)
Evan-W-ang added a commit to Evan-W-ang/sagemaker-python-sdk that referenced this pull request Jun 8, 2026
Starting from version `1.2` deployment of PyTorchModel always
initiates repacking when uploading the code. It is done by
calling `_upload_code` with `repack=True` parameter.
On Windows, this will lead to a crash, because
`os.path.join` method used to generate `repacked_model_uri` will
use backslashes instead of slashes. So `utils.repack_model` will fail to parse it.
Sign up for freeto 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.

3 participants

@Serhiy-Shekhovtsov@sagemaker-bot@laurenyu
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix: fix PyTorchModel deployment crash on Windows - #1212

Merged
laurenyu merged 1 commit into
aws:masterfrom
Serhiy-Shekhovtsov:patch-3
Jan 7, 2020
Merged

fix: fix PyTorchModel deployment crash on Windows#1212
laurenyu merged 1 commit into
aws:masterfrom
Serhiy-Shekhovtsov:patch-3

Conversation

@Serhiy-Shekhovtsov

Copy link
Copy Markdown
Contributor

Starting from version 1.2 deployment of PyTorchModel always initiates repacking when uploading the code. It is done by calling _upload_code with repack=True parameter.

On Windows, this will lead to a crash, because os.path.join method used to generate repacked_model_uri will use backslashes instead of slashes. So utils.repack_model will fail to parse it.

Description of changes:
Replaced os.path.join(bucket, key_prefix, "model.tar.gz") with '/'.join(...) for creating repacked_model_uri.

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.

  • I have read the CONTRIBUTING doc
  • I used the commit message format described in CONTRIBUTING
  • I have used the regional endpoint when creating S3 and/or STS clients (if appropriate)
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

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

Starting from version `1.2` deployment of PyTorchModel always initiates repacking when uploading the code. It is done by calling `_upload_code` with `repack=True` parameter. On Windows, this will lead to a crash, because `os.path.join` method used to generate `repacked_model_uri` will use backslashes instead of slashes. So `utils.repack_model` will fail to parse it.
@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@laurenyulaurenyu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks for the contribution!

@laurenyu
laurenyu merged commit 2e81f95 into aws:masterJan 7, 2020
knikure added a commit to knikure/sagemaker-python-sdk that referenced this pull request Oct 26, 2023
…- Galactus (aws#1212)
Co-authored-by: Gary Wang <garywan@amazon.com>
Co-authored-by: Gary Wang <38331932+gwang111@users.noreply.github.com>
Co-authored-by: Raymond Liu <tzujui@amazon.com>
Co-authored-by: John Barboza <johnbarb@amazon.com>
Co-authored-by: Malav Shastri <malavhs@amazon.com>
Co-authored-by: Mufaddal Rohawala <89424143+mufaddal-rohawala@users.noreply.github.com>
Co-authored-by: Mike Schneider <104035434+xncqr@users.noreply.github.com>
Co-authored-by: Bhupendra Singh <bsinghtt@amazon.com>
Co-authored-by: ci <ci>
Co-authored-by: Malav Shastri <57682969+malav-shastri@users.noreply.github.com>
Co-authored-by: Keshav Chandak <chakesh@amazon.com>
Co-authored-by: Zuoyuan Huang <david.hzy97@gmail.com>
Co-authored-by: evakravi <69981223+evakravi@users.noreply.github.com>
Co-authored-by: Keshav Chandak <keshav.chandak1995@gmail.com>
Co-authored-by: Alexander Pivovarov <apivovarov@gmail.com>
Co-authored-by: SSRraymond <105880250+SSRraymond@users.noreply.github.com>
Co-authored-by: Ruilian Gao <ruiliann@amazon.com>
Co-authored-by: Ao Guo <aoguo@amazon.com>
Co-authored-by: qidewenwhen <32910701+qidewenwhen@users.noreply.github.com>
Co-authored-by: mariumof <99500633+mariumof@users.noreply.github.com>
Co-authored-by: matherit <97054789+matherit@users.noreply.github.com>
Co-authored-by: amzn-choeric <105388439+amzn-choeric@users.noreply.github.com>
Co-authored-by: Ao Guo <72373287+aoguo64@users.noreply.github.com>
Co-authored-by: Sally Seok <sallyseo@amazon.com>
Co-authored-by: Erick Benitez-Ramos <141277478+benieric@users.noreply.github.com>
Co-authored-by: Qingzi-Lan <83724147+Qingzi-Lan@users.noreply.github.com>
Co-authored-by: Sally Seok <49303563+sallyseok@users.noreply.github.com>
Co-authored-by: Manu Seth <22492939+mseth10@users.noreply.github.com>
Co-authored-by: Miyoung <myoung8739@gmail.com>
Co-authored-by: Sarah Castillo <67715639+secastillo@users.noreply.github.com>
Co-authored-by: EC2 Default User <ec2-user@ip-172-16-36-195.us-west-2.compute.internal>
Co-authored-by: EC2 Default User <ec2-user@ip-172-16-59-135.us-west-2.compute.internal>
Co-authored-by: EC2 Default User <ec2-user@ip-172-16-54-104.us-west-2.compute.internal>
Co-authored-by: Xin Wang <xwnamz@amazon.com>
Co-authored-by: stacicho <stacicho@amazon.com>
Co-authored-by: martinRenou <martin.renou@gmail.com>
Co-authored-by: jiapinw <jiapinw@amazon.com>
Co-authored-by: Akash Goel <goelakash93@gmail.com>
Co-authored-by: Joseph Zhang <cjz@amazon.com>
Co-authored-by: Harsha Reddy <116772862+sthodimi@users.noreply.github.com>
Co-authored-by: Haixin Wang <98612668+haixiw@users.noreply.github.com>
Co-authored-by: Kalyani Nikure <110067132+knikure@users.noreply.github.com>
Co-authored-by: Xin Wang <mr.xin.wang@gmail.com>
Co-authored-by: Gili Nachum <gilinachum@gmail.com>
Co-authored-by: Jose Pena <josejuan-98@hotmail.com>
Co-authored-by: cansun <80425164+can-sun@users.noreply.github.com>
Co-authored-by: AWS-pratab <110930005+AWS-pratab@users.noreply.github.com>
Co-authored-by: shenlongtang <127143389+shenlongtang@users.noreply.github.com>
Co-authored-by: Zach Kimberg <zachary@kimberg.com>
Co-authored-by: chrivtho-github <106935070+chrivtho-github@users.noreply.github.com>
Co-authored-by: Justin <justinm088@hotmail.com>
Co-authored-by: Duc Trung Le <leductrungxf@gmail.com>
Co-authored-by: HappyAmazonian <91216626+HappyAmazonian@users.noreply.github.com>
Co-authored-by: cj-zhang <32367995+cj-zhang@users.noreply.github.com>
Co-authored-by: Matthew <117945769+mwfongAWS@users.noreply.github.com>
Co-authored-by: Zach Kimberg <kimbergz@amazon.com>
Co-authored-by: Rohith Nadimpally <rnadimp@amazon.com>
Co-authored-by: rohithn1 <35045363+rohithn1@users.noreply.github.com>
Co-authored-by: Victor Zhu <victorvctr.zh@gmail.com>
Co-authored-by: jbarz1 <64875874+jbarz1@users.noreply.github.com>
Co-authored-by: Mohan Gandhi <mohgan@amazon.com>
Co-authored-by: Mohan Gandhi <mohan.sudhan@gmail.com>
Co-authored-by: Barboza <johnbarb@88665a270f35.ant.amazon.com>
Co-authored-by: ruiliann666 <141953824+ruiliann666@users.noreply.github.com>
fixes (aws#963)
fix: skip tensorflow local mode notebook test (aws#4060)
Fix TorchTensorSer/Deser (aws#969)
fix (aws#971)
fix local container mode (aws#972)
Fix auto detect (aws#979)
Fix routing fn (aws#981)
fix: tags for jumpstart model package models (aws#4061)
fix: pipeline variable kms key (aws#4065)
fix: jumpstart cache using sagemaker session s3 client (aws#4051)
fix: gated models unsupported region (aws#4069)
fix local container serialization (aws#989)
fix custom serialiazation with local container. Also remove a lot of unused code (aws#994)
Fix custom serialization for local container mode (aws#1000)
fix pytorch version (aws#1001)
Fix unit test (aws#990)
Fix unit tests (aws#1018)
Fix happy hf test (aws#1026)
fix logic setup (aws#1034)
fixes (aws#1045)
Fix flake error in init (aws#1050)
fix (aws#1053)
fix: pipeline upsert failed to pass parallelism_config to update (aws#4066)
fix: temporarily skip kmeans notebook (aws#4092)
fixes (aws#1051)
Fix missing absolute import error (aws#1057)
Fix flake8 error in unit test (aws#1058)
fixes (aws#1056)
Fix flake8 error in integ test (aws#1060)
Fix black format error in test_pickle_dependencies (aws#1062)
Fix docstyle error under serve (aws#1065)
Fix docstyle error in builder failure (aws#1066)
fix black and flake8 formatting (aws#1069)
Fix format error (aws#1070)
Fix integ test (aws#1074)
fix: HuggingFaceProcessor parameterized instance_type when image_uri is absent (aws#4072)
fix: log message when sdk defaults not applied (aws#4104)
fix: handle bad jumpstart default session (aws#4109)
Fix the version information, whl and flake8 (aws#1085)
Fix JSON serializer error (aws#1088)
Fix unit test (aws#1091)
fix format (aws#1103)
Fix local mode predictor (aws#1107)
Fix DJLPredictor (aws#1108)
Fix modelbuilder unit tests (aws#1118)
fixes (aws#1136)
fixes (aws#1165)
fixes (aws#1166)
fix: auto ml integ tests and add flaky test markers (aws#4136)
fix model data for JumpStartModel (aws#4135)
fix: transform step unit test (aws#4151)
fix: Update pipeline.py and selective_execution_config.py with small fixes (aws#1099)
fix: Fixed bug in _create_training_details (aws#4141)
fix: use correct line endings and s3 uris on windows (aws#4118)
fix: js tagging s3 prefix (aws#4167)
fix: Update Ec2 instance type to g5.4xlarge in test_huggingface_torch_distributed.py (aws#4181)
fix: import error in unsupported js regions (aws#4188)
fix: update local mode schema (aws#4185)
fix: fix flaky Inference Recommender integration tests (aws#4156)
fix: clone distribution in validate_distribution (aws#4205)
Fix hyperlinks in feature_processor.scheduler parameter descriptions (aws#4208)
Fix master merge formatting (aws#1186)
Fix master unit tests (aws#1203)
Fix djl unit tests (aws#1204)
Fix merge conflicts (aws#1217)
fix: fix URL links (aws#4217)
fix: bump urllib3 version (aws#4223)
fix: relax upper bound on urllib in local mode requirements (aws#4219)
fixes (aws#1224)
fix formatting (aws#1233)
fix byoc unit tests (aws#1235)
fix byoc unit tests (aws#1236)
Evan-W-ang added a commit to Evan-W-ang/sagemaker-python-sdk that referenced this pull request Jun 8, 2026
Starting from version `1.2` deployment of PyTorchModel always
initiates repacking when uploading the code. It is done by
calling `_upload_code` with `repack=True` parameter.
On Windows, this will lead to a crash, because
`os.path.join` method used to generate `repacked_model_uri` will
use backslashes instead of slashes. So `utils.repack_model` will fail to parse it.
Sign up for freeto 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.

3 participants

@Serhiy-Shekhovtsov@sagemaker-bot@laurenyu
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix: fix PyTorchModel deployment crash on Windows - #1212

Merged
laurenyu merged 1 commit into
aws:masterfrom
Serhiy-Shekhovtsov:patch-3
Jan 7, 2020
Merged

fix: fix PyTorchModel deployment crash on Windows#1212
laurenyu merged 1 commit into
aws:masterfrom
Serhiy-Shekhovtsov:patch-3

Conversation

@Serhiy-Shekhovtsov

Copy link
Copy Markdown
Contributor

Starting from version 1.2 deployment of PyTorchModel always initiates repacking when uploading the code. It is done by calling _upload_code with repack=True parameter.

On Windows, this will lead to a crash, because os.path.join method used to generate repacked_model_uri will use backslashes instead of slashes. So utils.repack_model will fail to parse it.

Description of changes:
Replaced os.path.join(bucket, key_prefix, "model.tar.gz") with '/'.join(...) for creating repacked_model_uri.

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.

  • I have read the CONTRIBUTING doc
  • I used the commit message format described in CONTRIBUTING
  • I have used the regional endpoint when creating S3 and/or STS clients (if appropriate)
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

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

Starting from version `1.2` deployment of PyTorchModel always initiates repacking when uploading the code. It is done by calling `_upload_code` with `repack=True` parameter. On Windows, this will lead to a crash, because `os.path.join` method used to generate `repacked_model_uri` will use backslashes instead of slashes. So `utils.repack_model` will fail to parse it.
@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@laurenyulaurenyu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks for the contribution!

@laurenyu
laurenyu merged commit 2e81f95 into aws:masterJan 7, 2020
knikure added a commit to knikure/sagemaker-python-sdk that referenced this pull request Oct 26, 2023
…- Galactus (aws#1212)
Co-authored-by: Gary Wang <garywan@amazon.com>
Co-authored-by: Gary Wang <38331932+gwang111@users.noreply.github.com>
Co-authored-by: Raymond Liu <tzujui@amazon.com>
Co-authored-by: John Barboza <johnbarb@amazon.com>
Co-authored-by: Malav Shastri <malavhs@amazon.com>
Co-authored-by: Mufaddal Rohawala <89424143+mufaddal-rohawala@users.noreply.github.com>
Co-authored-by: Mike Schneider <104035434+xncqr@users.noreply.github.com>
Co-authored-by: Bhupendra Singh <bsinghtt@amazon.com>
Co-authored-by: ci <ci>
Co-authored-by: Malav Shastri <57682969+malav-shastri@users.noreply.github.com>
Co-authored-by: Keshav Chandak <chakesh@amazon.com>
Co-authored-by: Zuoyuan Huang <david.hzy97@gmail.com>
Co-authored-by: evakravi <69981223+evakravi@users.noreply.github.com>
Co-authored-by: Keshav Chandak <keshav.chandak1995@gmail.com>
Co-authored-by: Alexander Pivovarov <apivovarov@gmail.com>
Co-authored-by: SSRraymond <105880250+SSRraymond@users.noreply.github.com>
Co-authored-by: Ruilian Gao <ruiliann@amazon.com>
Co-authored-by: Ao Guo <aoguo@amazon.com>
Co-authored-by: qidewenwhen <32910701+qidewenwhen@users.noreply.github.com>
Co-authored-by: mariumof <99500633+mariumof@users.noreply.github.com>
Co-authored-by: matherit <97054789+matherit@users.noreply.github.com>
Co-authored-by: amzn-choeric <105388439+amzn-choeric@users.noreply.github.com>
Co-authored-by: Ao Guo <72373287+aoguo64@users.noreply.github.com>
Co-authored-by: Sally Seok <sallyseo@amazon.com>
Co-authored-by: Erick Benitez-Ramos <141277478+benieric@users.noreply.github.com>
Co-authored-by: Qingzi-Lan <83724147+Qingzi-Lan@users.noreply.github.com>
Co-authored-by: Sally Seok <49303563+sallyseok@users.noreply.github.com>
Co-authored-by: Manu Seth <22492939+mseth10@users.noreply.github.com>
Co-authored-by: Miyoung <myoung8739@gmail.com>
Co-authored-by: Sarah Castillo <67715639+secastillo@users.noreply.github.com>
Co-authored-by: EC2 Default User <ec2-user@ip-172-16-36-195.us-west-2.compute.internal>
Co-authored-by: EC2 Default User <ec2-user@ip-172-16-59-135.us-west-2.compute.internal>
Co-authored-by: EC2 Default User <ec2-user@ip-172-16-54-104.us-west-2.compute.internal>
Co-authored-by: Xin Wang <xwnamz@amazon.com>
Co-authored-by: stacicho <stacicho@amazon.com>
Co-authored-by: martinRenou <martin.renou@gmail.com>
Co-authored-by: jiapinw <jiapinw@amazon.com>
Co-authored-by: Akash Goel <goelakash93@gmail.com>
Co-authored-by: Joseph Zhang <cjz@amazon.com>
Co-authored-by: Harsha Reddy <116772862+sthodimi@users.noreply.github.com>
Co-authored-by: Haixin Wang <98612668+haixiw@users.noreply.github.com>
Co-authored-by: Kalyani Nikure <110067132+knikure@users.noreply.github.com>
Co-authored-by: Xin Wang <mr.xin.wang@gmail.com>
Co-authored-by: Gili Nachum <gilinachum@gmail.com>
Co-authored-by: Jose Pena <josejuan-98@hotmail.com>
Co-authored-by: cansun <80425164+can-sun@users.noreply.github.com>
Co-authored-by: AWS-pratab <110930005+AWS-pratab@users.noreply.github.com>
Co-authored-by: shenlongtang <127143389+shenlongtang@users.noreply.github.com>
Co-authored-by: Zach Kimberg <zachary@kimberg.com>
Co-authored-by: chrivtho-github <106935070+chrivtho-github@users.noreply.github.com>
Co-authored-by: Justin <justinm088@hotmail.com>
Co-authored-by: Duc Trung Le <leductrungxf@gmail.com>
Co-authored-by: HappyAmazonian <91216626+HappyAmazonian@users.noreply.github.com>
Co-authored-by: cj-zhang <32367995+cj-zhang@users.noreply.github.com>
Co-authored-by: Matthew <117945769+mwfongAWS@users.noreply.github.com>
Co-authored-by: Zach Kimberg <kimbergz@amazon.com>
Co-authored-by: Rohith Nadimpally <rnadimp@amazon.com>
Co-authored-by: rohithn1 <35045363+rohithn1@users.noreply.github.com>
Co-authored-by: Victor Zhu <victorvctr.zh@gmail.com>
Co-authored-by: jbarz1 <64875874+jbarz1@users.noreply.github.com>
Co-authored-by: Mohan Gandhi <mohgan@amazon.com>
Co-authored-by: Mohan Gandhi <mohan.sudhan@gmail.com>
Co-authored-by: Barboza <johnbarb@88665a270f35.ant.amazon.com>
Co-authored-by: ruiliann666 <141953824+ruiliann666@users.noreply.github.com>
fixes (aws#963)
fix: skip tensorflow local mode notebook test (aws#4060)
Fix TorchTensorSer/Deser (aws#969)
fix (aws#971)
fix local container mode (aws#972)
Fix auto detect (aws#979)
Fix routing fn (aws#981)
fix: tags for jumpstart model package models (aws#4061)
fix: pipeline variable kms key (aws#4065)
fix: jumpstart cache using sagemaker session s3 client (aws#4051)
fix: gated models unsupported region (aws#4069)
fix local container serialization (aws#989)
fix custom serialiazation with local container. Also remove a lot of unused code (aws#994)
Fix custom serialization for local container mode (aws#1000)
fix pytorch version (aws#1001)
Fix unit test (aws#990)
Fix unit tests (aws#1018)
Fix happy hf test (aws#1026)
fix logic setup (aws#1034)
fixes (aws#1045)
Fix flake error in init (aws#1050)
fix (aws#1053)
fix: pipeline upsert failed to pass parallelism_config to update (aws#4066)
fix: temporarily skip kmeans notebook (aws#4092)
fixes (aws#1051)
Fix missing absolute import error (aws#1057)
Fix flake8 error in unit test (aws#1058)
fixes (aws#1056)
Fix flake8 error in integ test (aws#1060)
Fix black format error in test_pickle_dependencies (aws#1062)
Fix docstyle error under serve (aws#1065)
Fix docstyle error in builder failure (aws#1066)
fix black and flake8 formatting (aws#1069)
Fix format error (aws#1070)
Fix integ test (aws#1074)
fix: HuggingFaceProcessor parameterized instance_type when image_uri is absent (aws#4072)
fix: log message when sdk defaults not applied (aws#4104)
fix: handle bad jumpstart default session (aws#4109)
Fix the version information, whl and flake8 (aws#1085)
Fix JSON serializer error (aws#1088)
Fix unit test (aws#1091)
fix format (aws#1103)
Fix local mode predictor (aws#1107)
Fix DJLPredictor (aws#1108)
Fix modelbuilder unit tests (aws#1118)
fixes (aws#1136)
fixes (aws#1165)
fixes (aws#1166)
fix: auto ml integ tests and add flaky test markers (aws#4136)
fix model data for JumpStartModel (aws#4135)
fix: transform step unit test (aws#4151)
fix: Update pipeline.py and selective_execution_config.py with small fixes (aws#1099)
fix: Fixed bug in _create_training_details (aws#4141)
fix: use correct line endings and s3 uris on windows (aws#4118)
fix: js tagging s3 prefix (aws#4167)
fix: Update Ec2 instance type to g5.4xlarge in test_huggingface_torch_distributed.py (aws#4181)
fix: import error in unsupported js regions (aws#4188)
fix: update local mode schema (aws#4185)
fix: fix flaky Inference Recommender integration tests (aws#4156)
fix: clone distribution in validate_distribution (aws#4205)
Fix hyperlinks in feature_processor.scheduler parameter descriptions (aws#4208)
Fix master merge formatting (aws#1186)
Fix master unit tests (aws#1203)
Fix djl unit tests (aws#1204)
Fix merge conflicts (aws#1217)
fix: fix URL links (aws#4217)
fix: bump urllib3 version (aws#4223)
fix: relax upper bound on urllib in local mode requirements (aws#4219)
fixes (aws#1224)
fix formatting (aws#1233)
fix byoc unit tests (aws#1235)
fix byoc unit tests (aws#1236)
Evan-W-ang added a commit to Evan-W-ang/sagemaker-python-sdk that referenced this pull request Jun 8, 2026
Starting from version `1.2` deployment of PyTorchModel always
initiates repacking when uploading the code. It is done by
calling `_upload_code` with `repack=True` parameter.
On Windows, this will lead to a crash, because
`os.path.join` method used to generate `repacked_model_uri` will
use backslashes instead of slashes. So `utils.repack_model` will fail to parse it.
Sign up for freeto 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.

3 participants

@Serhiy-Shekhovtsov@sagemaker-bot@laurenyu
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

fix: fix PyTorchModel deployment crash on Windows - #1212

Merged
laurenyu merged 1 commit into
aws:masterfrom
Serhiy-Shekhovtsov:patch-3
Jan 7, 2020
Merged

fix: fix PyTorchModel deployment crash on Windows#1212
laurenyu merged 1 commit into
aws:masterfrom
Serhiy-Shekhovtsov:patch-3

Conversation

@Serhiy-Shekhovtsov

Copy link
Copy Markdown
Contributor

Starting from version 1.2 deployment of PyTorchModel always initiates repacking when uploading the code. It is done by calling _upload_code with repack=True parameter.

On Windows, this will lead to a crash, because os.path.join method used to generate repacked_model_uri will use backslashes instead of slashes. So utils.repack_model will fail to parse it.

Description of changes:
Replaced os.path.join(bucket, key_prefix, "model.tar.gz") with '/'.join(...) for creating repacked_model_uri.

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.

  • I have read the CONTRIBUTING doc
  • I used the commit message format described in CONTRIBUTING
  • I have used the regional endpoint when creating S3 and/or STS clients (if appropriate)
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

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

Starting from version `1.2` deployment of PyTorchModel always initiates repacking when uploading the code. It is done by calling `_upload_code` with `repack=True` parameter. On Windows, this will lead to a crash, because `os.path.join` method used to generate `repacked_model_uri` will use backslashes instead of slashes. So `utils.repack_model` will fail to parse it.
@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@sagemaker-bot

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@laurenyulaurenyu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks for the contribution!

@laurenyu
laurenyu merged commit 2e81f95 into aws:masterJan 7, 2020
knikure added a commit to knikure/sagemaker-python-sdk that referenced this pull request Oct 26, 2023
…- Galactus (aws#1212)
Co-authored-by: Gary Wang <garywan@amazon.com>
Co-authored-by: Gary Wang <38331932+gwang111@users.noreply.github.com>
Co-authored-by: Raymond Liu <tzujui@amazon.com>
Co-authored-by: John Barboza <johnbarb@amazon.com>
Co-authored-by: Malav Shastri <malavhs@amazon.com>
Co-authored-by: Mufaddal Rohawala <89424143+mufaddal-rohawala@users.noreply.github.com>
Co-authored-by: Mike Schneider <104035434+xncqr@users.noreply.github.com>
Co-authored-by: Bhupendra Singh <bsinghtt@amazon.com>
Co-authored-by: ci <ci>
Co-authored-by: Malav Shastri <57682969+malav-shastri@users.noreply.github.com>
Co-authored-by: Keshav Chandak <chakesh@amazon.com>
Co-authored-by: Zuoyuan Huang <david.hzy97@gmail.com>
Co-authored-by: evakravi <69981223+evakravi@users.noreply.github.com>
Co-authored-by: Keshav Chandak <keshav.chandak1995@gmail.com>
Co-authored-by: Alexander Pivovarov <apivovarov@gmail.com>
Co-authored-by: SSRraymond <105880250+SSRraymond@users.noreply.github.com>
Co-authored-by: Ruilian Gao <ruiliann@amazon.com>
Co-authored-by: Ao Guo <aoguo@amazon.com>
Co-authored-by: qidewenwhen <32910701+qidewenwhen@users.noreply.github.com>
Co-authored-by: mariumof <99500633+mariumof@users.noreply.github.com>
Co-authored-by: matherit <97054789+matherit@users.noreply.github.com>
Co-authored-by: amzn-choeric <105388439+amzn-choeric@users.noreply.github.com>
Co-authored-by: Ao Guo <72373287+aoguo64@users.noreply.github.com>
Co-authored-by: Sally Seok <sallyseo@amazon.com>
Co-authored-by: Erick Benitez-Ramos <141277478+benieric@users.noreply.github.com>
Co-authored-by: Qingzi-Lan <83724147+Qingzi-Lan@users.noreply.github.com>
Co-authored-by: Sally Seok <49303563+sallyseok@users.noreply.github.com>
Co-authored-by: Manu Seth <22492939+mseth10@users.noreply.github.com>
Co-authored-by: Miyoung <myoung8739@gmail.com>
Co-authored-by: Sarah Castillo <67715639+secastillo@users.noreply.github.com>
Co-authored-by: EC2 Default User <ec2-user@ip-172-16-36-195.us-west-2.compute.internal>
Co-authored-by: EC2 Default User <ec2-user@ip-172-16-59-135.us-west-2.compute.internal>
Co-authored-by: EC2 Default User <ec2-user@ip-172-16-54-104.us-west-2.compute.internal>
Co-authored-by: Xin Wang <xwnamz@amazon.com>
Co-authored-by: stacicho <stacicho@amazon.com>
Co-authored-by: martinRenou <martin.renou@gmail.com>
Co-authored-by: jiapinw <jiapinw@amazon.com>
Co-authored-by: Akash Goel <goelakash93@gmail.com>
Co-authored-by: Joseph Zhang <cjz@amazon.com>
Co-authored-by: Harsha Reddy <116772862+sthodimi@users.noreply.github.com>
Co-authored-by: Haixin Wang <98612668+haixiw@users.noreply.github.com>
Co-authored-by: Kalyani Nikure <110067132+knikure@users.noreply.github.com>
Co-authored-by: Xin Wang <mr.xin.wang@gmail.com>
Co-authored-by: Gili Nachum <gilinachum@gmail.com>
Co-authored-by: Jose Pena <josejuan-98@hotmail.com>
Co-authored-by: cansun <80425164+can-sun@users.noreply.github.com>
Co-authored-by: AWS-pratab <110930005+AWS-pratab@users.noreply.github.com>
Co-authored-by: shenlongtang <127143389+shenlongtang@users.noreply.github.com>
Co-authored-by: Zach Kimberg <zachary@kimberg.com>
Co-authored-by: chrivtho-github <106935070+chrivtho-github@users.noreply.github.com>
Co-authored-by: Justin <justinm088@hotmail.com>
Co-authored-by: Duc Trung Le <leductrungxf@gmail.com>
Co-authored-by: HappyAmazonian <91216626+HappyAmazonian@users.noreply.github.com>
Co-authored-by: cj-zhang <32367995+cj-zhang@users.noreply.github.com>
Co-authored-by: Matthew <117945769+mwfongAWS@users.noreply.github.com>
Co-authored-by: Zach Kimberg <kimbergz@amazon.com>
Co-authored-by: Rohith Nadimpally <rnadimp@amazon.com>
Co-authored-by: rohithn1 <35045363+rohithn1@users.noreply.github.com>
Co-authored-by: Victor Zhu <victorvctr.zh@gmail.com>
Co-authored-by: jbarz1 <64875874+jbarz1@users.noreply.github.com>
Co-authored-by: Mohan Gandhi <mohgan@amazon.com>
Co-authored-by: Mohan Gandhi <mohan.sudhan@gmail.com>
Co-authored-by: Barboza <johnbarb@88665a270f35.ant.amazon.com>
Co-authored-by: ruiliann666 <141953824+ruiliann666@users.noreply.github.com>
fixes (aws#963)
fix: skip tensorflow local mode notebook test (aws#4060)
Fix TorchTensorSer/Deser (aws#969)
fix (aws#971)
fix local container mode (aws#972)
Fix auto detect (aws#979)
Fix routing fn (aws#981)
fix: tags for jumpstart model package models (aws#4061)
fix: pipeline variable kms key (aws#4065)
fix: jumpstart cache using sagemaker session s3 client (aws#4051)
fix: gated models unsupported region (aws#4069)
fix local container serialization (aws#989)
fix custom serialiazation with local container. Also remove a lot of unused code (aws#994)
Fix custom serialization for local container mode (aws#1000)
fix pytorch version (aws#1001)
Fix unit test (aws#990)
Fix unit tests (aws#1018)
Fix happy hf test (aws#1026)
fix logic setup (aws#1034)
fixes (aws#1045)
Fix flake error in init (aws#1050)
fix (aws#1053)
fix: pipeline upsert failed to pass parallelism_config to update (aws#4066)
fix: temporarily skip kmeans notebook (aws#4092)
fixes (aws#1051)
Fix missing absolute import error (aws#1057)
Fix flake8 error in unit test (aws#1058)
fixes (aws#1056)
Fix flake8 error in integ test (aws#1060)
Fix black format error in test_pickle_dependencies (aws#1062)
Fix docstyle error under serve (aws#1065)
Fix docstyle error in builder failure (aws#1066)
fix black and flake8 formatting (aws#1069)
Fix format error (aws#1070)
Fix integ test (aws#1074)
fix: HuggingFaceProcessor parameterized instance_type when image_uri is absent (aws#4072)
fix: log message when sdk defaults not applied (aws#4104)
fix: handle bad jumpstart default session (aws#4109)
Fix the version information, whl and flake8 (aws#1085)
Fix JSON serializer error (aws#1088)
Fix unit test (aws#1091)
fix format (aws#1103)
Fix local mode predictor (aws#1107)
Fix DJLPredictor (aws#1108)
Fix modelbuilder unit tests (aws#1118)
fixes (aws#1136)
fixes (aws#1165)
fixes (aws#1166)
fix: auto ml integ tests and add flaky test markers (aws#4136)
fix model data for JumpStartModel (aws#4135)
fix: transform step unit test (aws#4151)
fix: Update pipeline.py and selective_execution_config.py with small fixes (aws#1099)
fix: Fixed bug in _create_training_details (aws#4141)
fix: use correct line endings and s3 uris on windows (aws#4118)
fix: js tagging s3 prefix (aws#4167)
fix: Update Ec2 instance type to g5.4xlarge in test_huggingface_torch_distributed.py (aws#4181)
fix: import error in unsupported js regions (aws#4188)
fix: update local mode schema (aws#4185)
fix: fix flaky Inference Recommender integration tests (aws#4156)
fix: clone distribution in validate_distribution (aws#4205)
Fix hyperlinks in feature_processor.scheduler parameter descriptions (aws#4208)
Fix master merge formatting (aws#1186)
Fix master unit tests (aws#1203)
Fix djl unit tests (aws#1204)
Fix merge conflicts (aws#1217)
fix: fix URL links (aws#4217)
fix: bump urllib3 version (aws#4223)
fix: relax upper bound on urllib in local mode requirements (aws#4219)
fixes (aws#1224)
fix formatting (aws#1233)
fix byoc unit tests (aws#1235)
fix byoc unit tests (aws#1236)
Evan-W-ang added a commit to Evan-W-ang/sagemaker-python-sdk that referenced this pull request Jun 8, 2026
Starting from version `1.2` deployment of PyTorchModel always
initiates repacking when uploading the code. It is done by
calling `_upload_code` with `repack=True` parameter.
On Windows, this will lead to a crash, because
`os.path.join` method used to generate `repacked_model_uri` will
use backslashes instead of slashes. So `utils.repack_model` will fail to parse it.
Sign up for freeto 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.

3 participants

@Serhiy-Shekhovtsov@sagemaker-bot@laurenyu