Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

bwasti
Copy link
Contributor

@bwasti bwasti commented Oct 14, 2025

Environment variable VLLM_KERNEL_OVERRIDE_BATCH_INVARIANT -> VLLM_BATCH_INVARIANT
Internal flag: vllm_kernel_override_batch_invariant() -> vllm_is_batch_invariant()

Purpose

Simplify usage across the stack.

Test Plan

Rebuild for the C++ component:

CCACHE_NOHASHDIR="true"  uv pip install -e . --no-build-isolation -v

pytest -s -v tests/v1/generation/test_batch_invariance.py -k test_logprobs_bitwise_batch_invariance_bs1_vs_bsN

Test Result

Pass.


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

Copy link
Contributor

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

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 primarily renames an environment variable and an internal function related to batch invariance to simplify their usage. However, it also introduces a substantial set of changes to properly implement and enforce this batch invariance feature across the codebase. This includes adding deterministic custom kernels for operations like RMS norm and matrix multiplication, disabling potentially non-deterministic optimizations when the feature is active, and significantly expanding the test suite to validate the deterministic behavior. The changes are well-structured and align with the goal of ensuring bit-for-bit determinism, which is valuable for debugging and testing. The new tests for the RMS norm implementation are particularly thorough. I have one suggestion to improve the robustness of the new deterministic matrix multiplication function.

vllm/model_executor/layers/batch_invariant.py Show resolved Hide resolved
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ 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 👍.

vllm/model_executor/layers/batch_invariant.py Show resolved Hide resolved
@bwasti bwasti force-pushed the det_rename branch 3 times, most recently from be130ac to bc96863 Compare October 15, 2025 21:26
@bwasti bwasti requested a review from zou3519 as a code owner October 15, 2025 21:26
@bwasti bwasti force-pushed the det_rename branch 2 times, most recently from 35cb4b4 to 7e7bc78 Compare October 16, 2025 15:20
Signed-off-by: Bram Wasti <bwasti@meta.com>
@bwasti bwasti moved this to In Progress in Batch-invariant Inference Oct 16, 2025
Copy link
Member

@yewentao256 yewentao256 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the work!

@github-project-automation github-project-automation bot moved this from To Triage to Ready in gpt-oss Issues & Enhancements Oct 16, 2025
@yewentao256 yewentao256 self-assigned this Oct 16, 2025
@yewentao256 yewentao256 added the ready ONLY add when PR is ready to merge/full CI is needed label Oct 16, 2025
@yewentao256 yewentao256 enabled auto-merge (squash) October 16, 2025 15:28
@yewentao256 yewentao256 merged commit b2f78cb into vllm-project:main Oct 16, 2025
85 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gpt-oss Related to GPT-OSS models ready ONLY add when PR is ready to merge/full CI is needed v1

Projects

Status: In Progress
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.