generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 527
Hf pt 2 7 tr4 55 0 training #5146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
e1c1ce9
Added Dockerfile for transformers 4.55.0 pytorch 2.7.1
de43827
New buildspec
04fa34b
Changed dlc_developer_config.toml
308dcbc
Merge branch 'master' into hf-pt-2-7-tr4-55-0-training
fgbelidji c4d6aa7
Merge branch 'master' into hf-pt-2-7-tr4-55-0-training
fgbelidji 454d6e1
Merge branch 'master' into hf-pt-2-7-tr4-55-0-training
fgbelidji 1d2f772
Revert "Changed dlc_developer_config.toml"
434b13a
Merge branch 'master' into hf-pt-2-7-tr4-55-0-training
fgbelidji d62505f
Merge branch 'master' into hf-pt-2-7-tr4-55-0-training
fgbelidji ada3460
Merge branch 'master' into hf-pt-2-7-tr4-55-0-training
fgbelidji d250541
added missing frameworks dlc_developer_config.toml
3bcace3
copy buildspec pt 2.6
de83b59
Label major version to 1
064ee33
Build and test
5021ace
Merge branch 'master' into hf-pt-2-7-tr4-55-0-training
fgbelidji 3c030e2
Build and test
99070fd
Merge branch 'hf-pt-2-7-tr4-55-0-training' of github.com:fgbelidji/de…
b87a265
Fixing CVEs
3104be5
Merge branch 'master' into hf-pt-2-7-tr4-55-0-training
fgbelidji a0857ab
Merge branch 'master' into hf-pt-2-7-tr4-55-0-training
fgbelidji 9100df2
fix CVE go
0cd69c8
Merge branch 'hf-pt-2-7-tr4-55-0-training' of github.com:fgbelidji/de…
ccc7aa1
Merge branch 'master' into hf-pt-2-7-tr4-55-0-training
fgbelidji 1874b47
simplification of packages need + fix CVE
0a7c0f7
Merge branch 'hf-pt-2-7-tr4-55-0-training' of github.com:fgbelidji/de…
72ba6b7
pip check fix
ab0aa3d
Fixing conflicting dependencies between (used by )
3f7fd45
Merge branch 'master' into hf-pt-2-7-tr4-55-0-training
fgbelidji f95a2c5
Fixed datasets version
5536323
Merge branch 'hf-pt-2-7-tr4-55-0-training' of github.com:fgbelidji/de…
b176869
Reverting dlc_developer_config.toml
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| account_id: &ACCOUNT_ID <set-$ACCOUNT_ID-in-environment> | ||
| region: ®ION <set-$REGION-in-environment> | ||
| base_framework: &BASE_FRAMEWORK pytorch | ||
| framework: &FRAMEWORK !join [ "huggingface_", *BASE_FRAMEWORK] | ||
| version: &VERSION 2.5.1 | ||
| short_version: &SHORT_VERSION "2.5" | ||
| contributor: huggingface | ||
| arch_type: x86 | ||
|
|
||
| repository_info: | ||
| training_repository: &TRAINING_REPOSITORY | ||
| image_type: &TRAINING_IMAGE_TYPE training | ||
| root: !join [ "huggingface/", *BASE_FRAMEWORK, "/", *TRAINING_IMAGE_TYPE ] | ||
| repository_name: &REPOSITORY_NAME !join ["pr", "-", "huggingface", "-", *BASE_FRAMEWORK, "-", *TRAINING_IMAGE_TYPE] | ||
| repository: &REPOSITORY !join [ *ACCOUNT_ID, .dkr.ecr., *REGION, .amazonaws.com/, *REPOSITORY_NAME ] | ||
|
|
||
| context: | ||
| training_context: &TRAINING_CONTEXT | ||
| cuda-compatibility-lib: | ||
| source: ../../build_artifacts/training/cuda-compatibility-lib.sh | ||
| target: cuda-compatibility-lib.sh | ||
|
|
||
| images: | ||
| BuildHuggingFacePytorchGpuPy311Cu124TrainingDockerImage: | ||
| <<: *TRAINING_REPOSITORY | ||
| build: &HUGGINGFACE_PYTORCH_GPU_TRAINING_PY3 false | ||
| image_size_baseline: &IMAGE_SIZE_BASELINE 21500 | ||
| device_type: &DEVICE_TYPE gpu | ||
| python_version: &DOCKER_PYTHON_VERSION py3 | ||
| tag_python_version: &TAG_PYTHON_VERSION py311 | ||
| cuda_version: &CUDA_VERSION cu124 | ||
| os_version: &OS_VERSION ubuntu22.04 | ||
| transformers_version: &TRANSFORMERS_VERSION 4.49.0 | ||
| datasets_version: &DATASETS_VERSION 3.3.2 | ||
| tag: !join [ *VERSION, '-', 'transformers', *TRANSFORMERS_VERSION, '-', *DEVICE_TYPE, '-', *TAG_PYTHON_VERSION, '-', | ||
| *CUDA_VERSION, '-', *OS_VERSION ] | ||
| docker_file: !join [ docker/, *SHORT_VERSION, /, *DOCKER_PYTHON_VERSION, /, | ||
| *CUDA_VERSION, /Dockerfile., *DEVICE_TYPE ] | ||
| context: | ||
| <<: *TRAINING_CONTEXT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| account_id: &ACCOUNT_ID <set-$ACCOUNT_ID-in-environment> | ||
| region: ®ION <set-$REGION-in-environment> | ||
| base_framework: &BASE_FRAMEWORK pytorch | ||
| framework: &FRAMEWORK !join [ "huggingface_", *BASE_FRAMEWORK] | ||
|
|
||
| version: &VERSION 2.6.0 | ||
| short_version: &SHORT_VERSION "2.6" | ||
| contributor: huggingface | ||
| arch_type: x86 | ||
|
|
||
| repository_info: | ||
| training_repository: &TRAINING_REPOSITORY | ||
| image_type: &TRAINING_IMAGE_TYPE training | ||
| root: !join [ "huggingface/", *BASE_FRAMEWORK, "/", *TRAINING_IMAGE_TYPE ] | ||
| repository_name: &REPOSITORY_NAME !join ["pr", "-", "huggingface", "-", *BASE_FRAMEWORK, "-", *TRAINING_IMAGE_TYPE] | ||
| repository: &REPOSITORY !join [ *ACCOUNT_ID, .dkr.ecr., *REGION, .amazonaws.com/, *REPOSITORY_NAME ] | ||
|
|
||
| context: | ||
| training_context: &TRAINING_CONTEXT | ||
| cuda-compatibility-lib: | ||
| source: ../../build_artifacts/training/cuda-compatibility-lib.sh | ||
| target: cuda-compatibility-lib.sh | ||
|
|
||
| images: | ||
| BuildHuggingFacePytorchGpuPy312Cu126TrainingDockerImage: | ||
| <<: *TRAINING_REPOSITORY | ||
| build: &HUGGINGFACE_PYTORCH_GPU_TRAINING_PY3 false | ||
| image_size_baseline: &IMAGE_SIZE_BASELINE 21500 | ||
| device_type: &DEVICE_TYPE gpu | ||
| python_version: &DOCKER_PYTHON_VERSION py3 | ||
| tag_python_version: &TAG_PYTHON_VERSION py312 | ||
| cuda_version: &CUDA_VERSION cu126 | ||
| os_version: &OS_VERSION ubuntu22.04 | ||
| transformers_version: &TRANSFORMERS_VERSION 4.51.3 | ||
| datasets_version: &DATASETS_VERSION 3.5.0 | ||
| tag: !join [ *VERSION, '-', 'transformers', *TRANSFORMERS_VERSION, '-', *DEVICE_TYPE, '-', *TAG_PYTHON_VERSION, '-', | ||
| *CUDA_VERSION, '-', *OS_VERSION ] | ||
| docker_file: !join [ docker/, *SHORT_VERSION, /, *DOCKER_PYTHON_VERSION, /, | ||
| *CUDA_VERSION, /Dockerfile., *DEVICE_TYPE ] | ||
| context: | ||
| <<: *TRAINING_CONTEXT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
huggingface/pytorch/training/docker/2.7/py3/cu128/Dockerfile.gpu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| # https://github.com/aws/deep-learning-containers/blob/master/available_images.md | ||
| # refer to the above page to pull latest Pytorch image | ||
|
|
||
| # docker image region us-west-2 | ||
| FROM 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.7.1-gpu-py312-cu128-ubuntu22.04-sagemaker | ||
|
|
||
| RUN apt-get remove -y --purge emacs && \ | ||
|
|
||
| apt-get autoremove -y | ||
|
|
||
| LABEL maintainer="Amazon AI" | ||
| LABEL dlc_major_version="1" | ||
|
|
||
| # version args | ||
| ARG TRANSFORMERS_VERSION=4.55.0 | ||
| ARG DATASETS_VERSION=4.0.0 | ||
| ARG HUGGINGFACE_HUB_VERSION=0.34.0 | ||
| ARG DIFFUSERS_VERSION=0.34.0 | ||
| ARG EVALUATE_VERSION=0.4.3 | ||
| ARG ACCELERATE_VERSION=1.4.0 | ||
| ARG TRL_VERSION=0.21.0 | ||
| ARG PEFT_VERSION=0.17.0 | ||
| ARG FLASH_ATTN_VERSION=2.8.2 | ||
| ARG NINJA_VERSION=1.11.1.4 | ||
| ARG KERNELS_VERSION=0.9.0 | ||
| ARG PYTHON=python3 | ||
|
|
||
| # TODO: Remove when the base image is updated | ||
| RUN pip install --upgrade pip \ | ||
| && pip uninstall -y transformer-engine flash-attn pyarrow cryptography \ | ||
| && pip install --no-cache-dir -U pyarrow cryptography pyopenssl Pillow \ | ||
| && pip --no-cache-dir install --upgrade wheel setuptools \ | ||
| && pip install --no-cache-dir -U "werkzeug==3.0.6" | ||
|
|
||
| # Pre-install kenlm without build isolation so it uses system cmake | ||
| RUN pip install --no-cache-dir --no-build-isolation kenlm | ||
|
|
||
| # Install Hugging Face libraries and dependencies | ||
| RUN pip install --no-cache-dir \ | ||
| huggingface_hub[hf_transfer]==${HUGGINGFACE_HUB_VERSION} \ | ||
| transformers[sklearn,sentencepiece,audio,vision,pipelines]==${TRANSFORMERS_VERSION} \ | ||
| datasets==${DATASETS_VERSION} \ | ||
| diffusers==${DIFFUSERS_VERSION} \ | ||
| Jinja2 \ | ||
| tensorboard \ | ||
| bitsandbytes \ | ||
| kernels==${KERNELS_VERSION} \ | ||
| evaluate==${EVALUATE_VERSION} \ | ||
| accelerate==${ACCELERATE_VERSION} \ | ||
| ninja==${NINJA_VERSION} \ | ||
| trl==${TRL_VERSION} \ | ||
| peft==${PEFT_VERSION} \ | ||
| flash-attn==${FLASH_ATTN_VERSION} | ||
|
|
||
| # Override conflicting versions to satisfy datasets requirements | ||
| RUN pip install --no-cache-dir dill==0.3.8 multiprocess==0.70.16 \ | ||
| && pip install --no-cache-dir pathos==0.3.3 --no-deps \ | ||
| && PATHOS_META=$(find /usr/local/lib -type f -path "*pathos-0.3.3.dist-info/METADATA") \ | ||
| && sed -i 's/dill.*/dill/' $PATHOS_META \ | ||
| && sed -i 's/multiprocess.*/multiprocess/' $PATHOS_META | ||
|
|
||
|
|
||
| # hf_transfer will be a built-in feature, remove the env variable then | ||
| ENV HF_HUB_ENABLE_HF_TRANSFER="1" | ||
| ENV HF_HUB_USER_AGENT_ORIGIN="aws:sagemaker:gpu-cuda:training" | ||
|
|
||
| RUN apt-get update \ | ||
| && apt-get install -y --allow-change-held-packages --no-install-recommends \ | ||
| libgl1-mesa-glx \ | ||
| build-essential \ | ||
| ca-certificates \ | ||
| zlib1g-dev \ | ||
| openssl \ | ||
| python3-dev \ | ||
| pkg-config \ | ||
| check \ | ||
| curl \ | ||
| emacs \ | ||
| git \ | ||
| jq \ | ||
| unzip \ | ||
| vim \ | ||
| wget \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| COPY cuda-compatibility-lib.sh /usr/local/bin/cuda-compatibility-lib.sh | ||
| RUN chmod +x /usr/local/bin/cuda-compatibility-lib.sh | ||
|
|
||
| RUN apt-get update \ | ||
| && apt-get upgrade -y \ | ||
| && apt-get autoremove -y \ | ||
| && apt-get clean \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| RUN HOME_DIR=/root \ | ||
| && curl -o ${HOME_DIR}/oss_compliance.zip https://aws-dlinfra-utilities.s3.amazonaws.com/oss_compliance.zip \ | ||
| && unzip -o ${HOME_DIR}/oss_compliance.zip -d ${HOME_DIR}/ \ | ||
| && cp ${HOME_DIR}/oss_compliance/test/testOSSCompliance /usr/local/bin/testOSSCompliance \ | ||
| && chmod +x /usr/local/bin/testOSSCompliance \ | ||
| && chmod +x ${HOME_DIR}/oss_compliance/generate_oss_compliance.sh \ | ||
| && ${HOME_DIR}/oss_compliance/generate_oss_compliance.sh ${HOME_DIR} ${PYTHON} \ | ||
| && rm -rf ${HOME_DIR}/oss_compliance* |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.