Skip to content

feat(hipsr): add expand LLVM lowering - #585

Draft
mingyueliuh wants to merge 2 commits into
mainfrom
feat/hipsr-expand-llvm-lowering
Draft

feat(hipsr): add expand LLVM lowering#585
mingyueliuh wants to merge 2 commits into
mainfrom
feat/hipsr-expand-llvm-lowering

Conversation

@mingyueliuh

Copy link
Copy Markdown
Collaborator

Summary

  • lower hipsr.expand to the wrap_expand runtime call
  • preserve AS1 input/output pointers while keeping requested shapes and generated shape arrays in AS0
  • support both host shape operands and constant shape_attr forms
  • register the lowering and add focused LIT coverage

Test plan

  • Rebuild hip-mlir-opt
  • Run the complete MorphizenMLIR LIT suite (356 passed, 2 unsupported)

AI assistance

Cursor assisted with isolating the existing Expand lowering changes, resolving registration conflicts against the latest main branch, and preparing tests and PR text. The changes were reviewed against the generated LLVM IR and validated by rebuilding hip-mlir-opt and running the complete LIT suite.

@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.

@mingyueliuh
mingyueliuh marked this pull request as draft July 29, 2026 10:09
@github-actions

github-actions Bot commented Jul 29, 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: 3449 - Commit: f97cff9

@github-actions

github-actions Bot commented Jul 29, 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.38 359 3 1243
GroupQueryAttention_seq128 4373.51 1.70268 10 6 310
matmul_down_seq128 526.85 2.38 71 3 351

EPContext Export Performance

Model QPS Session (s) 1st Infer (ms) CPU% Mem (MB)
full_model_seq128 7.53 46.27 363 3 15590

EPContext Import Performance

Model QPS Session (s) 1st Infer (ms) CPU% Mem (MB)
full_model_seq128 7.52 9.80 366 3 15760

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 179.7 79.5 1.33 13.54
Llama-3.1-8B-awq-g128-int4-asym-fp16-onnx-dml 1 5 128 128 253.7 40.9 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 196 39.7

Run: 3449 - Commit: f97cff9

@mingyueliuh
mingyueliuh force-pushed the feat/hipsr-expand-llvm-lowering branch 2 times, most recently from b1c4226 to f97cff9 Compare July 31, 2026 02:29
mingyueliuh and others added 2 commits July 30, 2026 21:40
Lower Expand to wrap_expand with AS1 data pointers and AS0 shape metadata for both host shape operands and shape attributes.

Co-Authored-By: GPT-5.6 Sol <noreply@openai.com>
Made-with: Cursor
Centralize the runtime ABI and argument conversion while preserving explicit host shape metadata.

Co-authored-by: Cursor <cursoragent@cursor.com>
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