Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 37 additions & 15 deletions .github/workflows/gpu-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,23 +101,43 @@ permissions:
contents: read

jobs:
# WHICH vLLM LINES TO TEST, read from the tested commit's own pyproject.toml
# rather than written here. Up to two legs, from the dependency groups `dev` and
# `dev-latest` (usually an alias: dev-latest = [{ include-group = "dev-vllm27" }]).
# Each is labelled `vllmNN` after the vLLM minor its requirements pin, which the
# GPU harness asserts the leg really installed; when both pin the same minor it
# is one leg. So moving to a new vLLM line is a pyproject edit and nothing else,
# this file is identical in every repo however far apart their vLLM lines are,
# and the pull request that makes the bump tests its own new lines.
#
# The rule and its refusals live in /opt/gsw/derive_legs.py, baked into the
# runner image like every other script. A pyproject that yields no legs fails
# here, before any GPU is asked for.
legs:
name: Resolve vLLM legs
runs-on: [self-hosted, gpu]
timeout-minutes: 5
outputs:
matrix: ${{ steps.legs.outputs.matrix }}
steps:
- name: Read the legs from pyproject.toml
id: legs
env:
GH_TOKEN: ${{ github.token }}
TARGET_SHA: ${{ inputs.sha || github.sha }}
run: /opt/gsw/derive_legs.py >> "$GITHUB_OUTPUT"

gpu-tests:
needs: legs
# The suite is in the job name because it cannot be read from env.LEG here --
# this is evaluated before any step runs.
name: GPU Tests (${{ matrix.label }} · ${{ inputs.suite || 'full' }})
# granite-switch supports two mutually-exclusive vLLM lines and both must be
# tested. They cannot share a venv (pyproject declares vllm26/vllm27 as
# conflicting groups), so each gets its own cluster pod. Only the dev* groups
# used because the bare vllm26/vllm27 groups omit pytest. The label encodes
# the vLLM minor the leg installs (the GPU harness asserts it matches).
# One pod per vLLM line: the lines cannot share a venv (pyproject declares the
# vllmNN groups as conflicting), and every one the repo supports must be tested.
strategy:
fail-fast: false # a vllm26 failure must not hide the vllm27 result
fail-fast: false # one line's failure must not hide another's result
matrix:
include:
- label: vllm26
dep_group: dev
- label: vllm27
dep_group: dev-vllm27
include: ${{ fromJSON(needs.legs.outputs.matrix) }}
runs-on: [self-hosted, gpu]

# MUST be set explicitly. GitHub's default is 360 minutes, which is exactly the
Expand Down Expand Up @@ -190,11 +210,13 @@ jobs:
SUFFIX="short"
LEG="$LABEL-short"
;;
# One fast file that still exercises the GPU — ~30s of pytest, a couple
# of minutes end to end once pod startup and uv sync are counted. A
# CPU-only pick would pass with a broken CUDA venv.
# One fast file that still exercises the GPU — a couple of minutes end to
# end once pod startup and uv sync are counted. A CPU-only pick would
# pass with a broken CUDA venv. This was test_single_switch.py until
# granite-switch #131 folded it into test_multi_switch.py; a path that
# no longer exists makes pytest collect nothing and fail every leg.
dev)
PATHS="tests/vllm/test_single_switch.py"
PATHS="tests/vllm/test_multi_switch.py"
SUFFIX="dev"
LEG="$LABEL-dev"
;;
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ vllm27 = ["vllm>=0.27.0,<0.28.0"]
# in before (integration tests failed with ModuleNotFoundError on a synced pod).
dev = ["pytest", "pytest-cov", { include-group = "vllm26" }, "granite-switch[hf,compose,audio]"]
dev-vllm27 = ["pytest", "pytest-cov", { include-group = "vllm27" }, "granite-switch[hf,compose,audio]"]
# The newest vLLM line, as an alias. The GPU workflow tests `dev` and `dev-latest`
# (one leg if both pin the same minor), so a vLLM bump is repointing this line.
dev-latest = [{ include-group = "dev-vllm27" }]
test = ["pytest", "pytest-cov", "bitsandbytes", "optimum-quanto", { include-group = "dev" }]

[tool.uv]
Expand All @@ -73,13 +76,17 @@ conflicts = [
[{ group = "dev" }, { group = "vllm27" }],
[{ group = "dev" }, { group = "dev-vllm27" }],
[{ group = "dev-vllm27" }, { group = "vllm26" }],
[{ group = "dev" }, { group = "dev-latest" }],
[{ group = "dev-latest" }, { group = "vllm26" }],
# group-vs-extra
[{ group = "vllm26" }, { extra = "vllm27" }],
[{ group = "vllm27" }, { extra = "vllm" }],
[{ group = "vllm27" }, { extra = "tutorials" }],
[{ group = "dev" }, { extra = "vllm27" }],
[{ group = "dev-vllm27" }, { extra = "vllm" }],
[{ group = "dev-vllm27" }, { extra = "tutorials" }],
[{ group = "dev-latest" }, { extra = "vllm" }],
[{ group = "dev-latest" }, { extra = "tutorials" }],
# extra-vs-extra
[{ extra = "vllm" }, { extra = "vllm27" }],
[{ extra = "tutorials" }, { extra = "vllm27" }],
Expand Down
Loading
Loading