Repository navigation
[ci][llm] Migrate LLM tests to the reserved H100 cluster - #67525
Conversation
There was a problem hiding this comment.
Code Review
This pull request migrates LLM tests and benchmarks to run on H100 GPUs (rkn-gpu-cloud) and updates the default test model to Qwen/Qwen3.5-0.8B across various configurations, documentation examples, and test suites. It also introduces a new CI script and Dockerfile to manage these H100 test runs. Feedback on the changes highlights critical runtime issues in rlhf_utils.py where an incorrect model class (AutoModelForImageTextToText) is used for the text-only Qwen model. Additionally, potential KeyError crashes were identified in llm_tests_h100.py when run outside of Buildkite, and in run_llm_serve_test_and_bms.py if an unsupported number of GPUs is encountered.
| print("No LLM GPU tests selected; skipping the H100 job.") | ||
| return | ||
|
|
||
| image_uri = get_docker_image(f"{build_name}-h100-{os.environ['BUILDKITE_JOB_ID']}") |
There was a problem hiding this comment.
Using os.environ['BUILDKITE_JOB_ID'] directly will raise a KeyError if the script is run locally or in a non-Buildkite environment. It is safer to use os.environ.get('BUILDKITE_JOB_ID', 'local') or define a fallback variable.
buildkite_job_id = os.environ.get("BUILDKITE_JOB_ID", "local")
image_uri = get_docker_image(f"{build_name}-h100-{buildkite_job_id}")| bazel_runfile(f"release/llm_tests/cluster_compute/{args.gpus}xh100.yaml") | ||
| ) | ||
| config = { | ||
| "name": f"llm-ci-{os.environ['BUILDKITE_JOB_ID']}", |
| instance_types = { | ||
| 1: "23CPU-240GB-1xH100", | ||
| 2: "46CPU-480GB-2xH100", | ||
| 4: "92CPU-960GB-4xH100", | ||
| } |
There was a problem hiding this comment.
If num_gpus is not 1, 2, or 4 (for example, if it is 8), accessing instance_types[num_gpus] will raise a KeyError. It is safer to validate num_gpus and raise a descriptive error message.
instance_types = {
1: "23CPU-240GB-1xH100",
2: "46CPU-480GB-2xH100",
4: "92CPU-960GB-4xH100",
}
if num_gpus not in instance_types:
raise ValueError(
f"Unsupported number of GPUs: {num_gpus}. "
f"Supported values are {list(instance_types.keys())}."
)Signed-off-by: Jeffrey Wang <[email protected]>
71f1abb to
d6bc9d0
Compare
|
@elliot-barn will set up a new GPU buildkite queue, and I'll update this PR to use that queue instead. |
|
A few things from a docs and CI-routing read, beyond what the bots already flagged: 1. Changes to the new launcher won't run the tests it launches. In The compute-config pattern would also need to come before 2. Some doc example edits change the published pages but don't help CI.
+1 to dropping 3. Test failure logs stay on the remote node. 4. Queue time counts against the timeout. Only release tests get the 5. Minor: 6. A question on the IAM policy in the description: it's attached to the whole Separately, I opened #67557. It adds a |
|
Chatted with @elliot-barn @sai-miduthuri offline -- the current CI infra assumes tests run in containers on plain EC2 instances, which doesn't align with how the reserved H100 pool is set up. All reserved H100 instances are managed by an EKS cluster. I'll move all LLM GPU CI tests to release tests so they can run on the H100 EKS cluster, and audit which tests should always run, acting like premerge although they are under cc: @kouroshHakha |
## Why are these changes needed? Some docs and CI infrastructure files select GPU test steps even though a change to them can't affect GPU behavior. The clearest case is `doc/BUILD.bazel`: `.buildkite/test.rules.txt` routes it to `core_doc data_doc ml_doc rllib_doc serve_doc llm`, so a one-line edit there starts the Ray Data and Ray Serve docs example GPU steps and every LLM GPU step, plus the GPU images they need. #67525 moves the LLM GPU steps onto a reserved H100 pool that release tests also use, so an incidental run now costs pool capacity, not only runner time. rayci v0.51.0, the version `.rayciversion` pins, supports `skip_tags_when_present` in `.buildkite/*.labels.yaml`. This PR uses it to add an opt-out label. ## What changes - **Adds a `skip-gpu-tests` rule** to `.buildkite/docs.labels.yaml`. With the label, rayci skips every step tagged `gpu`, in every library, along with the images only those steps need. Because label rules apply before rayci marks step dependencies, the GPU images don't build either. Without the label, nothing changes. - **Documents the `skip_tags_when_present` mode** in the file's header comment, next to the two modes it already describes. - **Documents the label** in `doc/source/ray-contribute/ci.md`: a new "Skipping GPU tests" section, with when not to use it, and a mention in "Why some steps show as broken". ## Scope decision to review The rule skips the shared `gpu` tag, not an LLM-only tag. `gpu` is on 19 steps across core, data, ml, rllib, serve, and llm. For the case this targets, a `doc/BUILD.bazel` edit, that's the right scope, because the same edit also selects the Data and Serve docs example GPU steps. An LLM-only valve would need a new tag on the LLM GPU steps, which #67525 is rewriting. If reviewers prefer that narrower scope, the rule can switch to that tag once #67525 lands. The label is a judgment call by whoever applies it, and it needs write access. Scheduled post-merge builds carry no PR labels, so they still run every GPU step. A GPU failure the label hides surfaces there, after merge. ## Related issues Related to #67525, which migrates the LLM GPU steps to H100s. This PR doesn't depend on it: the new 2-GPU step in #67525 carries the `gpu` tag, so the rule covers it once it lands. ## Duplicate check No open PR adds a label rule or a GPU opt-out. I searched open PRs for `labels.yaml` and for GPU-skip labels. #67341 introduced `docs.labels.yaml` with the `docstring-only` and `docs-example-test` rules, and this PR follows its pattern. ## Testing I built rayci v0.51.0 locally and generated the PR pipeline for a simulated PR that changes only `doc/BUILD.bazel`, with this branch's `docs.labels.yaml` as the base: | Labels | Selected tags | Steps | |---|---|---| | `go` | `always core_doc data_doc lint llm ml_doc rllib_doc serve_doc` | 61 | | `go`, `skip-gpu-tests` | same | 51 | The label drops exactly these 10 steps, and the two pipelines are otherwise identical: - `:database: data: docs example gpu tests` - `:ray-serve: serve: docs example gpu tests` - `llm gpu tests`, `llm gpu tests (4 GPUs)`, `llm custom vllm plugin gpu test` - The images only they need: `oss-ci-base_gpu-py3.10`, `oss-ci-base_cu130-py3.12`, `docgpubuild-py3.10`, `llmgpubuild`, `custom-vllm-plugin-gpubuild` `pre-commit run` on the changed files passes. Two follow-ups if this merges: - A maintainer needs to create the `skip-gpu-tests` label on the repo. - `.buildkite/docs.labels.yaml` matches no rule in `test.rules.txt`, so this PR falls through to the catch-all `*` and runs a broad premerge. That's unchanged from #67341. A rule for `.buildkite/*.labels.yaml` could narrow it, but it belongs in its own change. This PR was prepared with AI assistance (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeffrey Wang <[email protected]>
Signed-off-by: Jeffrey Wang <[email protected]>
Signed-off-by: Jeffrey Wang <[email protected]>
Signed-off-by: Jeffrey Wang <[email protected]>
Signed-off-by: Jeffrey Wang <[email protected]>
Signed-off-by: Jeffrey Wang <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ce48c0d. Configure here.
Signed-off-by: Jeffrey Wang <[email protected]>
Signed-off-by: Jeffrey Wang <[email protected]>
Signed-off-by: Jeffrey Wang <[email protected]>
Signed-off-by: Jeffrey Wang <[email protected]>
| @@ -350,249 +348,6 @@ async def test_vllm_wrapper_uses_explicit_multimodal_data(): | |||
| assert request.multimodal_data == {"image": [sentinel_image]} | |||
|
|
|||
|
|
|||
| @pytest.mark.asyncio | |||
There was a problem hiding this comment.
Note: These tests are all moved to release/llm_tests/batch/test_batch_vllm_engine.py.
| @@ -1,621 +0,0 @@ | |||
| import sys | |||
There was a problem hiding this comment.
Note: These tests are moved to 2 places.
- 8 CPU tests →
python/ray/llm/tests/batch/cpu/processor/test_vllm_engine_proc.py - 6 GPU tests →
release/llm_tests/batch/test_batch_vllm.py.test_generation_modelwas consolidated intotest_chat_template_with_vllm, preserving all 3 executor backends(uni, mp, ray). I confirmed that no coverage was dropped.
|
|
||
|
|
||
| @pytest.fixture | ||
| def create_model_opt_125m_deployment(gpu_type, model_opt_125m, serve_cleanup): |
There was a problem hiding this comment.
Note: this test is rewritten and moved to create_model_qwen3_5_0_8b_deployment.
| min_nodes: 0 | ||
| max_nodes: 1 |
There was a problem hiding this comment.
Why do we allow autoscaling?
There was a problem hiding this comment.
[claude] The CPU launcher and deployed service share this compute config. min_nodes: 0 keeps the launcher GPU-free; service demand adds at most 1 H100 worker. This does not enable model-replica autoscaling.
| - instance_type: 23CPU-240GB-1xH100 | ||
| min_nodes: 0 | ||
| max_nodes: 8 |
There was a problem hiding this comment.
Why do we allow autoscaling? Why don't we just use the 8xH100 instance? Which test uses this compute config?
There was a problem hiding this comment.
[claude] Used by the 2-prefill/6-decode tests: normal, direct-streaming, and manual LMCache. min_nodes: 0 keeps the CPU launcher GPU-free; the service requests 8 workers. A single 8-H100 worker could also work; separate workers are not required by these TP=1 configurations.
| ray.init( | ||
| runtime_env={"py_modules": [str(Path(__file__).with_name("rlhf_utils.py"))]} | ||
| ) |
There was a problem hiding this comment.
Why are we changing this and what happens in if __name__ == "__main__"?
There was a problem hiding this comment.
[claude] py_modules ships rlhf_utils.py to remote actors; otherwise they fail to import it. The marker records 2 inference GPUs + 1 trainer GPU. When run as a script, __main__ invokes pytest; SystemExit forwards its exit code so a failing test cannot report job success.
| timeout: 3600 | ||
| script: pytest -vs test_frontend_config.py | ||
|
|
||
| variations: |
There was a problem hiding this comment.
[P1] Attach GPU variations to the KV-router suite
These variations are nested under llm_serve_kv_router_frontend_config, so they split the wrong test and replace that frontend job’s test_frontend_config.py command with the full suite. Meanwhile, the preceding llm_serve_kv_router job still runs the newly marked requires_2GPU classes on its single-H100 cluster. Please move this block to the preceding KV-router definition so each marker uses the matching cluster.
Signed-off-by: Jeffrey Wang <[email protected]>
Signed-off-by: Jeffrey Wang <[email protected]>
#67525 moved the Ray LLM docs examples off GPU CI and into the nightly llm_doc_tests release test on H100s. ci.md still said the scheduled post-merge builds run them, and listed a Ray LLM GPU docs step that no longer exists. Signed-off-by: Douglas Strodtman <[email protected]>
#67525 moved the Ray LLM docs examples off Bazel GPU targets and into the nightly llm_doc_tests release tests, and deleted the batch notebooks' BUILD.bazel. The doc/source/*/llm/*BUILD.bazel rule and its expectation described a file that no longer exists by design, and the rules comments still said the postmerge build runs these examples. - Remove the llm BUILD.bazel rule and its test.rules.test.txt expectation. - Say in both rules comments that the llm_doc_tests release tests run them. - Point the GPU-target fixture in test_doc_example_targets.py at a real Ray Data GPU notebook target instead of the removed LLM one. Signed-off-by: Douglas Strodtman <[email protected]>
Only the custom vLLM doc example Bazel target carried this tag, and #67525 deleted that target when it moved the LLM docs examples to the nightly llm_doc_tests release tests. No target uses the tag now. Signed-off-by: Douglas Strodtman <[email protected]>

Overview
rkn-gpu-cloudH100s. No more GPU CIs.default-queue, and cap release concurrency at 4.Qwen3.5-0.8Bfor generic tests and public S3 adapters for serve LoRA tests.Manual permissions
The H100 operator role received:
sts:AssumeRoleon the Firehose writer role; that role’s trust policy now accepts the H100 operator.s3:GetObjectands3:PutObjectons3://rayllm-ci-results/vllm_perf_results/*; the bucket policy grants matching access.Test changes
LoRA test changes
Replace gated Llama serve LoRA fixtures with
Qwen3.5-0.8Band adapters we generated ats3://air-example-data/rayllm-ossci/lora/qwen3.5-0.8b/v2/. Public artifacts remove the HF-secret requirement. Retain 4 adapter aliases and verify adapter-specific output against the base model.Custom vLLM plugin
Replace
ci/docker/custom-vllm-plugin.build.Dockerfilewith plugin installation inllm_doc_tests'srun.prepare. Both custom-vLLM examples stay in place and run throughdoc/test_llm_examples.pyon 1 H100 using the release LLM image.RLHF test changes
In
release/llm_tests/serve/test_llm_serve_rlhf.py, switch OPT to Qwen3.5-0.8B and mark the 3-GPU requirement (2 inference + 1 trainer). Shiprlhf_utils.pythrough Ray's runtime environment so remote actors can import it. Propagate pytest's exit code so failures fail the release job instead of reporting success.Test migration
Coverage checklist: 77/77 source test functions, 24 doc examples, and 2 notebooks.
Batch: source paths below are under
python/ray/llm/tests/batch/gpu/. CPU counterparts keep the relative path underbatch/cpu/; release destinations are underrelease/llm_tests/batch/.processor/test_serve_deployment_proc.py: 3 tests → CPU counterpart; 3 →test_batch_serve_deployment.py.processor/test_sglang_engine_proc.py: all 4 → CPU counterpart.processor/test_vllm_engine_proc.py: 8 → CPU counterpart; 6 →test_batch_vllm.py.test_generation_modelconsolidates intotest_chat_template_with_vllm, retaining all 3 executor backends.stages/test_serve_deployment_stage.py: all 11 → CPU counterpart.stages/test_sglang_engine_stage.py: all 5 → CPU counterpart.stages/test_vllm_engine_stage.py: 13 → CPU counterpart; 7 →test_batch_vllm_engine.py.Serve: source paths below are under
python/ray/llm/tests/serve/gpu/. Release destinations are underrelease/llm_tests/serve/.deployments/llm/vllm/test_config_congruence.py: 1 →test_llm_serve_config_congruence.py.deployments/llm/vllm/test_vllm_engine_gpu.py: 1 →test_llm_serve_resource_bundles.py.deployments/llm/prefill_decode_disagg/test_prefill_decode_disagg_gpu.py: 1 → CPU counterpart, renamedtest_prefill_decode_disagg.py.integration/test_openai_compatibility.py: all 11 → CPU counterpart; normal and direct-streaming targets retained.integration/test_openai_compatibility_no_accelerator_type.py: all 3 → CPU counterpart.Docs: all 24 Python examples and 2 notebooks remain in place;
doc/test_llm_examples.pyreplaces their Bazel GPU execution.llm_doc_tests, including both custom-vLLM examples and both batch notebooks.llm_doc_2GPU_tests.llm_doc_4GPU_tests.*_llama_paralleltests are renamed*_qwen_parallelwith their parameterizations retained.Additional information
Validation: Kicked off release tests under group
llm-serve,llm-batch, and a new groupingllm-doc.This PR is assisted by Claude, and I reviewed every line of changes.