Skip to content

[llm] Backport deferred Triton validation for frontends - #67174

Merged
jeffreywang88 merged 4 commits into
ray-project:masterfrom
jeffreywang88:cpu-ingress-tokenizer
Oct 22, 2026
Merged

jeffreywang88 merged 4 commits into
ray-project:masterfrom
jeffreywang88:cpu-ingress-tokenizer

Conversation

@jeffreywang88

@jeffreywang88 jeffreywang88 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Description

Backport the vLLM fix that defers MRV2’s Triton availability check until worker startup.

With KVAwareRouter, each proxy node constructs a full VllmConfig for prompt rendering. On a CPU-only head, configurations such as DFlash2 can fail validation because no Triton driver is available. The head’s LLMRouter then fails to start, leaving HAProxy on load-only routing.

  • Apply the backport in CI and release images using the existing patch infrastructure.
  • Add a standalone frontend-config release test using the existing CPU-head/L4-worker cluster configuration.
  • Verify that a real deployment serves a request and performs pre-routing tokenization on the head. A successful response alone would miss load-only fallback.

Related issues

Upstream fix: vllm-project/vllm#62576

Additional information

AI assistance was used.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a patch to defer Triton validation in vLLM to the GPU worker initialization phase, allowing CPU frontends to build configurations without requiring Triton. It also adds a new release test to verify this behavior on CPU-only head nodes. The review feedback correctly identifies a bug in the new test where awaiting results_async() directly will raise a TypeError because it returns an async generator, and suggests using an async list comprehension to collect the results instead.

assert response.status_code == 200, response.text
assert response.json()["usage"]["completion_tokens"] > 0
router = serve.get_deployment_handle("LLMRouter", app_name=app_name)
reports = await router.broadcast("get_token_push_report").results_async()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Awaiting results_async() directly will raise a TypeError because results_async() is an async generator (returning an AsyncIterator), which cannot be awaited. Instead, you should use an async list comprehension to collect the results from the generator.

        reports = [
            report
            async for report in router.broadcast(\"get_token_push_report\")
        ]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False positive -- there's no yield in results_async:

async def results_async(
self,
*,
timeout_s: Optional[float] = None,
return_exceptions: bool = False,
) -> List[Any]:
"""Fetch results from all replicas asynchronously.
Args:
timeout_s: Timeout in seconds for the full broadcast collection.
If ``None``, waits indefinitely.
return_exceptions: If ``False`` (default), raise on replica
exception. If ``True``, collect exceptions in the returned list
instead of raising.
Returns:
A list of results, one per replica.
Raises:
TimeoutError: If the timeout is exceeded.
"""
if timeout_s is not None and timeout_s < 0:
raise ValueError("timeout_s must be None or non-negative.")
start_time_s = time.time()
if timeout_s is not None:
try:
replica_results = await asyncio.wait_for(
self._fetch_replica_results_async(),
timeout=timeout_s,
)
except asyncio.TimeoutError:
raise TimeoutError("Timed out waiting for broadcast results.") from None
else:
replica_results = await self._fetch_replica_results_async()
gather_coro = asyncio.gather(
*[rr.get_async() for rr in replica_results],
return_exceptions=return_exceptions,
)
remaining_timeout_s = calculate_remaining_timeout(
timeout_s=timeout_s,
start_time_s=start_time_s,
curr_time_s=time.time(),
)
if remaining_timeout_s is not None:
try:
return list(
await asyncio.wait_for(gather_coro, timeout=remaining_timeout_s)
)
except asyncio.TimeoutError:
raise TimeoutError("Timed out waiting for broadcast results.") from None
return list(await gather_coro)

Co-authored-by: Codex <[email protected]>
Signed-off-by: Jeffrey Wang <[email protected]>
@jeffreywang88 jeffreywang88 added the go add ONLY when ready to merge, run all tests label Oct 20, 2026
@ray-gardener ray-gardener Bot added serve Ray Serve Related Issue release-test release test llm labels Oct 20, 2026
@jeffreywang88

Copy link
Copy Markdown
Contributor Author

@kouroshHakha kouroshHakha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. Just address Gemini (maybe)

@jeffreywang88
jeffreywang88 enabled auto-merge (squash) October 22, 2026 20:10
@jeffreywang88
jeffreywang88 merged commit 32d08fc into ray-project:master Oct 22, 2026
7 checks passed
jeffreywang88 added a commit that referenced this pull request Oct 27, 2026
…7436)

## Description

#67197 bumped vLLM to 0.32.0 but did not refresh
vllm-defer-triton-validation.patch (added in #67174 against 0.31), so
`git apply` fails in the llmbuild / llmgpubuild / llmbuild (aarch64)
images:

```
    error: patch failed: vllm/config/vllm.py:743
    error: patch failed: vllm/v1/worker/gpu_worker.py:68
```

Regenerate the patch against vLLM 0.32.0. Besides line offsets, 0.32.0
dropped the ROCm block in `VllmConfig.use_v2_model_runner` that had
imported `current_platform` into scope, so the patch now imports it
locally before the `is_unspecified()` check (a context-only rebase would
`NameError` at runtime).

## Related issues
> Link related issues: "Fixes #1234", "Closes #1234", or "Related to
#1234".

## Additional information
> Optional: Add implementation details, API changes, usage examples,
screenshots, etc.

Co-authored-by: Claude Opus 5.5 <[email protected]>
justinyeh1995 pushed a commit to justinyeh1995/ray that referenced this pull request Oct 28, 2026
…y-project#67436)

## Description

ray-project#67197 bumped vLLM to 0.32.0 but did not refresh
vllm-defer-triton-validation.patch (added in ray-project#67174 against 0.31), so
`git apply` fails in the llmbuild / llmgpubuild / llmbuild (aarch64)
images:

```
    error: patch failed: vllm/config/vllm.py:743
    error: patch failed: vllm/v1/worker/gpu_worker.py:68
```

Regenerate the patch against vLLM 0.32.0. Besides line offsets, 0.32.0
dropped the ROCm block in `VllmConfig.use_v2_model_runner` that had
imported `current_platform` into scope, so the patch now imports it
locally before the `is_unspecified()` check (a context-only rebase would
`NameError` at runtime).

## Related issues
> Link related issues: "Fixes ray-project#1234", "Closes ray-project#1234", or "Related to
ray-project#1234".

## Additional information
> Optional: Add implementation details, API changes, usage examples,
screenshots, etc.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests llm release-test release test serve Ray Serve Related Issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants