Skip to content

[general] foundamental for pip install "verl-hardware-plugin[xpu]" - #194

Draft
kahlun wants to merge 11 commits into
verl-project:mainfrom
kahlun:feature/vendor-extras
Draft

kahlun wants to merge 11 commits into
verl-project:mainfrom
kahlun:feature/vendor-extras

Conversation

@kahlun

@kahlun kahlun commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

Lets each hardware backend declare its own pip dependencies, as a pip extra:

pip install "verl-hardware-plugin[xpu]"      # also: enflame, iluvatar, metax, mlu, musa, neuron, rocm, supa, tpu

Each backend owns verl_hardware_plugin/accelerators/<backend>/requirements.txt. pyproject.toml maps the extra to that
file ([tool.setuptools.dynamic.optional-dependencies]). A backend changes its pins by editing its own file; it never
touches another backend's pins or the shared pyproject.toml.

  • XPU has real pins: torch==2.15.0+xpu, dpctl, kernels>=0.16.0,<0.17.0. [vllm-xpu] adds vllm==0.34.0+xpu
    (requirements-vllm.txt). These match verl's XPU Docker image after #8863 (vLLM 0.34.0, torch 2.15.0).
  • The other nine backends ship a comment-only placeholder, so [mlu] etc. are valid extras that install nothing
    extra. Their torch build normally comes from a vendor image, and none of their packages were verified here.
    Each backend's maintainers are asked to fill in their own file (see "Asks" below).
  • The dev extra moves to requirements-dev.txt, same contents.

Why

The goal is a single-command install per vendor, with each vendor owning its dependency list. This PR delivers the
ownership model, the XPU pins, the checks that keep them honest, and the docs. It does not yet deliver the
one-command install, for the reasons in the next section.

Where this stands against the one-command goal

