Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasMoutawwakil committed Mar 9, 2025
1 parent 2945d87 commit 21b4e36
Showing 1 changed file with 151 additions and 0 deletions.
151 changes: 151 additions & 0 deletions .github/workflows/upstream_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
name: Upstream Integrations

on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *" # Run daily at 00:00 UTC

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
transformers:
name: Upstream Transformers
runs-on:
group: aws-dl1-24xlarge

container:
image: docker://vault.habana.ai/gaudi-docker/1.20.0/ubuntu22.04/habanalabs/pytorch-installer-2.6.0:latest
options: --runtime=habana --shm-size=64G --env HABANA_VISIBLE_DEVICES
env:
OMPI_MCA_btl_vader_single_copy_mechanism: none
RUN_THIRD_PARTY_DEVICE_TESTS: 1
TRANSFORMERS_TEST_DEVICE: hpu
PT_ENABLE_INT64_SUPPORT: 1
PT_HPU_LAZY_MODE: 0
RUN_SLOW: 1

steps:
- name: HL-SMI (1)
run: |
hl-smi
echo "HABANA_VISIBLE_DEVICES=${HABANA_VISIBLE_DEVICES}"
echo "HABANA_VISIBLE_MODULES=${HABANA_VISIBLE_MODULES}"
- name: Extract HPU visible modules
id: add-modules
run: |
export HABANA_VISIBLE_MODULES=$(hl-smi -Q module_id -f csv,noheader | tr '\n' ',' | sed 's/,$//')
echo "HABANA_VISIBLE_MODULES=${HABANA_VISIBLE_MODULES}" >> $GITHUB_ENV
- name: HL-SMI (2)
run: |
hl-smi
echo "HABANA_VISIBLE_DEVICES=${HABANA_VISIBLE_DEVICES}"
echo "HABANA_VISIBLE_MODULES=${HABANA_VISIBLE_MODULES}"
- name: Checkout to Transformers
uses: actions/checkout@v4
with:
ref: hpu-support
repository: huggingface/transformers

- name: Install Transformers with Accelerate and DeepSpeed
run: |
pip install -e .[testing] "numpy<2.0.0" scipy scikit-learn \
git+https://github.com/huggingface/accelerate.git@hpu-support \
git+https://github.com/HabanaAI/DeepSpeed.git@1.20.0
- name: Run Trainer tests
run: |
pytest tests/trainer/test_trainer.py -s -vvvv
- name: Run Trainer Utils tests
run: |
pytest tests/trainer/test_trainer_utils.py -s -vvvv
- name: Run Trainer Seq2Seq tests
run: |
pytest tests/trainer/test_trainer_seq2seq.py -s -vvvv
- name: Run Trainer Distributed tests
run: |
pytest tests/trainer/test_trainer_distributed.py -s -vvvv
- name: Run FSDP Integration tests
run: |
pytest tests/fsdp/test_fsdp.py tests/trainer/test_trainer_fsdp.py -s -vvvv
- name: Run DeepSpeed Integration tests
run: |
pytest tests/deepspeed/test_deepspeed.py -s -vvvv
accelerate:
name: Upstream Accelerate
runs-on:
group: aws-dl1-24xlarge

container:
image: docker://vault.habana.ai/gaudi-docker/1.20.0/ubuntu22.04/habanalabs/pytorch-installer-2.6.0:latest
options: --runtime=habana --shm-size=64G --cap-add=sys_nice --env HABANA_VISIBLE_DEVICES
env:
OMPI_MCA_btl_vader_single_copy_mechanism: none
PT_ENABLE_INT64_SUPPORT: 1
PT_HPU_LAZY_MODE: 0
RUN_SLOW: 1

steps:
- name: HL-SMI (1)
run: |
hl-smi
echo "HABANA_VISIBLE_DEVICES=${HABANA_VISIBLE_DEVICES}"
echo "HABANA_VISIBLE_MODULES=${HABANA_VISIBLE_MODULES}"
- name: Extract HPU visible modules
id: add-modules
run: |
export HABANA_VISIBLE_MODULES=$(hl-smi -Q module_id -f csv,noheader | tr '\n' ',' | sed 's/,$//')
echo "HABANA_VISIBLE_MODULES=${HABANA_VISIBLE_MODULES}" >> $GITHUB_ENV
- name: HL-SMI (2)
run: |
hl-smi
echo "HABANA_VISIBLE_DEVICES=${HABANA_VISIBLE_DEVICES}"
echo "HABANA_VISIBLE_MODULES=${HABANA_VISIBLE_MODULES}"
- name: Checkout to Accelerate
uses: actions/checkout@v4
with:
ref: hpu-support
repository: huggingface/accelerate

- name: Install Accelerate with Transformers and DeepSpeed
run: |
pip install -e .[testing] \
git+https://github.com/HabanaAI/DeepSpeed.git@1.20.0 \
git+https://github.com/huggingface/transformers.git@hpu-support
- name: Run CLI tests
run: |
make test_cli
- name: Run Core tests
run: |
make test_core
- name: Run Big Modeling tests
run: |
make test_big_modeling
- name: Run FSDP integration tests
run: |
make test_fsdp
- name: Run DeepSpeed integration tests
run: |
make test_deepspeed
- name: Run Examples tests
run: |
make test_examples

0 comments on commit 21b4e36

Please sign in to comment.