Skip to content

Commit 0bede1e

Browse files
nargokulsagemaker-bot
authored andcommitted
Torch upgrade (aws#5086)
* Fix Flake8 Violations * UPDATE PYTORCH VERSION TO ADDRESS SECURITY RISK **Description** Currently used Pytorch version has a possible vulnerability . Internal - https://tiny.amazon.com/p5i4jla1 **Testing Done** Unit and Integration tests in the CodeBuild * REvert CPU Versions * Test Fix * Codestyle fixes * debug attempt * Fixes * Fix * Fix
1 parent bc7e3ba commit 0bede1e

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

tests/data/serve_resources/mlflow/pytorch/conda.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ dependencies:
1717
- pandas==2.2.1
1818
- pyyaml==6.0.1
1919
- requests==2.31.0
20-
- torch==2.0.1
21-
- torchvision==0.15.2
20+
- torch>=2.6.0
21+
- torchvision>=0.17.0
2222
- tqdm==4.66.2
2323
- scikit-learn==1.3.2
2424
name: mlflow-env

tests/data/serve_resources/mlflow/pytorch/requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ packaging==21.3
1111
pandas==2.2.1
1212
pyyaml==6.0.1
1313
requests==2.32.2
14-
torch==2.2.0
15-
torchvision==0.17.0
14+
torch>=2.6.0
15+
torchvision>=0.17.0
1616
tqdm==4.66.3

tests/integ/sagemaker/experiments/helpers.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,16 @@ def cleanup_exp_resources(exp_names, sagemaker_session):
4444
exp = Experiment.load(experiment_name=exp_name, sagemaker_session=sagemaker_session)
4545
exp._delete_all(action="--force")
4646

47+
4748
@pytest.fixture
4849
def clear_run_context():
4950
current_run = _RunContext.get_current_run()
50-
if current_run == None:
51+
if current_run is None:
5152
return
5253

5354
logging.info(
5455
f"RunContext already populated by run {current_run.run_name}"
5556
f" in experiment {current_run.experiment_name}."
5657
" Clearing context manually"
5758
)
58-
_RunContext.drop_current_run()
59+
_RunContext.drop_current_run()

tests/integ/sagemaker/serve/test_serve_mlflow_pytorch_flavor_happy.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ def model_builder(request):
166166
# ), f"{caught_ex} was thrown when running pytorch squeezenet local container test"
167167

168168

169-
@pytest.mark.skipif(
170-
PYTHON_VERSION_IS_NOT_310, # or NOT_RUNNING_ON_INF_EXP_DEV_PIPELINE,
171-
reason="The goal of these test are to test the serving components of our feature",
169+
@pytest.mark.skip(
170+
reason="Testing against Python version 310 which is not supported anymore"
171+
" https://github.com/aws/deep-learning-containers/blob/master/available_images.md",
172172
)
173173
def test_happy_pytorch_sagemaker_endpoint_with_torch_serve(
174174
sagemaker_session,

tests/unit/sagemaker/jumpstart/constants.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17393,7 +17393,7 @@
1739317393
"texttable==1.6.7",
1739417394
"tokenize-rt==5.1.0",
1739517395
"tokenizers==0.13.3",
17396-
"torch==2.2.0",
17396+
"torch>=2.6.0",
1739717397
"transformers==4.33.3",
1739817398
"triton==2.2.0",
1739917399
"typing-extensions==4.8.0",

0 commit comments

Comments
 (0)