Skip to content

Commit

Permalink
Update .github/workflows to be more granular
Browse files Browse the repository at this point in the history
In most of the cases, splitting those is for the best and to reduce
execution time, assuming we tend to update the DLCs one at a time, so
it's not really probable for all the containers to change at once.

Pros: easier to manage, more granular, no need for extra `docker pull`s,
just runs what's modified

Cons: when modifying a bunch of tests it will be slower as `docker pull`
needs to be done per each test as instances are ephemeral
  • Loading branch information
alvarobartt committed Sep 9, 2024
1 parent b71a392 commit cb7ddb6
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 13 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/run-tests-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ on:
options:
- aws-general-8-plus
- aws-g4dn-2xlarge
tests-path:
description: "The path of the tests to run inside `tests`."
required: true
type: string
options:
- pytorch/training
- pytorch/inference
- tgi
- tei
training-dlc:
description: "The URI of the Hugging Face PyTorch DLC for Training (GPU only)."
required: false
Expand Down Expand Up @@ -54,7 +63,7 @@ jobs:
- name: Run Hugging Face DLC Tests
if:
run: uv run pytest -s tests/ --basetemp=${{ runner.temp }}
run: uv run pytest -s tests/${{ inputs.tests-path }} --basetemp=${{ runner.temp }}
env:
TRAINING_DLC: ${{ inputs.training-dlc }}
INFERENCE_DLC: ${{ inputs.inference-dlc }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
name: Test Hugging Face DLCs
name: Test Hugging Face PyTorch DLCs for Inference

on:
push:
branches:
- main
paths:
- tests/pytorch/inference/*
- .github/workflows/run-tests-reusable.yml
- .github/workflows/test-pytorch-inference-dlcs.yml
pull_request:
types:
- synchronize
- ready_for_review
branches:
- main
paths:
- tests/*
- pytest.ini
- tests/pytorch/inference/*
- .github/workflows/run-tests-reusable.yml
- .github/workflows/test-huggingface-dlcs.yml
- .github/workflows/test-pytorch-inference-dlcs.yml
workflow_dispatch:

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

jobs:
dlcs-on-cpu:
name: Run Hugging Face DLCs Tests on CPU
inference-on-cpu:
name: Test Hugging Face PyTorch DLCs for Inference on CPU
uses: huggingface/Google-Cloud-Containers/.github/workflows/run-tests-reusable.yml@add-integration-tests
with:
group: aws-general-8-plus
tests-path: pytorch/inference
inference-dlc: us-docker.pkg.dev/deeplearning-platform-release/gcr.io/huggingface-pytorch-inference-cpu.2-2.transformers.4-44.ubuntu2204.py311
tei-dlc: us-docker.pkg.dev/deeplearning-platform-release/gcr.io/huggingface-text-embeddings-inference-cpu.1-2

dlcs-on-gpu:
name: Run Hugging Face DLCs Tests on GPU
inference-on-gpu:
name: Test Hugging Face PyTorch DLCs for Inference on GPU
uses: huggingface/Google-Cloud-Containers/.github/workflows/run-tests-reusable.yml@add-integration-tests
with:
group: aws-g4dn-2xlarge
training-dlc: us-docker.pkg.dev/deeplearning-platform-release/gcr.io/huggingface-pytorch-training-cu121.transformers.4-42.ubuntu2204.py310
tests-path: pytorch/inference
inference-dlc: us-docker.pkg.dev/deeplearning-platform-release/gcr.io/huggingface-pytorch-inference-cu121.2-2.transformers.4-44.ubuntu2204.py311
tgi-dlc: us-docker.pkg.dev/deeplearning-platform-release/gcr.io/huggingface-text-generation-inference-cu121.2-2.ubuntu2204.py310
tei-dlc: us-docker.pkg.dev/deeplearning-platform-release/gcr.io/huggingface-text-embeddings-inference-cu122.1-4.ubuntu2204
34 changes: 34 additions & 0 deletions .github/workflows/test-pytorch-training-dlcs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test Hugging Face PyTorch DLCs for Training

on:
push:
branches:
- main
paths:
- tests/pytorch/training/*
- .github/workflows/run-tests-reusable.yml
- .github/workflows/test-pytorch-training-dlcs.yml
pull_request:
types:
- synchronize
- ready_for_review
branches:
- main
paths:
- tests/pytorch/training/*
- .github/workflows/run-tests-reusable.yml
- .github/workflows/test-pytorch-training-dlcs.yml
workflow_dispatch:

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

jobs:
training-on-gpu:
name: Test Hugging Face PyTorch DLCs for Training on GPU
uses: huggingface/Google-Cloud-Containers/.github/workflows/run-tests-reusable.yml@add-integration-tests
with:
group: aws-g4dn-2xlarge
tests-path: pytorch/training
training-dlc: us-docker.pkg.dev/deeplearning-platform-release/gcr.io/huggingface-pytorch-training-cu121.transformers.4-42.ubuntu2204.py310
42 changes: 42 additions & 0 deletions .github/workflows/test-text-embeddings-inference-dlcs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Test Hugging Face DLCs for TEI (CPU and GPU)

on:
push:
branches:
- main
paths:
- tests/tei/*
- .github/workflows/run-tests-reusable.yml
- .github/workflows/test-text-embeddings-inference-dlcs.yml
pull_request:
types:
- synchronize
- ready_for_review
branches:
- main
paths:
- tests/tei/*
- .github/workflows/run-tests-reusable.yml
- .github/workflows/test-text-embeddings-inference-dlcs.yml
workflow_dispatch:

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

jobs:
tei-on-cpu:
name: Test Hugging Face DLCs for TEI on CPU
uses: huggingface/Google-Cloud-Containers/.github/workflows/run-tests-reusable.yml@add-integration-tests
with:
group: aws-general-8-plus
tests-path: tei
tei-dlc: us-docker.pkg.dev/deeplearning-platform-release/gcr.io/huggingface-text-embeddings-inference-cpu.1-2

tei-on-gpu:
name: Test Hugging Face DLCs for TEI on GPU
uses: huggingface/Google-Cloud-Containers/.github/workflows/run-tests-reusable.yml@add-integration-tests
with:
group: aws-g4dn-2xlarge
tests-path: tei
tei-dlc: us-docker.pkg.dev/deeplearning-platform-release/gcr.io/huggingface-text-embeddings-inference-cu122.1-4.ubuntu2204
34 changes: 34 additions & 0 deletions .github/workflows/test-text-generation-inference-dlcs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test Hugging Face DLCs for TGI (GPU)

on:
push:
branches:
- main
paths:
- tests/tgi/*
- .github/workflows/run-tests-reusable.yml
- .github/workflows/test-text-generation-inference-dlcs.yml
pull_request:
types:
- synchronize
- ready_for_review
branches:
- main
paths:
- tests/tgi/*
- .github/workflows/run-tests-reusable.yml
- .github/workflows/test-text-generation-inference-dlcs.yml
workflow_dispatch:

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

jobs:
tgi-on-gpu:
name: Test Hugging Face DLCs for TGI on GPU
uses: huggingface/Google-Cloud-Containers/.github/workflows/run-tests-reusable.yml@add-integration-tests
with:
group: aws-g4dn-2xlarge
tests-path: tgi
tgi-dlc: us-docker.pkg.dev/deeplearning-platform-release/gcr.io/huggingface-text-generation-inference-cu121.2-2.ubuntu2204.py310

0 comments on commit cb7ddb6

Please sign in to comment.