Skip to content

testing PR700 - #708

Closed
BoarQing wants to merge 2 commits into
test/gemma4from
test/pr700-on-pr599
Closed

BoarQing wants to merge 2 commits into
test/gemma4from
test/pr700-on-pr599

Conversation

@BoarQing

Copy link
Copy Markdown
Contributor

Testing PR: the changes from #700 stacked on top of #599 so they can be exercised together.

Made with Cursor

@github-actions

Copy link
Copy Markdown

Thanks for opening a PR!

This project follows LLVM's incremental-development and AI-tool-use
guidance. See CONTRIBUTING.md
for the project workflow.

Before requesting review, please check that:

  1. The change is focused. Substantial work links the relevant issue
    or design discussion.
  2. The PR documents relevant test results and updates affected
    documentation.
  3. If AI tools provided substantial assistance, the description
    explains what was assisted and how it was validated, and commit
    trailers identify the tool. The contributor has reviewed and
    understands the result.

Reviewers are assigned through
CODEOWNERS where ownership
is configured.

BoarQing and others added 2 commits August 13, 2026 03:33
…ape operand

buildExpandShapeOutputShape gave every dynamic output dim in a reassociation
group the full source-dim extent. That holds only while a group covers at most
one dynamic dim; when a Reshape splits one dynamic source dim into several
dynamic output dims the source extent is their product and says nothing about
the split, so each output dim was assigned the whole product.

On Gemma-4 26B-A4B the per-layer Reshape([bs*ss, 2816] -> [bs, ss, 2816])
therefore claimed [ss, ss, 2816], and the 30 layer input norms consuming it ran
over ss^2 rows: 5,036 ms of the 6,486 ms decoder prefill at 2,049 tokens, and
88 GB of shared memory at 4,097 tokens, which took the machine down.

ReshapeShapeFold already folds Reshape(_, Shape(x)) into a host-visible
tensor.from_elements holding the correct per-dim values, precisely so this can
be recovered, but the consuming branch was never written and the conversion
never read operand 1. Add it, and return nullopt when the shape operand is not
host-readable so the caller falls back to tensor.reshape rather than emit an
expand_shape it cannot justify. Single-dynamic groups keep the existing
derivation, leaving the other expand_shape sites in the model untouched.

Also make the failure loud. verifyNormAxisMatchesScale rejects at conversion
time any norm whose axis does not span exactly the scale's element count, which
the runtime cannot check because its ABI carries element counts rather than
shapes; and the two norm wrappers that lacked the positivity and divisibility
preconditions already present in wrap_layer_normalization now have them.

Gemma-4 26B-A4B FP16W4-qmoe on gfx1151, TTFT at 2,049 tokens 7,865 -> 2,859 ms,
decoder prefill 6,486 -> 1,520 ms, layernorm within it 5,036 -> 50 ms. 4,097
tokens now completes in 4,983 ms instead of rebooting the host.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Made-with: Cursor
Co-authored-by: Cursor <cursoragent@cursor.com>
Re-wrap the countDynOutDims and buildExpandShapeOutputShape declarations and
the expand_shape call site to satisfy the pinned clang-format 16.0.1. No code
change; the whitespace-stripped token stream is identical to the parent commit.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Made-with: Cursor
Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown

L2 Accuracy Results (EP vs CPU)

Model Combined L2 Total Elems Skipped NaN/Inf
conv_test_hybrid 4.8668E-07 64 0
GroupQueryAttention_seq256 25.2366 2621440 0
MatMulNBits_o_seq128 259.906 368640 0
QMoE_seq128 34.957 368640 0

Threshold: 0.01 | Run: 4599 - Commit: 2394cad

@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown

MorphiZen EP Performance Results

Model QPS Session (s) 1st Infer (ms) CPU% Mem (MB)
full_model_seq128 7.50 6.24 363 3 1244
GroupQueryAttention_seq128 4425.74 1.72755 10 6 312
matmul_down_seq128 531.96 2.34 70 3 353

EPContext Export Performance

Model QPS Session (s) 1st Infer (ms) CPU% Mem (MB)
full_model_seq128 7.54 45.91 361 3 15590

EPContext Import Performance

Model QPS Session (s) 1st Infer (ms) CPU% Mem (MB)
full_model_seq128 7.53 9.66 358 3 15761

OGA Benchmark Results

Model Warmup Reps Prompt Len Gen Tokens TTFT (ms) TPS Peak Mem (GB) GPU Mem (GB)
gpt-oss-20b-webgpu-int4-rtn-block-32 1 5 128 128 174.5 79.7 1.33 13.53
Llama-3.1-8B-awq-g128-int4-asym-fp16-onnx-dml 1 5 128 128 237.0 41.3 1.22 6.43

OGA Wheel Smoke (Python benchmark_e2e.py)

Model TTFT (ms) TPS
Llama-3.1-8B-awq-g128-int4-asym-fp16-onnx-dml 191 40.2

Run: 4599 - Commit: 2394cad

@BoarQing

Copy link
Copy Markdown
Contributor Author

Superseded by branch test/pr700-on-main, which replays PR700's reshape/norm fix directly on latest main (71c1a68) instead of stacking on test/gemma4.

@BoarQing BoarQing closed this Aug 17, 2026
@BoarQing BoarQing reopened this Aug 18, 2026
@BoarQing BoarQing closed this Aug 18, 2026
@BoarQing
BoarQing deleted the test/pr700-on-pr599 branch September 2, 2026 06:40
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