Skip to content

fix(loop): support shape-changing loop carriers - #689

Draft
fhanuman wants to merge 1 commit into
pr/shape-stack-03-broadcast-reductionfrom
pr/shape-stack-03b-loop-carriers
Draft

fix(loop): support shape-changing loop carriers#689
fhanuman wants to merge 1 commit into
pr/shape-stack-03-broadcast-reductionfrom
pr/shape-stack-03b-loop-carriers

Conversation

@fhanuman

@fhanuman fhanuman commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Support shape-changing ranked Loop carriers without aliasing results to immutable initialization storage.

  • return exact carrier descriptors through a status-aware loop body ABI;
  • manage per-invocation double-buffered carrier storage with zero-trip aliasing and transactional publication;
  • copy exact loop results to graph outputs and remove the sequence-length-specific accumulator workaround.

Stack

This is PR 6 of 12 and depends on PR 5:

1. Constant carrier/externalization
2. Shape-rule foundation
3. Reshape provenance
4. MatMul/Gemm
5. Broadcast/Reduction
6. Loop carriers ← this PR
7. Payload/Readback
8. Conv/Pool
9. Gather/Tensor
10. Attention/Normalization
11. Explicit contract enforcement
12. Refinement hardening

AI assistance

AI tools assisted with the loop ABI implementation and stack reconstruction. The changes were checked with the authoritative local build, focused compiler/runtime tests, and strict loop numerics.

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.

@github-actions github-actions Bot added the large-pr Soft size threshold (>500 LOC or >10 files). Reviewer signal, not a block. label Aug 10, 2026
@fhanuman
fhanuman force-pushed the pr/shape-stack-03b-loop-carriers branch from ba7f7c0 to 32c6615 Compare August 10, 2026 22:29
@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown

L2 Accuracy Results (EP vs CPU)

Model Combined L2 Total Elems Skipped NaN/Inf
conv_test_hybrid EP inference failed - -
GroupQueryAttention_seq256 EP inference failed - -
MatMulNBits_o_seq128 EP inference failed - -
QMoE_seq128 EP inference failed - -

Threshold: 0.01 | Run: 3871 - Commit: 08c707b

@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown

MorphiZen EP Performance Results

Model QPS Session (s) 1st Infer (ms) CPU% Mem (MB)
full_model_seq128 failed - - - -
GroupQueryAttention_seq128 failed - - - -
matmul_down_seq128 failed - - - -

EPContext Export Performance

Model QPS Session (s) 1st Infer (ms) CPU% Mem (MB)
full_model_seq128 failed - - - -

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 - - - 0.00
Llama-3.1-8B-awq-g128-int4-asym-fp16-onnx-dml 1 5 128 128 - - - 0.00

OGA Wheel Smoke (Python benchmark_e2e.py)

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

Run: 3871 - Commit: 08c707b

@fhanuman
fhanuman force-pushed the pr/shape-stack-03b-loop-carriers branch from 32c6615 to 08c707b Compare August 10, 2026 23:33
Return loop-carried descriptors through per-invocation double-buffered frames so exact zero and dynamic seeds can evolve safely without aliasing immutable initialization storage.

Co-Authored-By: GPT-5.6 Sol <noreply@openai.com>
Made-with: Cursor
@fhanuman
fhanuman force-pushed the pr/shape-stack-03b-loop-carriers branch from 08c707b to ea7ac75 Compare August 11, 2026 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

large-pr Soft size threshold (>500 LOC or >10 files). Reviewer signal, not a block.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant