Unverified Commit 073baf7f authored by Yih-Dar's avatar Yih-Dar Committed by GitHub
Browse files

Install `accelerete@main` in PyTorch Past CI jobs (#22963)



fix
Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
parent e4a97f82
...@@ -126,6 +126,12 @@ jobs: ...@@ -126,6 +126,12 @@ jobs:
run: | run: |
nvidia-smi nvidia-smi
- name: Install
if: inputs.framework == 'pytorch'
working-directory: /transformers
run: |
python3 -m pip install --no-cache-dir git+https://github.com/huggingface/accelerate@main#egg=accelerate
- name: Environment - name: Environment
working-directory: /transformers working-directory: /transformers
run: | run: |
...@@ -192,6 +198,12 @@ jobs: ...@@ -192,6 +198,12 @@ jobs:
run: | run: |
nvidia-smi nvidia-smi
- name: Install
if: inputs.framework == 'pytorch'
working-directory: /transformers
run: |
python3 -m pip install --no-cache-dir git+https://github.com/huggingface/accelerate@main#egg=accelerate
- name: Environment - name: Environment
working-directory: /transformers working-directory: /transformers
run: | run: |
...@@ -243,6 +255,11 @@ jobs: ...@@ -243,6 +255,11 @@ jobs:
working-directory: /transformers working-directory: /transformers
run: git fetch && git checkout ${{ github.sha }} run: git fetch && git checkout ${{ github.sha }}
- name: Install
working-directory: /transformers
run: |
python3 -m pip install --no-cache-dir git+https://github.com/huggingface/accelerate@main#egg=accelerate
- name: Remove cached torch extensions - name: Remove cached torch extensions
run: rm -rf /github/home/.cache/torch_extensions/ run: rm -rf /github/home/.cache/torch_extensions/
......
...@@ -27,8 +27,7 @@ ARG VERSION ...@@ -27,8 +27,7 @@ ARG VERSION
RUN [ "$VERSION" != "1.9" -a "$VERSION" != "1.10" ] && python3 -m pip install -U setuptools || python3 -m pip install -U "setuptools<=59.5" RUN [ "$VERSION" != "1.9" -a "$VERSION" != "1.10" ] && python3 -m pip install -U setuptools || python3 -m pip install -U "setuptools<=59.5"
# Remove all frameworks # Remove all frameworks
# (`accelerate` requires `torch`, and this causes import issues for TF-only testing) RUN python3 -m pip uninstall -y torch torchvision torchaudio tensorflow jax flax
RUN python3 -m pip uninstall -y torch torchvision torchaudio accelerate tensorflow jax flax
# Get the libraries and their versions to install, and write installation command to `~/.profile`. # Get the libraries and their versions to install, and write installation command to `~/.profile`.
RUN python3 ./transformers/utils/past_ci_versions.py --framework $FRAMEWORK --version $VERSION RUN python3 ./transformers/utils/past_ci_versions.py --framework $FRAMEWORK --version $VERSION
...@@ -39,6 +38,10 @@ RUN $INSTALL_CMD ...@@ -39,6 +38,10 @@ RUN $INSTALL_CMD
RUN [ "$FRAMEWORK" != "pytorch" ] && echo "`deepspeed-testing` installation is skipped" || python3 -m pip install --no-cache-dir ./transformers[deepspeed-testing] RUN [ "$FRAMEWORK" != "pytorch" ] && echo "`deepspeed-testing` installation is skipped" || python3 -m pip install --no-cache-dir ./transformers[deepspeed-testing]
# Remove `accelerate`: it requires `torch`, and this causes import issues for TF-only testing
# We will install `accelerate@main` in Past CI workflow file
RUN python3 -m pip uninstall -y accelerate
# Uninstall `torch-tensorrt` and `apex` shipped with the base image # Uninstall `torch-tensorrt` and `apex` shipped with the base image
RUN python3 -m pip uninstall -y torch-tensorrt apex RUN python3 -m pip uninstall -y torch-tensorrt apex
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment