Skip to content
Open
28 changes: 28 additions & 0 deletions evidence/glm-image-vllm-omni-910b1-20261125/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Native GLM-Image on two Ascend 910B1s

The performance comparison uses the public vLLM-Omni `Omni.generate` entry point for 512×512 BF16 text-to-image generation. Autoregressive decoding and 20 diffusion steps both contribute to the single-image latency. A fresh engine serves each invocation, with a separate untimed warmup.

The first candidate shares the position tables across local decoder layers. The incremental candidate applies the same rotation to adjacent Q/K heads. The model implementations and focused regression tests are in [vLLM-Omni #11130](https://github.com/vllm-project/vllm-omni/pull/11130). The governing [issue #668](https://github.com/InferMatrixLab/InferRSI/issues/668) records the acceptance conditions and the initial rejected baseline qualification. The [InferRSI decision-view changes](https://github.com/InferMatrixLab/InferRSI/pull/663) are pinned for the incremental round.

The original quality attempt stopped because the stock blue-cover image at seed 771 has very low contrast. The parity cohorts retain the prompt and compare its exact RGB pixels against an independently rendered stock fixture. The benchmark measures latency and preservation of engine output. Prompt adherence remains unqualified.

The incremental protocol also renders the teapot at seed 43 in both quality arms, verifies that changing the seed changes the stock RGB output, and compares all four baseline/candidate arrays. The engine hashes the RGB bytes after decoding. PNG compression and engine initialization are outside the timed interval.

The source snapshots, runtime, weights, workload, output oracle and acceptance gates are recorded in `plan/`. The incremental selection and its two alternatives are in `incremental/decision.json`. The 40-layer diagnostics describe the rotary region only.

### End-to-end results on two Ascend 910B1s

Directly comparing stock with the two commits together on the same reserved card pair gave **57.58 → 49.19 s/image**, a **14.58%** latency reduction (1.171× speedup). The stage timings for these same requests were 52.71 → 44.56 s for autoregressive generation and 4.86 → 4.61 s for diffusion.

| Native GLM-Image comparison | AB/BA round | Independent AB/BA final |
| --- | ---: | ---: |
| Stock → shared position tables | 58.42 → 49.98 s (14.44%) | 59.05 → 49.20 s (16.68%) |
| Shared position tables → joint Q/K rotation | 50.93 → 47.97 s (5.82%) | 51.99 → 48.77 s (6.19%) |

Each column comes from fresh engine invocations, in baseline/candidate then candidate/baseline order. An invocation's score is the median wall time of two fixed prompts. The report shows the median of the two scores per side. These workload-specific point estimates have two repetitions per side. The direct comparison is a separate AB/BA run. Each incremental change also cleared a 3% gate in an independent final.

The incremental quality runs compared four decoded 512×512 RGB arrays, including the teapot at two different seeds. Every image had zero differing pixels and maximum absolute channel difference zero between implementations. Changing the teapot seed changed its reference bytes. Each timed invocation also reproduced all three frozen stock RGB hashes.

The incremental campaign froze InferRSI PR #663 at `1c235ec9`. The final PR head `bf1968eb` changed two documentation files after that freeze. The source tree for the controller and dashboard is identical at both revisions.

From this evidence directory, run `python results/verify.py` to verify the saved result hashes, RGB checks, AB/BA order, summary statistics and comparison verdicts. The per-request stage times and image hashes are in `results/trials.json`, `incremental/trials.json` and `results/direct-stock-packed.json`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Iterate on the native vLLM-Omni GLM-Image AR model from f7c891db411dd75572169c163c4f967fc326a4c9 (shared cosine/sine tables). Measure the incremental change using InferRSI PR #663 at 1c235ec9d5be686b23107cf50f457577e68305d5. Acceptance is scoped to issue https://github.com/InferMatrixLab/InferRSI/issues/668.

Freeze the 512x512 two-card Ascend BF16 deployment and checkpoint, 20 diffusion steps, one warmup and two distinct seeded prompts from the prior parity study. For each measured step check all three pinned stock RGB hashes. In each quality arm also render the same teapot prompt with seed 43, require it to differ from seed 42, and compare all four baseline/candidate uint8 RGB arrays. Every channel must match across arms. The stock blue-cover fixture is near white. The claim concerns latency and reference equality.

Use a 3% incremental latency-reduction gate, two independent measurement invocations per arm, alternating AB/BA. Each invocation starts a new engine and runs both stages with one request at a time. Disk encoding, engine initialization and warmup are excluded from latency. The median of the two requests is one observation. Retest independently on the same pair of leased cards before adopting the patch. Preserve competing options, selection reasoning and unsuccessful trials.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"hypothesis": "Using the adjacent Q/K heads in the existing QKV projection as a single rotary input should reduce eager per-token dispatch with equal pixels.",
"strategy": "Apply the existing BF16 operations to the packed Q/K head group. Split into contiguous Q and K after rotation; V is passed through.",
"alternatives": [
"Use a hardware-specific fused rotary kernel. Its rounding on partial BF16 heads would need separate validation on each backend.",
"Cache cosine/sine tables across decode steps. Different M-RoPE positions and request lifetimes require an additional indexing and invalidation protocol."
],
"selection_reason": "The previous native AR stage takes about 46.7 s/image. Packed Q/K retained exact output bytes for one and 32 tokens and lowered the one-token 40-layer section from 18.59 to 11.41 ms; it needs no device-specific kernel or cross-request cache.",
"candidate_sha256": "902bc7709fd982056bda66bb0375f71486af674543dd2fb4d8dc04078a79443a",
"inferrsi": "1c235ec9d5be686b23107cf50f457577e68305d5",
"baseline": "f7c891db411dd75572169c163c4f967fc326a4c9",
"candidate": "d36dbd5de794aa94fd6e561f3bde7c8903a28fc5",
"baseline_snapshot_sha256": "1f862afc5d564dd81b14f55cddcf66a2b5b102f13ebed02d38cc57d60513d397",
"retrieved_items": [
{
"ref": "package:inferrsi.common.skills.audit_h3_metal_fasth3_semantics",
"title": "audit-h3-metal-fasth3-semantics"
},
{
"ref": "package:vllm_omni.ascend.diffusion.qwen_image_21_eager_t2i",
"title": "Qwen-Image-2.1 eager text-to-image on one 910B1: reuse plus interleaved RoPE, 30% not met"
},
{
"ref": "package:inferrsi.common.skills.kernel_writing_guide",
"title": "kernel-writing-guide"
},
{
"ref": "checkout:case.qwen-ascend-rejected-directions",
"title": "qwen-ascend-rejected-directions"
},
{
"ref": "package:inferrsi.ascend.skills.vllm_ascend",
"title": "vllm-ascend"
},
{
"ref": "checkout:case.sglang-gdn-source-contract",
"title": "sglang-gdn-source-contract"
}
],
"cited_item": "package:vllm_omni.ascend.diffusion.qwen_image_21_eager_t2i",
"protocol_sha256": {
"container.sh": "43363892249dc0586dc50ac36ca5a6ca4646812ac7433bc306e9c4cd750ca4b8",
"deploy.yaml": "75ecf5716e03215701dcb096377898d4b420ed04c59d1adbaef4c1d94eab0141",
"engine.py": "bd611d3b3d8b0b563005da02c56b4d49c6ca23b9c193141df9fc03eca3936d7c",
"reference.json": "af459c286ca5beaedbda6cb009237c7fdc43578890726f3b90167cbe7406f404"
},
"quality": "Compare native stock RGB SHA-256 for seeds 107, 42 and 771. Independently render the teapot at seed 43 and require a different hash from seed 42. In both quality arms save all four images as lossless PNGs, decode to uint8 RGB and compare each candidate pixel with baseline."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The preceding native GLM-Image candidate shares the position tables but still launches two rotary sequences per decoder layer. Its 40-layer position-only diagnostic on one decode token took 18.552 ms. In the warmed two-card native candidate quality run (512x512, 20 steps), the following stage times were recorded:
- seed 42: total 51.024 s, AR 46.665 s, diffusion 4.349 s.
- seed 771: total 51.689 s, AR 46.640 s, diffusion 5.040 s.
The QKV projection delivers contiguous Q and K head groups. Both groups use the same position-dependent elementwise arithmetic. This motivates testing joint Q/K rotation to reduce repeated elementwise launches. The stage timings do not attribute all autoregressive time to this region.
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"1": {
"ms_per_40_layers": {
"separate": [
18.972269113874063,
18.211443006293848,
18.141426262445748,
19.483767624478787,
19.50419688364491,
18.17398951970972
],
"packed": [
11.420416500186548,
11.363160010660067,
11.40731485793367,
11.485400755191222,
11.939202493522316,
11.316705000353977
]
},
"medians_ms": {
"separate": 18.591856060083956,
"packed": 11.413865679060109
},
"qkv_sha256": "ef1b4d7e01c132bf676aefcbb195cde12e3e3d5aaaff9cb7f1155c2eb1dbabb3"
},
"32": {
"ms_per_40_layers": {
"separate": [
19.203422736609355,
18.503781990148127,
18.589607876492664,
19.22697585541755,
18.255092873005196,
18.49560550181195
],
"packed": [
14.228343759896234,
14.256188122089952,
14.114011893980205,
14.144875371130183,
13.947223866125569,
14.03340749675408
]
},
"medians_ms": {
"separate": 18.546694933320396,
"packed": 14.129443632555194
},
"qkv_sha256": "773b1e8e37e5f5db2bcd1c5b50169cc844a51e7cfdf77d4a6949aea5040e1fb9"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[
{
"cohort": "round",
"verdict": "PASS",
"baseline_s": 50.931881911703385,
"candidate_s": 47.96619558351813,
"latency_reduction_pct": 5.822848512306368,
"speedup": 1.0618286752181845,
"observation_sha256": "0058fc2ba394de2dae11b12c4528941753571cd3785aa205e55d7a5336859183"
},
{
"cohort": "independent_final",
"verdict": "PASS",
"baseline_s": 51.98823849251494,
"candidate_s": 48.77053427445935,
"latency_reduction_pct": 6.189292638793406,
"speedup": 1.0659763987810293,
"observation_sha256": "e0e8f9ca39def0e1ca0e6a23c1d832ee219de7b807294580dabd6b19127c862b"
}
]
Loading
Loading