Part of the install Needed today Why What removes it
verl verl[verl-core] @ git+...@<commit> verl 0.9.1 (PyPI) pins transformers<5.11; vLLM 0.34.0+xpu needs >=5.16.1,<5.23 (verl PR #8390, merged 2026-10-26, is not in a release) a verl release newer than 0.9.1
The plugin clone and pip install ".[...]" not on PyPI yet the PyPI release (needs org setup, see Asks)
Intel torch, vLLM and kernels four --extra-index-url flags pip cannot read an index from package metadata; +xpu wheels are not on PyPI, and vllm-xpu-kernels (pinned exactly by the vLLM wheel) is only on its own index documented flags, uv index entries, or an xpu extra in verl core
System packages, LD_LIBRARY_PATH, CCL_SYCL_*_TMP_BUF=1 set by hand pip installs Python packages only docs (done); possibly the plugin, not tried

The earlier "released track" idea (verl 0.9.1 with an older vLLM) is dropped from this PR. It was only resolved, never
run, and it targeted vLLM 0.31, not the 0.34 pinned here.

Plan

Stage Install command Needs
This PR clone, verl from a git commit, four flags, environment block (see Usage) nothing more
Next pip install "verl-hardware-plugin[xpu,vllm-xpu]" plus four flags a verl release past 0.9.1, and the PyPI setup
End state pip install "verl[xpu]" or uv sync --extra xpu verl core gains an xpu extra and index entries in its pyproject.toml

Asks for the maintainers

  1. PyPI (needs verl-project org rights): create the project verl-hardware-plugin (the name has not been checked
    for availability), add a pending trusted publisher (owner verl-project, workflow release.yml, environment pypi),
    and create the pypi environment, optionally with a required reviewer. Until then release.yml only builds.
  2. A floor for verl in the plugin's own dependencies: keep verl>=0.9.0, or depend on verl[verl-core] so a
    plain install also gets TransferQueue, pyzmq and mathruler? This changes a shared dependency, so it is left
    for the maintainers to decide.
  3. verl core, longer term: would an xpu extra (torch and vLLM +xpu pins) plus [tool.uv.index] entries for the
    PyTorch XPU, vLLM XPU and vllm-xpu-kernels indexes in verl's pyproject.toml be acceptable? That is what makes
    verl[xpu] possible.
  4. Backend maintainers: please fill in your own accelerators/<backend>/requirements.txt with public,
    pip-installable pins, and put index flags and system packages in docs/accelerators/<backend>/.
  5. Review points: the BAAI license header on the new test file (used because the other XPU files use it and the
    checker accepts it); whether release.yml (the release-workflow commit) belongs in this PR; commit titles, which
    carry no backend tag because the change spans all backends.

The commits

Split so any of them can be dropped:

Commit Content
feat: per-backend pip extras ... pyproject.toml, the requirements files, tests/test_vendor_extras.py
docs: pip extras install option ... README extras table, "Option B: pip extras" in the XPU install guide
ci: build the wheel and resolve the XPU pins ... .github/workflows/extras.yml
scripts: verify_extras.sh and smoke_xpu.sh ... two check scripts with plain PASS/FAIL output
ci: release workflow ... .github/workflows/release.yml, PyPI trusted publishing on a vX.Y.Z tag
xpu: move pins to torch 2.15.0+xpu and vLLM 0.34.0+xpu pins, the fourth index, install guide, CI and script pins (follows verl #8863)

Test

Resolve check (torch 2.15 / vLLM 0.34 update): pip install --dry-run of verl[verl-core] at verl main
(8612d02) plus .[xpu,vllm-xpu] with the four index flags resolves to torch 2.15.0+xpu, vllm 0.34.0+xpu,
vllm-xpu-kernels 0.1.17 and transformers 5.18.0. pytest tests/test_vendor_extras.py: 15 passed.

GitHub CI: lint, pytest, tpu-loss-core-sha and the two Extras jobs (metadata: wheel builds, twine check,
every backend has a Provides-Extra; resolve-xpu: the XPU pins resolve against the real indexes). Status for the
latest push: .

On hardware (not yet re-run on the 2.15 / 0.34 pins): the earlier version of this PR was run on 2x Intel Arc Pro B60
via devctl from a bare intel/pytorch:xpu-2.13.0-ubuntu24.04 image with torch 2.14.0+xpu and vLLM 0.32.0+xpu: clean
pip check, plugin activated from the verl.plugins entry point, and a 2-step GRPO (Qwen2.5-0.5B, GSM8K, 2 GPUs)
exited 0. That run checks the install path, not training quality. verl #8863 reports the same GRPO passing on
torch 2.15.0 / vLLM 0.34.0 from its Docker image, but the pip path here has not been run on that stack yet.

Not tested: release.yml has not run (it needs a vX.Y.Z tag and the PyPI setup), so no upload was attempted.
The non-XPU extras are empty. sglang, torchtitan and veomni extras are not part of this PR.

Usage

# system packages: libnuma-dev libze-dev g++ gcc python3-dev
python3 -m venv /opt/venv && source /opt/venv/bin/activate
export LD_LIBRARY_PATH=/opt/venv/lib:/usr/local/lib
export CCL_SYCL_ALLGATHERV_TMP_BUF=1 CCL_SYCL_ALLREDUCE_TMP_BUF=1 \
       CCL_SYCL_REDUCE_SCATTER_TMP_BUF=1 CCL_SYCL_BROADCAST_TMP_BUF=1
pip install "verl[verl-core] @ git+https://github.com/verl-project/verl.git@<commit>" ".[xpu,vllm-xpu]" \
    --extra-index-url https://download.pytorch.org/whl/xpu \
    --extra-index-url https://wheels.vllm.ai/0.34.0/xpu \
    --extra-index-url https://wheels.vllm.ai/xpu \
    --extra-index-url https://vllm-project.github.io/vllm-xpu-kernels/whl
scripts/accelerators/xpu/smoke_xpu.sh

How a backend changes its dependencies

  1. Edit verl_hardware_plugin/accelerators/<backend>/requirements.txt (pins only, no --index-url lines).
  2. Put index flags and system packages in docs/accelerators/<backend>/.
  3. Run pytest tests/test_vendor_extras.py.
  4. Open a PR; extras.yml runs because a requirements file changed.

…s.txt

pip install "verl-hardware-plugin[xpu]" (also enflame, iluvatar, metax, mlu, musa, neuron, rocm, supa, tpu) now resolves the pins in verl_hardware_plugin/accelerators/<backend>/requirements.txt, so each backend owns its own dependencies and a version bump touches only that backend's file. [vllm-xpu] adds the vLLM XPU wheel pin. The dev extra moves to requirements-dev.txt unchanged.

XPU gets real pins (torch==2.14.0+xpu, dpctl, kernels>=0.16.0,<0.17.0, vllm==0.32.0+xpu). The other backends ship comment-only placeholders for their maintainers; their torch builds normally come from a vendor image.

Index flags cannot live in package metadata, so requirements files hold pins only. tests/test_vendor_extras.py rejects option lines, direct URLs and a backend without an extra.
Adds Option B (pip extras) to the XPU install guide with the system packages and environment variables pip cannot provide (libnuma-dev, LD_LIBRARY_PATH for oneCCL, CCL_SYCL_*_TMP_BUF). Option B from source becomes Option C.
Runs on pull requests that touch pyproject.toml or an accelerator requirements file, weekly, and by hand. The metadata job checks every backend has a Provides-Extra; resolve-xpu runs pip install --dry-run against the real indexes.
… hand

verify_extras.sh builds the wheel and prints PASS/FAIL lines (no GPU; --resolve asks the real indexes). smoke_xpu.sh runs on an Intel GPU machine and checks torch, the GPU, the entry point and the platform.
…lishing)

Builds sdist and wheel, runs twine check, publishes on a vX.Y.Z tag that matches pyproject. Needs a PyPI pending publisher and a pypi environment before it can publish; until then a manual run only builds.
@kahlun kahlun changed the title Feature/vendor extras [general] foundamental for pip install "verl-hardware-plugin[xpu]" Nov 27, 2026
Follows the repo layout for per-backend scripts (scripts/accelerators/<backend>/). verify_extras.sh stays in scripts/ because it checks every backend.
A workflow_dispatch run started on a v* tag has github.ref refs/tags/v..., so the ref check alone let a build-only manual run reach the publish job. Require event_name == push as well.
The vLLM check was skipped whenever 'import vllm' failed, so a wheel with a missing shared library or an incompatible dependency could end in ALL PASS. Skip only when vllm is not installed, and run the import inside the check.
Follows verl #8863. Adds the vllm-xpu-kernels index, which the vLLM wheel pins exactly and no other index carries.
verl main's Dockerfile.stable.vllm still builds torch 2.14.0+xpu and vLLM 0.32.0 with compute-runtime 26.27 from release packages; the 2.15.0 / 0.34.0 / OMIX image is verl PR #8863, still open. Say so, drop the 'recommended' label and the vllm034 tag, and point to Options B and C for the stack in this guide.
…tors/<backend>/

Each backend's pip-extra requirements file now sits next to its install guide (docs/accelerators/<backend>/requirements.txt) instead of inside the Python package. pyproject.toml maps every extra to that path; MLU keeps its existing docs/accelerators/mlu/requirements_mlu.txt untouched and the mlu extra reads it, so there is one list and nothing to drift.

The wheel no longer carries the requirements files (its metadata already holds the dependencies); the sdist does, so a wheel built from the sdist keeps the same extras. Updates the extras.yml path filter, verify_extras.sh, the install guides, the README and the comments and docstrings that named the old location. test_vendor_extras.py also checks that every extra's file lives in docs/accelerators/<backend>/ (vllm-xpu in xpu/).

Resolved as a dry-run against verl (not run on MLU hardware): with verl main at 8612d02 and only the base requirements the MLU file resolves; it does not resolve with verl[verl-core] at that commit (TransferQueue==0.1.11 vs >=0.1.12) or with PyPI verl 0.9.1 (transformers==5.15.0 vs <5.11). The MLU maintainers should review those pins.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant