Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Generated patch artifacts can end in a structural blank context line.
patch/vllm-moet-v0.25.0.patch whitespace=-blank-at-eof
19 changes: 17 additions & 2 deletions .github/workflows/bench-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ on:
- "bench/**"
- "docker/**"
- "Dockerfile.recipes"
- "Dockerfile.sm120-v025"
- "README.md"
- "docs/v025-port.md"
- "docs/benchmarks/**"
- "patch/**"
- "tests/test_check_patch_files.py"
- "tools/check_patch_files.py"
- ".gitattributes"
- ".github/workflows/bench-lint.yml"

jobs:
Expand All @@ -26,8 +30,19 @@ jobs:
with:
python-version: "3.12"
- run: pip install pyyaml
- name: Patch file list matches patch/FILES.txt (lost-line guard)
run: python3 tools/check_patch_files.py
- name: Clone the production v0.25 source lineage
run: |
git clone --filter=blob:none --single-branch --branch moet-v0.25.0 https://github.com/OmarB97/vllm.git .vllm-source-v025
git -C .vllm-source-v025 remote rename origin fork
git -C .vllm-source-v025 fetch --force fork refs/tags/v0.25.0:refs/tags/v0.25.0
- name: Patch guard regressions
run: python3 -m unittest discover -s tests -p "test_check_patch_files.py"
- name: Patch manifests and production source bindings match
env:
VLLM_MOET_FORK: ${{ github.workspace }}/.vllm-source-v025
run: |
python3 tools/check_patch_files.py
python3 tools/check_patch_files.py --version 0.25.0
- name: Lint recipes, boxes, suites, matrix, results
run: python3 bench/runner/lint.py
- name: Verify README table + report match committed results
Expand Down
69 changes: 42 additions & 27 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ every rule below traces back to a real incident.

## The iron rule

`patch/vllm-moet-v0.24.0.patch` is a **generated artifact**: byte-for-byte
`git diff v0.24.0 moet-v0.24.0` from the vllm fork clone. It is **never
edited by hand**, never patched incrementally, never regenerated from
anything but the fork branch. The only sanctioned way to change it:
`patch/vllm-moet-v0.24.0.patch` and
`patch/vllm-moet-v0.25.0.patch` are **generated artifacts**. Each is the
canonicalized `git diff` from its official release tag to the matching
production-fork ship branch. They are **never edited by hand**, never patched
incrementally, and never regenerated from anything but that branch. The only
sanctioned commands are:

```bash
python3 tools/check_patch_files.py --update
python3 tools/check_patch_files.py --version 0.24.0 --update
python3 tools/check_patch_files.py --version 0.25.0 --update
```

If your change touches vLLM code, it goes to the **fork branch first**; the
Expand All @@ -25,21 +28,26 @@ WILL be erased by somebody's next regeneration.
| repo | path | branch | role |
|---|---|---|---|
| **vLLM-Moet** (this one, public) | `/workspace/vllm-moet` | `main` | publication: generated patch, kernels + cubins, bench system, docs |
| **vllm fork clone** | `/workspace/vllm-v0.24.0` | `moet-v0.24.0` | **source of truth for ALL vLLM code**; remotes: `fork` = `kacper-daftcode/vllm`, `origin` = `vllm-project/vllm` |
| **vllm v0.24 fork clone** | `/workspace/vllm-v0.24.0` | `moet-v0.24.0` | legacy production source for the v0.24 overlay; remotes remain as documented in that clone |
| **vllm v0.25 fork clone** | `/workspace/vllm-v0.25.0` | `moet-v0.25.0` | production source for the v0.25 overlay; `origin` = `vllm-project/vllm`, `fork` = `OmarB97/vllm` |

`/root/workspace` is a symlink to `/workspace`. Upstream-PR branches and
experiments live in worktrees off the same clone
(`git -C /workspace/vllm-v0.24.0 worktree list`).

`moet-v0.24.0` is the ship lineage: everything committed there is meant to
ship in the next patch regen. Park half-done work on a side branch or
worktree, not on `moet-v0.24.0`.
For v0.25, the production fork branch and its recorded SHA gate rollout; an
optional PR to `kacper-daftcode/vllm` or `vllm-project/vllm` never does. This
settlement does not migrate or redefine the legacy v0.24 remote contract.

`moet-v0.24.0` and `moet-v0.25.0` are ship lineages: everything committed
there is meant to ship in that release overlay. Park half-done work on a side
branch or worktree.

## Where a change goes

| change | commit where | must also update |
|---|---|---|
| vLLM runtime code (`moe_w2_*`, loaders, runner, attention, …) | fork branch `moet-v0.24.0` | regen the patch here — procedure below |
| vLLM runtime code (`moe_w2_*`, loaders, runner, attention, …) | matching fork branch `moet-v0.24.0` or `moet-v0.25.0` | regen that release patch here — procedure below |
| SASS kernels / cubins | `kernels/` | a `kernels/MANIFEST.md` row (generator + validation status) |
| serve configs | `bench/recipes/` | `bench/models.yaml`, `bench/matrix.yaml`; run `bench/runner/lint.py` |
| bench results | `bench/results/<release>/` | `bench/runner/render.py` — the README table and per-release report are **generated**; never hand-edit the marked README block |
Expand All @@ -51,21 +59,24 @@ smoke results (`bench/results/smoke/`).

## Shipping a vLLM code change — the procedure

1. **Commit on the fork branch** (`/workspace/vllm-v0.24.0`,
`moet-v0.24.0`). If the remote may have moved, fetch and merge first —
the regen tool refuses to run when the local branch is missing pushed
commits.
1. **Commit and push on the matching production fork branch**
(`moet-v0.24.0` or `moet-v0.25.0`). If the remote may have moved, fetch
and merge first. Strict releases refuse to regenerate from unpublished
source.
2. **Regenerate** from this repo:

```bash
python3 tools/check_patch_files.py --update
VLLM_MOET_FORK=/workspace/vllm-v0.24.0 \
python3 tools/check_patch_files.py --version 0.24.0 --update
VLLM_MOET_FORK=/workspace/vllm-v0.25.0 \
python3 tools/check_patch_files.py --version 0.25.0 --update
```

This rewrites the patch from the branch tip and updates the two
committed fingerprints: `patch/FILES.txt` (file list) and
`patch/SOURCE.txt` (the fork SHA the patch was generated from). It
refuses to move `SOURCE.txt` backwards along the branch, so a
regeneration can never roll back work that already shipped.
This rewrites the patch from the published branch tip and updates that
release's committed file list and source fingerprint
(`FILES.txt`+`SOURCE.txt` or
`FILES-v025.txt`+`SOURCE-v025.txt`). It refuses to move a source
fingerprint backwards, so regeneration cannot roll back shipped work.
3. **Review `git diff patch/`.** An entry *vanishing* from `FILES.txt`
means the patch carried work that never reached the fork branch —
someone skipped step 1. **Stop and merge that work into the branch**;
Expand All @@ -81,9 +92,10 @@ smoke results (`bench/results/smoke/`).

> `Three-tier starvation fix ships: step-scoped seen windows (vllm 9736e4d34)`

6. **Push both together** (`fork moet-v0.24.0` + `origin main`) once the
pre-push checklist passes — or leave both unpushed. Avoid a lasting
state where only one side is pushed.
6. **Publish source first, then distribution.** The matching production fork
branch must contain the recorded source SHA before the distribution guard
can pass. Push the distribution branch only after every guard is green.
Optional contribution PRs are follow-up evidence, not rollout gates.

## Concurrency — several agents, one checkout

Expand All @@ -92,10 +104,11 @@ smoke results (`bench/results/smoke/`).
`git commit -a`, no `git stash`, no `git checkout --` / `git reset` over
someone else's files, ever.
- Stage **explicit paths only**: `git add <file> <file> …`.
- `main` and `moet-v0.24.0` are shared trunks: no amending commits you did
not just create, no rebase, no force-push, no history rewrite.
- The `patch/` trio (patch, `FILES.txt`, `SOURCE.txt`) changes **only** via
`--update`. If your commit would touch any of them for another reason,
- `main`, `moet-v0.24.0`, and `moet-v0.25.0` are shared trunks: no
amending commits you did not just create, no rebase, no force-push, no
history rewrite.
- Each release's patch, FILES, and SOURCE artifacts change **only** via the
matching versioned `--update`. If your commit would touch them another way,
you are doing something wrong.
- A pre-commit hook in this checkout runs the patch guard whenever `patch/`
is staged. Do not bypass it with `--no-verify`.
Expand All @@ -113,6 +126,8 @@ smoke results (`bench/results/smoke/`).

```bash
python3 tools/check_patch_files.py # patch <-> FILES.txt <-> SOURCE.txt
python3 tools/check_patch_files.py --version 0.25.0
python3 -m unittest discover -s tests -p "test_check_patch_files.py"
python3 bench/runner/lint.py # recipes/boxes/suites/results schemas
python3 bench/runner/render.py --check # README table == committed results
```
Expand Down
63 changes: 63 additions & 0 deletions Dockerfile.sm120-v025
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# vLLM-Moet on official vLLM v0.25.0 — SM120 (RTX PRO 6000 / RTX 5090)
#
# This is a side-by-side upgrade candidate. Dockerfile.sm120-v024 remains the
# proven rollback until the v0.25 image passes the baked SM120 and live canary
# gates documented in docs/v025-port.md.
#
# Build (linux/amd64 NVIDIA host, from the repo root):
# DOCKER_BUILDKIT=1 docker build -f Dockerfile.sm120-v025 \
# -t vllm-moet-sm120:v025-w2candidate .

ARG VLLM_BASE=vllm/vllm-openai:v0.25.0@sha256:e1c1ff1af9a15921bfa11d1d95047258c1797392cdbfa296e7639da446b23f97
FROM ${VLLM_BASE}

LABEL org.opencontainers.image.version="v0.25.0-w2candidate" \
ai.kostudios.vllm-moet.base="vllm/vllm-openai:v0.25.0" \
ai.kostudios.vllm-moet.patch-sha256="ea1e8462008e8d3530e8938483a4f8974258196acc6a0bbcc4124bc4a719ed5d"

# v0.25.0 already vendors the same SM120-capable DeepGEMM commit used by the
# v0.24 recipe (a6b593d2826719dcf4892609af7b84ee23aaf32a), so no replacement
# wheel is built here. git is needed only to apply the source overlay.
RUN apt-get update && apt-get install -y --no-install-recommends git \
&& rm -rf /var/lib/apt/lists/*

# The W2 NVFP4 sparse-MLA patch was validated against FlashInfer 0.6.14's JIT
# source/API layout. vLLM v0.25.0 pins 0.6.13, so preserve the proven 0.6.14
# pair until the hardware canary explicitly qualifies the upstream pin.
RUN pip uninstall -y --break-system-packages flashinfer-cubin || true
RUN pip install --no-cache-dir --break-system-packages flashinfer-python==0.6.14 \
&& pip install --no-cache-dir --break-system-packages \
--index-url https://flashinfer.ai/whl/cu130 \
"flashinfer-jit-cache==0.6.14+cu130"

# Combined v0.25.0 overlay: W2 streaming/recovery and stores, DSpark confidence
# scheduling, NVFP4 KV, and the SM120 fixes not absorbed by the release.
COPY patch/vllm-moet-v0.25.0.patch /tmp/vllm-moet.patch
RUN SP="$(python3 -c 'import vllm, os; print(os.path.dirname(os.path.dirname(vllm.__file__)))')" \
&& cd "$SP" \
&& git apply --check /tmp/vllm-moet.patch \
&& git apply --verbose /tmp/vllm-moet.patch \
&& python3 -m py_compile \
vllm/v1/worker/gpu/spec_decode/dspark/scheduler.py \
vllm/model_executor/layers/quantization/utils/moe_w2_cubit.py \
vllm/model_executor/layers/quantization/utils/moe_w2_store.py \
&& python3 -c "from vllm.model_executor.layers.quantization.utils import moe_w2_cubit; print('moe_w2 hook OK')" \
&& python3 -c "import vllm.v1.worker.gpu.spec_decode.dspark.speculator; print('dspark OK')" \
&& rm /tmp/vllm-moet.patch

# Prebuilt SM120 W2/W4 GEMM cubins, including K=6144 for GLM-5.x.
COPY kernels/cubins-sm120/ /cubit-share/
ENV VLLM_MOE_W2_CUBIT_DIR=/cubit-share

# Bake the NVFP4 sparse-MLA read and packed-write kernels so the first serve
# does not pay JIT compilation. See Dockerfile.sm120-v024 for layout details.
RUN SP="$(python3 -c 'import vllm, os; print(os.path.dirname(os.path.dirname(vllm.__file__)))')" \
&& cd "$SP" \
&& python3 tools/nvfp4_flashinfer_sm120/patch_flashinfer.py \
&& rm -f "$SP/flashinfer_jit_cache/jit_cache/sparse_mla_sm120/sparse_mla_sm120.so" \
&& FLASHINFER_CUDA_ARCH_LIST=12.0f python3 -c \
"from flashinfer.jit.mla import gen_sparse_mla_sm120_module; gen_sparse_mla_sm120_module().build(verbose=False)" \
&& mkdir -p /opt/nvfp4-ds-mla \
&& TORCH_CUDA_ARCH_LIST=12.0a python3 -c \
"from torch.utils.cpp_extension import load; load(name='nvfp4_ds_mla_cache_ext', sources=['$SP/csrc/nvfp4_ds_mla/concat_and_cache_nvfp4_ds_mla.cu'], extra_cuda_cflags=['-O3', '--generate-code=arch=compute_120a,code=sm_120a'], build_directory='/opt/nvfp4-ds-mla')"
ENV VLLM_NVFP4_DS_MLA_EXT_DIR=/opt/nvfp4-ds-mla
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ cannot even fit on. Three ideas carry it:
bit‑deterministic), an **NVFP4 KV cache** (352 B/token), and agent‑ready tool/reasoning
parsing.

> **v0.25.0 upgrade candidate:** [`Dockerfile.sm120-v025`](Dockerfile.sm120-v025)
> and [`docs/v025-port.md`](docs/v025-port.md) carry the rebased 61-file overlay
> on official vLLM v0.25.0. The results below remain v0.24 measurements until
> the candidate passes its own SM120 model-load, 128K, quality, and performance
> gates; the v0.24 image stays the rollback.

---

## GLM‑5.2 (753B) — the headline model
Expand Down Expand Up @@ -250,6 +256,10 @@ git clone https://github.com/kacper-daftcode/vLLM-Moet && cd vLLM-Moet

# official vllm-openai:v0.24.0 image + patch + pins + SM120 cubins
DOCKER_BUILDKIT=1 docker build -f Dockerfile.sm120-v024 -t vllm-moet-sm120:v024 .

# side-by-side v0.25.0 candidate (do not replace the v0.24 live image yet)
DOCKER_BUILDKIT=1 docker build -f Dockerfile.sm120-v025 \
-t vllm-moet-sm120:v025-w2candidate .
```

**Easiest path — run a benchmarked recipe.** The recipes image downloads the
Expand Down Expand Up @@ -424,6 +434,13 @@ Release **`baseline-2026-07-10`** — one row per supported recipe (`bench/recip
<!-- bench:table:end -->

## Repository layout
- **`patch/vllm-moet-v0.25.0.patch`** — the v0.25 candidate delta (61 files,
+13,342/-134 source lines) against exact official tag commit `702f4814`.
- **`Dockerfile.sm120-v025`** — pinned official v0.25.0 image plus the candidate
overlay; the exact image is built side-by-side with v0.24 and still requires
its documented disposable serve gate before production promotion.
- **`docs/v025-port.md`** — exact identities, absorbed-upstream inventory,
compatibility decisions, completed source gates, and remaining promotion gates.
- **`patch/vllm-moet-v0.24.0.patch`** — the delta vs official vLLM `v0.24.0` (37 files,
+7.4k lines; applies clean on the tag). Goes with the pins above.
- **`Dockerfile.sm120-v024`** — the image: official `vllm/vllm-openai:v0.24.0` + patch + pins +
Expand Down
Loading