processor-mm-parity
Skill39k starsChanged 5 days agoApache-2.0View on GitHub
Add or verify a model family's multimodal (image) preprocessing in rust/sglang-processor's `mm` component, on top of Dynamo's `dynamo-multimodal`, so it matches SGLang's Python path bit for bit at every stage and end to end. Use when adding a multimodal family to sglang-processor or the Rust server, bumping `dynamo-multimodal`, regenerating `mm_parity` fixtures, or debugging a Rust-vs-Python multimodal mismatch.
- Installs packages
Trending
More talk lately.about the whole repository
Who's talking about sgl-project/sglang
- Vuk Rosić“SGLang Step by Step Beginner Tutorial”YouTube · Sep 4, 2025 · 4.9k views
- NVIDIA Developer“Inference Office Hours with SGLang: Performance Optimizations for LLM Serving”YouTube · Feb 6, 2026 · 3k views
- Fahd Mirza“How-To Use Any Transformers Model with SGLang Easily”YouTube · Jun 25, 2025 · 2.2k views
- Fahd Mirza“Control LLM Output with SGL - SGLang with GPT”YouTube · May 26, 2024 · 1.9k views
- Solopreneurs hub“SGLang: High-Performance LLM Serving for Low Latency AI Infra (GPU/Memory Optimized)”YouTube · Aug 14, 2026 · 1.1k views
The biggest 5 of 71 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 71
Talked about on GitHub, YouTube, Bluesky, Hacker News and Stack Overflow (71 times).
On GitHub · 44
- Sep 23, 2025Feature Request: support qwen3-vl series — ggml-org/llama.cpp153 reactions · 151 comments
- Jun 21, 2025[sglang] Tracking sglang compatibility in slime — THUDM/slime25 reactions · 1 comment
- Feb 18, 2026[Roadmap] Blackwell MXFP8 and NVFP4 RL training — radixark/miles19 reactions · 1 comment
- Nov 22, 2024[Roadmap] veRL Development Roadmap — verl-project/verl17 reactions · 7 comments
- Aug 16, 2025[Feature]: Add provider Sglang — BerriAI/litellm16 reactions · 8 comments
39 more on GitHub
- Apr 23, 2025Support for the Qwen3 models in engine-flow — NVIDIA/TensorRT-LLM16 reactions · 2 comments
- Apr 9, 2025[Feature]: Support structured output and tool call together — vllm-project/vllm14 reactions · 9 comments
- Jan 12, 2026[WIP][Spec Decode] DFlash — vllm-project/vllm13 reactions · 3 comments
- Jul 15, 2026[tml] Inkling model support — radixark/miles11 reactions · 6 comments
- Mar 24, 2026[Feature]: Implement `TRITON_MLA_SPARSE` backend for sm80/120/121 support of Sparse MLA — vllm-project/vllm10 reactions · 15 comments
- Nov 13, 2025Support rollout routing replay — THUDM/slime10 reactions
- Jun 23, 2025Support for Flash Attention 3 — huggingface/transformers10 reactions · 17 comments
- Mar 27, 2025veRL-SGLang Roadmap — zhaochenyang20/Awesome-ML-SYS-Tutorial10 reactions · 32 comments
- Jan 23, 2024Radix Attention support — vllm-project/vllm10 reactions · 2 comments
- Dec 23, 2025Development Roadmap - miles LoRA training support Q1 — radixark/miles8 reactions · 9 comments
- Jan 3, 2026[SGLANG]: 2026 H1 backend roadmap/improvements — ai-dynamo/dynamo7 reactions · 13 comments
- May 30, 2025Add DeepSeek 671B GRPO example — verl-project/verl7 reactions · 2 comments
- Jun 4, 2026DEP: Runtime-Free Router and Gateway On-Ramp — ai-dynamo/dynamo6 reactions · 16 comments
- May 18, 2026DeepSeek V4 kernel support status tracker — flashinfer-ai/flashinfer6 reactions · 9 comments
- Jan 28, 2026[Feature] Update Transformers to v5 — verl-project/verl6 reactions · 2 comments
- Jan 20, 2026Any plan to release flash-attn-cute package? — Dao-AILab/flash-attention6 reactions
- Nov 22, 2025[Kernel] Add NVFP4 MoE CUTLASS support for SM120 — vllm-project/vllm6 reactions · 9 comments
- Sep 22, 2025[Bugfix] Qwen3-next generate ! always — vllm-project/vllm6 reactions · 7 comments
- Aug 22, 2025Project Limit Request: sgl-kernel - 40 GB — pypi/support6 reactions · 6 comments
- Jun 6, 2025hotfix: fix the blackwell fmha stream — flashinfer-ai/flashinfer6 reactions · 1 comment
- May 19, 2025[RoadMap] Mooncake Store V2 — kvcache-ai/Mooncake6 reactions · 17 comments
- Mar 29, 2025[Model] Deepseek-v3 support — mlc-ai/mlc-llm6 reactions
- Feb 10, 2024Add instructions on running llava-v1.6-mistral-7b — haotian-liu/LLaVA6 reactions · 9 comments
- Aug 18, 2026[RFC] Moore Threads MUSA Support Roadmap — sgl-project/sglang-omni5 reactions
- Jun 17, 2026[refactor] weight update refactor — radixark/miles5 reactions · 2 comments
- Feb 28, 2026[Feature]: Eliminate redundant multimodal preprocessing for gRPC backends — smg-project/smg5 reactions · 2 comments
- Jan 4, 2026KTransformers Roadmap (2026 Q1) — kvcache-ai/ktransformers5 reactions · 11 comments
- Sep 20, 2025[FEAT] Deterministic rollout — THUDM/slime5 reactions · 1 comment
- Apr 18, 2025The tests presented in this repository are incorrect due to errors in launching sglang. — simon-mo/vLLM-Benchmark5 reactions · 3 comments
- Feb 27, 2025[Model] [Quantization] Support deepseek v3/r1 w8a8 int8 block-wise quantization — vllm-project/vllm5 reactions · 12 comments
- Nov 23, 2024[Usage] Batch evaluation using sqlang doesn't support llava-v1.5 model — haotian-liu/LLaVA5 reactions
- Nov 5, 2023Batch evaluation — haotian-liu/LLaVA5 reactions · 28 comments
- Aug 21, 2026Helion KDA backend port from sglang https://github.com/sgl-project/sg… — vllm-project/vllm4 reactions · 2 comments
- Mar 5, 2026feat(sglang): introduces SGLang provider support to OpenClaw — openclaw/openclaw4 reactions · 2 comments
- Jan 31, 2026Fix argument type error in _cudnn_gemm_fp4_requirement — flashinfer-ai/flashinfer4 reactions · 6 comments
- Sep 2, 2025[Feat] Single Batch Overlap (SBO): Overlaping of Down GEMM with Combine Send — deepseek-ai/DeepEP4 reactions · 2 comments
- Aug 1, 2025Qwen2.5-VL-7B egale3 train — sgl-project/SpecForge4 reactions · 36 comments
- Jul 25, 2025feat: masked layout fp4 gemm using cute-dsl — flashinfer-ai/flashinfer4 reactions · 2 comments
- Jul 8, 2025[sglang, megatron, perf] feat: speed up megatron sglang weight update by 10x — verl-project/verl4 reactions · 7 comments
On YouTube · 21
- Sep 4, 2025SGLang Step by Step Beginner Tutorial — Vuk Rosić4.9k views · 4 comments
- Feb 6, 2026Inference Office Hours with SGLang: Performance Optimizations for LLM Serving — NVIDIA Developer3k views · 1 comment
- Jun 25, 2025How-To Use Any Transformers Model with SGLang Easily — Fahd Mirza2.2k views · 7 comments
- May 26, 2024Control LLM Output with SGL - SGLang with GPT — Fahd Mirza1.9k views · 6 comments
- Aug 14, 2026SGLang: High-Performance LLM Serving for Low Latency AI Infra (GPU/Memory Optimized) — Solopreneurs hub1.1k views
16 more on YouTube
- Oct 13, 2026Supercharge LLM Inference Speed with SGLang & RadixAttention! 💻⚡ (Open Source) — AI Skill Vault144 views
- May 2, 2026⭐ sglang — 26,936 GitHub Stars — Observe AI93 views
- Nov 7, 2026llama.cpp vs vLLM vs SGLang: Which Is Fastest on One GPU? — Tensor Garage67 views
- Sep 13, 2026Sglang — Everything For AI42 views
- Nov 4, 2026Temperature 0 gave 7 different answers #determinism — Agentic Ajrak37 views
- Oct 25, 2026SGLang's 16 MiB All-Reduce Bug Returned the Wrong Sum — Ankit Kaushal37 views
- Feb 8, 2025GitHub - sgl-project/sglang: SGLang is a fast serving framework for large language models and vis... — GitHub Daily Trend AI Podcast34 views
- Oct 27, 2026SGLang & AKV: 10X Faster AI Agents Explained — The Employee Factorysays it tested it33 views
- Nov 6, 2026⚡ Serve LLMs and Vision Models with SGLang 🚀 — GitGemVault32 views
- Oct 27, 2026SGLang Atomic Uploads: Keep the Good Image When Writing Fails | Request Survival 02 — Ankit Kaushal27 views
- Oct 27, 2026SGLang: Why 6 Tokens Crashed a 3-Slot Request | Request Survival 01 — Ankit Kaushal25 views
- Nov 14, 2026SGLang: 30x faster on a 16 GB GPU — Agentic Ajraksays it tested it19 views
- Oct 8, 2026Sglang — Everything For AI16 views
- Sep 12, 2026739 PRs in one week isn't a project — it's a sprint to own LLM inference. — thezakulo14 views
- Jun 29, 2026Sglang — Everything For AI8 views
- Nov 15, 2026SGLang: Fast Inference Serving for LLMs and Multimodal Models | OpenViST Listing — OpenViST1 view
On Bluesky · 4
- Feb 7, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 sgl-project / sglang ⭐ 8,749 (+130) 🗒 Python SGLang is a fast serving framework for large language… — @github-trending.bsky.social4 likes and reposts
- Sep 15, 2026did you have a look to SGlang (github.com/sgl-project/...)? It's more focused on large models, but they integrate all major optimizations… — @aminesaboni.bsky.social1 likes and repost · 1 reply
- Jan 19, 2024🔥 Hot Repo! 🔥 (100+ new stars) 📦 sgl-project / sglang ⭐ 442 (+134) 🗒 Python SGLang is a structured generation language designed for… — @github-trending.bsky.social1 likes and repost · 1 reply
- Sep 13, 2025you don't want to run models in prod directly with pytorch, it's a fuck ton of work to do properly. Use vLLM or sglang… — @timkellogg.me0 likes and reposts · 1 reply
On Hacker News · 1
- Oct 15, 2026SGLang – High-performance serving framework for LLM's and multimodal models1 point
On Stack Overflow · 1
In this repository32 other files it gives its agents.
- sglang-docs-mintlifyAGENTS.md
- add-jit-kernelSkill
- add-sgl-kernelSkill
- babysit-pr-to-pass-ciSkill
- ci-test-auditSkill
- ci-workflow-guideSkill
- clean-startup-logSkill
- code-cleanupSkill
- compute-mamba-ratioSkill
- cookbook-add-modelSkill
- cookbook-migrate-modelSkill
- cookbook-review-prSkill
- debug-cuda-crashSkill
- debug-distributed-hangSkill
- env-var-conventionsSkill
- generate-profileSkill
- hybrid-cache-checkpointsSkill
- kernel-organizationSkill
- kl-consistency-testSkill
- large-class-styleSkill
- llm-torch-profiler-analysisSkill
- mechanical-refactor-verifySkill
- processor-model-paritySkill
- rerun-testSkill
- scripted-runtime-notesSkill
- sglang-bisect-ci-regressionSkill
- sglang-cherrypickSkill
- sglang-multi-graph-checkSkill
- sglang-prod-incident-triageSkill
- sglang-runtime-contextSkill
- speculative-namingSkill
- write-sglang-testSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
Never patch a fixture to match Rust: Every mismatch gets one of two fixes:
- Very specific: line 112
Sizes: every resize boundary (below min_pixels, above max_pixels, sides smaller than the resize factor), and the aspect-ratio limit on both …
- Very specific: line 123
Rejections: every input Python rejects is recorded as error and must be rejected by Rust.
- Very specific: line 135
Every fixture covers the resize shapes, a two-image prompt and the pixel overrides.
- Distinctive: line 181
Every family runs these before the host serves it, and again after any Dynamo bump:
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Processor multimodal parity
The principle
Match Python bit for bit, at every stage and end to end. For the same request, the Rust path must produce exactly what SGLang's Python path produces:
- the same resolved processor parameters;
- the same decoded pixels;
- the same feature bytes;
- the same expanded ids and offsets;
- the same positions;
- the same model kwargs;
- the same scheduler inputs.
The whole served request must also come out the same. It follows that:
- No tolerances. No
allclose, no "within 1 ULP", no "close enough on MMMU". Compare bytes and hashes of bytes. - Python is the reference. Dynamo is the implementation. SGLang code exists only where the two differ, and each such piece names the Python source it mirrors.
- Never patch a fixture to match Rust. Every mismatch gets one of two fixes:
- fix Dynamo upstream (
ai-dynamo/frontend-crates,multimodal/), or fix SGLang's side (the spec gate inrust_server/multimodal.py, orsrc/mm/mod.rs) when the rule is SGLang's; - or record it as a
known_gap, with the reason and the upstream fix. The test keeps reporting it and fails once it matches.
- fix Dynamo upstream (
- Stage parity is necessary, not sufficient. Each stage is checked on its own, so a mismatch is located immediately. The end-to-end check then proves the stages compose.
The one sanctioned difference is the content hash. Rust hashes the encoded bytes with blake3; Python hashes the feature with sha256. It is cache identity only and never reaches the model, so outputs cannot depend on it. Anything else that cannot match is a known gap, not an exception.
The reference: Python's CPU path
Python itself takes different paths on different hosts. The reference is the CPU path, which every fixture records:
- PIL decode (
utils/common.py::_load_image), thenconvert("RGB")inbase_processor._load_single_item. There is no EXIF transpose unless the processor setssmart_rgb_conversion. - The HF image processor's CPU kernels: torchvision on a uint8 tensor (the
default backend), or PIL with
--image-processor-backend pil.
On a CUDA host, Python's default deviates from that reference in two ways:
- It decodes JPEG with nvJPEG (
gpu_image_decode, on by default inbase_processor). - It runs the torchvision image processor on
cuda:<base_gpu_id>(_fast_image_processor_device).
Both are Python disagreeing with itself. Measure them and report them; never copy them into Rust.
The PIL backend's bicubic output changes across Pillow releases, and SGLang does not pin Pillow. Every fixture records the Pillow version it was generated under. Regenerate under that version, or regenerate every fixture together under a new one.
Stages
| # | Stage | Python source | Rust | Checked by |
| 1 | Spec: processor params from the loaded HF processor plus server args | get_processor (utils/hf_transformers/processor.py), --image-processor-backend, --mm-process-config | resolved in Python by rust_server/multimodal.py::RustMmProcessor.resolve_spec, handed over as MmSpec; Dynamo registry::build_processor | mm_parity cases record the resolved spec, per backend and per override |
| 2 | Fetch: source to bytes | get_image_bytes | host (sglang-server/src/multi_modality/) | host unit tests: data URL, bare base64, file://, http, limits |
| 3 | Decode: bytes to RGB | _load_image, _load_single_item | Dynamo image::decode::decode_rgb | the corpus (below); a reject must reject |
| 4 | Features: resize, normalize, patchify | the HF image processor | Dynamo process_item | feature_sha256 and feature_shapes per item |
| 5 | Expansion: placeholders to feature tokens | base_processor.build_input_ids, get_mm_items_offset | Dynamo layout and apply_layout | input_ids_sha256, num_input_ids, offsets |
| 6 | Positions | MRotaryEmbedding.get_rope_index or the family's shortcut | Dynamo positions | mrope_sha256, mrope_delta |
| 7 | Model kwargs | model_specific_data (e.g. image_grid_thw) | ProcessedItem.aux | image_grid_thw |
| 8 | Chat with media: prompt plus ordered media list | process_content_for_template_format, _apply_jinja_template | render/ | tests/parity.rs media cases (processor-model-parity) |
| 9 | Scheduler handoff: MultimodalDataItem fields | the processor's MultimodalProcessorOutput | server multi_modality/ and rust_server/multimodal.py::wrap_encoded | server and Python unit tests: every field the scheduler reads |
| E2E | The served request | the Python server | the Rust server (SGLANG_RUST_SERVER=1) | "End to end": bit-exact inputs and outputs, MMMU and MMMU-Pro, serving benchmarks |
Where a family's code goes
- Dynamo, upstream: the family's
process_item,layout,positions, itsProcessorSpecarm, and itsspec_from_hf_configsbranch. Anything HF ships belongs there: class defaults, kernels, layout. src/mm/mod.rsnever branches on a family. It runs Dynamo's stages in order.- Python
rust_server/multimodal.py: oneRUST_MM_FAMILIESentry, which checks that the processor class is SGLang's own, and the family's spec inresolve_spec, read from the loaded HF processor. The server'sMmSpec(sglang-server/src/message/config.rs) gets the matchingMmFamilyarm.
Method
- Pick the checkpoints from the family's cookbook page (
docs/cookbook/). Include one per distinct processor config, e.g. a different patch size orsizestyle. Pin each revision. - Trace Python stage by stage for the family (the table above). Write down every transformation and every rejection; this is the divergence inventory.
- Extend the corpus in
tests/scripts/generate_mm_parity.py(CORPUS) until it covers each inventory item, and add cases incases(). Images must be small and deterministic. - Generate fixtures (below) and run
tests/mm_parity.rs. - Fix each failure at the stage it belongs to: Dynamo for HF behavior,
SGLang's gate or
src/mm/mod.rsfor SGLang's. Until an upstream fix ships, add the case toKNOWN_GAPSwith the reason and the upstream PR. - Run end to end (below): the bit-exact check, MMMU and MMMU-Pro on both servers, and the serving benchmarks, before the host serves the family.
Corpus checklist
Each item below needs at least one case:
- Sizes: every resize boundary (below
min_pixels, abovemax_pixels, sides smaller than the resize factor), and the aspect-ratio limit on both sides. - Modes: L, LA, P, P with
transparency, RGBA, and 16-bit. - JPEG: baseline, progressive, 4:4:4 and subsampled, CMYK, and EXIF orientation.
- Other formats: animated GIF (first frame), WebP lossy and lossless with alpha, BMP.
- Prompts: multiple images in one prompt.
- Server args: each backend, and each
--mm-process-configkey Python honors and each it rejects. - Rejections: every input Python rejects is recorded as
errorand must be rejected by Rust.
Generating fixtures
cd rust/sglang-processor
pip install --target /tmp/pillow pillow==<the fixtures' "pillow">
PYTHONPATH=/tmp/pillow:$REPO/python \
python tests/scripts/generate_mm_parity.py <hf-model-id> [--revision <sha>]Every fixture covers the resize shapes, a two-image prompt and the pixel
overrides. Decoding does not depend on the model or the backend, so only one
fixture per family runs the format sweep and the PIL backend (--formats); a
new decoder or backend path is added there.
The generator downloads only the processor and tokenizer files. It loads them
through SGLang's get_processor, records the spec SGLang's Rust MM gate resolves
(RustMmProcessor.resolve_spec), and runs process_mm_data_async on the CPU
path, with GPU decode and the GPU image device turned off. It writes
tests/fixtures/mm_parity/<model>.json and any missing corpus images. Each case
carries its spec, so cargo test runs offline.
Verify
cd rust
cargo test -p sglang-processor --locked --test mm_parity --test mm_single_thread
cargo clippy -p sglang-processor --all-targets --locked -- -D warningsmm_single_thread guards the host's threading model. process runs inline on
the caller's thread; the server's MM worker pool supplies the concurrency.
End to end
Stage parity proves each piece. End to end proves they compose into the same
served model. Run the Python server and the Rust server (SGLANG_RUST_SERVER=1)
on the same checkpoint with the model's cookbook flags, and run every check
below against both. Report each pair of numbers with its harness, settings and
hardware.
Because Python's CUDA defaults deviate from its CPU reference (see "The
reference"), the bit-exact checks run on inputs where the two coincide:
non-JPEG images with --image-processor-backend pil. Report the default-config
delta (nvJPEG, CUDA resize) separately, as Python's own.
1. Identical inputs and outputs (bit-exact)
Send the same requests to both servers, through /generate and through chat.
- Scheduler inputs: prompt ids,
image_grid_thw, offsets and feature bytes must be identical. Dump them on both sides. - Outputs: greedy output tokens and their logprobs must be identical, under deterministic inference so that batching adds no noise.
2. Accuracy benchmarks
Every family runs these before the host serves it, and again after any Dynamo bump:
- MMMU.
simple_eval_mmmu_vlm.MMMUVLMEval(run_evalwitheval_name="mmmu"), the same subset and sampler on both servers. sgl-eval does not ship plain MMMU, so this in-tree harness is the allowed exception (.claude/rules/prefer-sgl-eval.md).test/registered/vlm/test_rust_native_mm_mmmu.pyis the CI form: it runs the Rust server over/generatewith a gate calibrated against Python. - MMMU-Pro.
sgl-eval run mmmu_proandmmmu_pro_visionagainst each server's/v1/chat/completions. Use the version pinned in thetestextra ofpython/pyproject.toml, from its own virtualenv, with the model's recommended sampling (--load-preset-from-model-id, or pass the settings explicitly).
With identical inputs (check 1), Python and Rust scores must agree at temperature 0. Any gap is a bug: find the first stage that differs. At the model's recommended sampling, they must agree within run-to-run noise. Measure that noise with repeated runs on one server; don't assume it. When adding a family, calibrate its CI gate from these runs and say how in the test.
3. Performance benchmarks
Parity must not cost throughput.
- Serving:
python -m sglang.bench_serving --dataset-name image(and--dataset-name mmmu) against both servers, and against the previous Rust server when replacing a pipeline. Compare request throughput, TTFT and end-to-end latency at the same concurrency. - Preprocessing: per-image p50/p99 on the MM worker, so a regression in decode or resize is visible apart from the model.
Pitfalls
- A Dynamo bump can change any stage silently. Rerun every fixture after
bumping
dynamo-multimodal. - Pillow is unpinned. A fixture generated under another Pillow version fails PIL-backend cases for reasons unrelated to the code under test.
- The Python processor reads
gpu_image_decodefrom the class, not the instance. Setting it on the instance leaves nvJPEG on. - Python's
--mm-process-configimage overrides reach the HF processor at call time, and Python falls back to decode-and-retokenize when its own placeholder count disagrees. The fixture records what Python finally produced. - A test image set limited to PNG hides decoder differences;
sglang-mm's JPEG mismatch went unnoticed that way. Keep JPEG in every family's cases.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

