Skip to content

Commit c4abd38

Browse files
authored
Patch PyTorch 2.7 sagemaker package (#4976)
* Patch PyTorch 2.7 sagemaker package * buisl test pt 2.7 * fix core packages * pin sagemaker-training * specify pt 2.7 * fix elif * pin pytorch training toolkit * add py allowlist
1 parent ecdd953 commit c4abd38

File tree

5 files changed

+10
-2
lines changed

5 files changed

+10
-2
lines changed

miscellaneous_scripts/dockerfile_patch_script.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ fi
5555
# Upgrade sagemaker-training
5656
if [[ $LATEST_RELEASED_IMAGE_URI =~ ^763104351884\.dkr\.ecr\.us-west-2\.amazonaws\.com/pytorch-training:2\.[4-6](.+)sagemaker ]]; then
5757
pip install -U "sagemaker-training>4.7.4" "protobuf>=4.25.8,<6"
58+
elif [[ $LATEST_RELEASED_IMAGE_URI =~ ^763104351884\.dkr\.ecr\.us-west-2\.amazonaws\.com/pytorch-training:2\.7(.+)sagemaker ]]; then
59+
pip install -U "sagemaker-training>4.7.4,<5" "sagemaker-pytorch-training>=2.9.0"
5860
fi
5961

6062
# For PT inference gpu sagemaker images, replace start_cuda_compat.sh

pytorch/training/docker/2.7/py3/Dockerfile.sagemaker.cpu.core_packages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"version_specifier": "<1"
4646
},
4747
"sagemaker-training": {
48-
"version_specifier": "<=4.8.3"
48+
"version_specifier": ">=4.8.3"
4949
},
5050
"tqdm": {
5151
"version_specifier": ">=4.66.3"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"77740": "Package: protobuf is required by sagemaker-training-toolkit. Advisory: Affected versions of this package are vulnerable to a potential Denial of Service (DoS) attack due to unbounded recursion when parsing untrusted Protocol Buffers data. The pure-Python implementation fails to enforce recursion depth limits when processing recursive groups, recursive messages, or a series of SGROUP tags, leading to stack overflow conditions that can crash the application by exceeding Python's recursion limit."
3+
}

pytorch/training/docker/2.7/py3/cu128/Dockerfile.sagemaker.gpu.core_packages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"version_specifier": ">=6.5.1"
4747
},
4848
"sagemaker-training": {
49-
"version_specifier": "<=4.8.3"
49+
"version_specifier": ">=4.8.3"
5050
},
5151
"sagemaker": {
5252
"version_specifier": ">=2,<3"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"77740": "Package: protobuf is required by sagemaker-training-toolkit. Advisory: Affected versions of this package are vulnerable to a potential Denial of Service (DoS) attack due to unbounded recursion when parsing untrusted Protocol Buffers data. The pure-Python implementation fails to enforce recursion depth limits when processing recursive groups, recursive messages, or a series of SGROUP tags, leading to stack overflow conditions that can crash the application by exceeding Python's recursion limit."
3+
}

0 commit comments

Comments
 (0)