Skip to content

[ROCm] Migrate xgrammar to upstream release#31327

Merged
vllm-bot merged 2 commits intovllm-project:mainfrom
ROCm:akaratza_xgrammar_requirement
Dec 28, 2025
Merged

[ROCm] Migrate xgrammar to upstream release#31327
vllm-bot merged 2 commits intovllm-project:mainfrom
ROCm:akaratza_xgrammar_requirement

Conversation

@AndreasKaratzas
Copy link
Copy Markdown
Collaborator

@AndreasKaratzas AndreasKaratzas commented Dec 25, 2025

This PR updates the xgrammar dependency in requirements/rocm-test.txt from a custom fork to the upstream PyPI release.

Changes

  • Replaced xgrammar @ git+https://github.com/divakar-amd/xgrammar@3272f7c... with xgrammar==0.1.29

Motivation

It's better practice to use upstream repositories instead of maintaining custom forks when possible. This is a follow-up to a comment from #29702 to eventually migrate to the upstream xgrammar repo.

Testing

Verified on ROCm with the following tests passing:

pytest -v -s tests/v1/e2e/test_async_scheduling.py
pytest -v -s tests/v1/entrypoints/llm/test_struct_output_generate.py::test_structured_output_auto_mode[Qwen/Qwen2.5-1.5B-Instruct-auto]
pytest -v -s tests/v1/e2e/test_spec_decode.py

Signed-off-by: Andreas Karatzas <akaratza@amd.com>
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.

@mergify mergify bot added ci/build rocm Related to AMD ROCm labels Dec 25, 2025
Copy link
Copy Markdown
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 updates the xgrammar dependency in requirements/rocm-test.txt from a forked repository to the official PyPI release xgrammar==0.1.29. This is a beneficial change, as it aligns with best practices by using an upstream release over a custom fork, which improves maintainability. The change is straightforward, and the author has confirmed that relevant tests pass on ROCm, mitigating the primary risk associated with such a migration. The PR is well-motivated and appears correct.

Signed-off-by: Andreas Karatzas <akaratza@amd.com>
@AndreasKaratzas
Copy link
Copy Markdown
Collaborator Author

Update: Bumped xgrammar to 0.1.29 in common.txt.

This resolves a dependency conflict with rocm-test.txt which required 0.1.29, while common.txt pinned 0.1.27. Since rocm-test.txt includes common.txt via -r common.txt, uv couldn't resolve both constraints simultaneously.

The reason we need 0.1.29 for ROCm: it includes a fix for the Triton kernel warp size on AMD GPUs (mlc-ai/xgrammar#476). Without this fix, structured output on MI300 fails with:

triton.runtime.errors.OutOfResources: out of resource: threads, Required: 2048, Hardware limit: 1024

The issue was that the Triton kernel hardcoded warp size to 64 (NVIDIA), but AMD GPUs use warp size 32. This caused the kernel to request more threads than available on AMD hardware.

@AndreasKaratzas
Copy link
Copy Markdown
Collaborator Author

There is an AMD CI run for this PR before and after this addition, and it looks like everything is still the same:
Before: https://buildkite.com/vllm/amd-ci/builds/2103
After: https://buildkite.com/vllm/amd-ci/builds/2130

@LucasWilkinson
Copy link
Copy Markdown
Collaborator

cc @tjtanaa

@DarkLight1337 DarkLight1337 added the ready-run-all-tests Trigger CI with all tests for wide-ranging PRs label Dec 28, 2025
@DarkLight1337 DarkLight1337 changed the title [ROCm] Migrate xgrammar to upstream release in rocm-test.txt [ROCm] Migrate xgrammar to upstream release Dec 28, 2025
@DarkLight1337
Copy link
Copy Markdown
Member

Renamed the PR and triggered all tests as it also affects the default vLLM installation via common.txt.

@AndreasKaratzas
Copy link
Copy Markdown
Collaborator Author

@DarkLight1337 These b200 failures are not xgrammar related and are already known right? I have few of them already here: #30719

@vllm-bot vllm-bot merged commit 573dd0e into vllm-project:main Dec 28, 2025
128 of 138 checks passed
@AndreasKaratzas AndreasKaratzas deleted the akaratza_xgrammar_requirement branch December 28, 2025 21:55
yiliu30 pushed a commit to yiliu30/vllm-fork that referenced this pull request Dec 30, 2025
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
akh64bit pushed a commit to akh64bit/vllm that referenced this pull request Jan 16, 2026
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
dsuhinin pushed a commit to dsuhinin/vllm that referenced this pull request Jan 21, 2026
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
Signed-off-by: dsuhinin <suhinin.dmitriy@gmail.com>
ItzDEXX pushed a commit to ItzDEXX/vllm that referenced this pull request Feb 19, 2026
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/build ready-run-all-tests Trigger CI with all tests for wide-ranging PRs rocm Related to AMD ROCm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants