Repository navigation
Move GPU CI from T4 to L40S - #6741
Conversation
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 970072b139
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
|
|
||
| test: | ||
| pytest -n auto -m "not slow and not low_priority" -s -v --reruns 5 --reruns-delay 1 --only-rerun '(OSError|Timeout|HTTPError.*502|HTTPError.*504|OutOfMemoryError)' tests | ||
| pytest -n 32 -m "not slow and not low_priority" -s -v --reruns 5 --reruns-delay 1 --only-rerun '(OSError|Timeout|HTTPError.*502|HTTPError.*504|OutOfMemoryError)' tests |
There was a problem hiding this comment.
Excessive hardcoded pytest workers
Medium Severity
make test now hardcodes pytest -n 32 instead of -n auto. The target CI host is aws-g6e-4xlarge with 16 vCPUs (and typically ~8 physical cores for -n auto), so this oversubscribes CPU and piles more workers onto a single 48 GB GPU. The same target is used locally, so developer machines also get forced to 32 workers. That raises OOM/flake riskβespecially with OutOfMemoryError already in the rerun filter and existing GPU cleanup aimed at xdist pressure.
Reviewed by Cursor Bugbot for commit 934b761. Configure here.
There was a problem hiding this comment.
The rationale in the description is about runner stability, but make test is the command we give contributors (CONTRIBUTING.md:166), so this also forces 32 workers on laptops with far fewer cores!
Only torch 2.13 has no build variant (huggingface/kernels-community#1082), so an unconditional marker would hide a real failure on older torch, e.g. in the minimum-versions job. Strict, like the other version-conditioned xfails in these files.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
β Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8e394f7. Configure here.
The minimum-versions job installs torch 2.13 but transformers 4.56, where the tests pass, so a strict marker turns that XPASS into a failure. The torch condition stays, so a failure on older torch is still reported.
What breaks is the kernel build that gets resolved, not the torch version: v1 and v2 have no CUDA variant for torch 2.13, and the v3 stable-ABI build raises in the backward pass for GQA models on any torch. Conditioning on torch 2.13 therefore turns red for anyone on an older torch with transformers main, which resolves v3 too.
|
|
||
| test: | ||
| pytest -n auto -m "not slow and not low_priority" -s -v --reruns 5 --reruns-delay 1 --only-rerun '(OSError|Timeout|HTTPError.*502|HTTPError.*504|OutOfMemoryError)' tests | ||
| pytest -n 32 -m "not slow and not low_priority" -s -v --reruns 5 --reruns-delay 1 --only-rerun '(OSError|Timeout|HTTPError.*502|HTTPError.*504|OutOfMemoryError)' tests |
There was a problem hiding this comment.
The rationale in the description is about runner stability, but make test is the command we give contributors (CONTRIBUTING.md:166), so this also forces 32 workers on laptops with far fewer cores!
albertvillanova
left a comment
There was a problem hiding this comment.
Thanks.
For the record about:
32 it's guaranteed, not incidental: xdist prefers psutil.cpu_count(logical=False) for auto, and psutil always comes in through accelerate, so it resolves to physical cores in every job (including the .[test]-only one), 32 on this runner.


Our GPU jobs run on
aws-g4dn-2xlarge(T4, Turing), which has no bf16 and no FlashAttention-2 β CI exercises fp16/eager paths that no user runs β and so little VRAM that we are capped at 4 test workers.aws-g4dn-2xlarge(before)aws-g6e-4xlarge(after)Multi-GPU jobs are unchanged on
aws-g5-12xlarge-cache(2Γ A10G, 23 GB each). One fix there:slow-tests.yml's multi-GPU job requestedCUDA_VISIBLE_DEVICES: "0,1"while pinned to the single-GPU T4 group, so the slow multi-GPU suite was never actually running on 2 GPUs β it now points at the same multi-GPU group astests.yml.Observed speedup
~5Γ on the same job, same test set:
Tests (3.13)Tests without optional dependenciesWhy hardcode 32 workers?
The
Makefilenow pinspytest -n 32instead of-n auto.Pinning keeps the worker count independent of whichever runner picks up the job. 32 is what
-n autoresolved to on this one.Why 32 is the right ceiling: CI historically ran 4 workers on 15 GB, i.e. ~3.8 GB of VRAM per test. 32 workers on 45 GB is ~1.4 GB per test β tighter, not looser β and it passes today. So transient OOM is a real possibility. If we hit it, the preferred fix is to chase the few high-VRAM tests; failing that (less preferable) we drop 32 β 24 β 16.
Known failures: the
kernels-community/flash-attn2tests, markedxfailtest_train_padding_free(SFT + DPO) andtest_vlm_training(GRPO, slow) are gated onis_ampere_or_newer(), so they have always been skipped on the T4 and are only now running for the first time. They fail for reasons unrelated to the hardware, both in the kernel:tiny-Qwen2ForCausalLM-2.5these tests train: flash-attn2 v3 (stable ABI): backward fails for GQA/MQAΒ kernels-community#1085.Marked non-strict
xfail, so they will simplyXPASSonce the kernel is usable again.Note
Low Risk
Changes are limited to CI runner labels and expected-failure markers on a few tests; no library training or runtime behavior is modified.
Overview
Moves single-GPU CI from
aws-g4dn-2xlarge(T4) toaws-g6e-4xlarge(L40S) acrosstests.yml,slow-tests.yml,tests-experimental.yml, andtests_transformers_branch.yml, so jobs run on Ada hardware with bf16 and Flash Attentionβcapable GPUs instead of Turing fp16/eager paths.Fixes slow multi-GPU CI in
slow-tests.ymlby pointingrun_all_tests_multi_gpuataws-g5-12xlarge-cache(matching other multi-GPU workflows) instead of the single-GPU T4 group while still settingCUDA_VISIBLE_DEVICES: "0,1".Leaves
tests_latest.ymlon T4 with a TODO to switch to L40S after v1.11 ships, because the pinnedv1.10-releasebranch lacks the new flash-attn2xfailmarkers and would fail on Ada.Marks three Ampere-gated kernel tests as
xfail(test_train_padding_freein SFT/DPO andtest_vlm_trainingin GRPO) now that they actually run on L40S; failures are attributed to upstreamkernels-community/flash-attn2issues (torch 2.13 builds and GQA backward), not the hardware move.Reviewed by Cursor Bugbot for commit fc41207. Bugbot is set up for automated code reviews on this repo. Configure here.