Skip to content

Commit 5316b23

Browse files
Patch 2025 02 07 hf pt inference neuronx (#4543)
* patch transformers, optimum_neuron, ubuntu and bump major version * Update ['dlc_developer_config.toml'] dlc_developer_config.toml: { 'build': { 'build_frameworks': ['huggingface_pytorch'], 'build_inference': True, 'build_training': False}, 'buildspec_override': { 'dlc-pr-huggingface-pytorch-neuronx-inference': 'huggingface/pytorch/inference/buildspec-neuronx.yml'}, 'dev': { 'arm64_mode': False, 'deep_canary_mode': False, 'graviton_mode': False, 'neuronx_mode': True}, 'test': { 'ec2_tests': True, 'ecs_tests': True, 'eks_tests': True, 'sagemaker_local_tests': True, 'sagemaker_remote_tests': True, 'sanity_tests': True, 'security_tests': True}} * bump miniforge version * remove emacs * also fix release_images * optimum-neuron requires hugginface-hub>=0.28.0 * revert transformers change due to chain reqs requiring hugginface_hub 0.28 * ignore transformers vulnerability from Safety * wrong file i guess? moving the ignore to a diff allowlist * nvm, its because its picking up the wrong dict * dont bump optimum neuron * Revert "Update ['dlc_developer_config.toml']" This reverts commit a9209af.
1 parent a6ae921 commit 5316b23

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

data/ignore_ids_safety_scan.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1450,7 +1450,8 @@
14501450
"67599": "** DISPUTED ** An issue was discovered in pip (all versions) because it installs the version with the highest version number, even if the user had intended to obtain a private package from a private index. This only affects use of the --extra-index-url option, and exploitation requires that the package does not already exist in the public index (and thus the attacker can put the package there with an arbitrary version number). NOTE: it has been reported that this is intended functionality and the user is responsible for using --extra-index-url securely.",
14511451
"70612": "The maintainer and multiple third parties believe that this vulnerability isn't valid because users shouldn't use untrusted templates without sandboxing.",
14521452
"71671": "Pytorch version upgrade needs to be handled in a separate image",
1453-
"71672": "Pytorch version upgrade needs to be handled in a separate image"
1453+
"71672": "Pytorch version upgrade needs to be handled in a separate image",
1454+
"74882": "Ignoring due to Safety picking this up. This is already covered in our own scan config"
14541455
}
14551456
},
14561457
"training-neuronx": {

huggingface/pytorch/inference/docker/2.1/py3/sdk2.20.0/Dockerfile.neuronx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM ubuntu:20.04
22

3-
LABEL dlc_major_version="1"
3+
LABEL dlc_major_version="2"
44
LABEL maintainer="Amazon AI"
55
LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true
66

@@ -162,6 +162,9 @@ RUN chmod +x /usr/local/bin/deep_learning_container.py
162162
# Hugging Face specific section #
163163
#################################
164164

165+
RUN apt-get remove -y --purge emacs && \
166+
apt-get autoremove -y
167+
165168
RUN curl https://aws-dlc-licenses.s3.amazonaws.com/pytorch-1.13/license.txt -o /license.txt
166169

167170
# install Hugging Face libraries and its dependencies

src/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,8 @@ def get_safety_ignore_dict(image_uri, framework, python_version, job_type):
281281
job_type = (
282282
"inference-eia"
283283
if "eia" in image_uri
284+
else "inference-neuronx"
285+
if "neuronx" in image_uri
284286
else "inference-neuron"
285287
if "neuron" in image_uri
286288
else "inference"

0 commit comments

Comments
 (0)