Skip to content

fix(ir): dual-dispatch manual no-split pipe groups - #2114

Merged
YunjiQin merged 2 commits into
hw-native-sys:mainfrom
lyfne123:codex/issue-2097-dual-aiv-dispatch
Jul 23, 2026
Merged

fix(ir): dual-dispatch manual no-split pipe groups#2114
YunjiQin merged 2 commits into
hw-native-sys:mainfrom
lyfne123:codex/issue-2097-dual-aiv-dispatch

Conversation

@lyfne123

Copy link
Copy Markdown
Collaborator

Summary

  • infer dual_aiv_dispatch for hand-written Ascend910B AIC/AIV Groups that use no-split cross-core pipes
  • preserve standalone behavior by creating Group-private adapters when a member is reused elsewhere
  • assert orchestration emits {AIC, AIV, AIV} so lane 1 replays the required zero-valid-shape handshake

Follow-up to #2104 and #2097. The shared Group ABI fix removed the argument mismatch, but the original manual-pipe case still hung because the AIV member was dispatched only on lane 0.

Validation

  • cmake --build build --parallel 8
  • test_expand_mixed_kernel_a2a3.py: 20 passed
  • issue regression in test_orchestration_tensor_rw.py: passed
  • original unmodified probe_manual_pipe_draft.py -p a2a3 -d 1 N=8 device run: PASS in 3.22s (runtime 2.41s)

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c4417740-85c6-4e07-a116-c416b0746e8c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

ExpandMixedKernel now infers dual_aiv_dispatch for eligible Ascend910B no-split cross-core pipe groups, independently of ABI normalization. Tests cover the inferred AIV attribute and generated mixed-kernel task ordering.

Changes

Dual AIV dispatch inference

Layer / File(s) Summary
Infer and apply dispatch attributes
src/ir/transforms/expand_mixed_kernel_pass.cpp
The pass detects supported no-split cross-core pipe usage, separates ABI normalization from dispatch inference, and conditionally applies dual_aiv_dispatch to the normalized AIV function.
Validate transformed orchestration
tests/ut/ir/transforms/test_expand_mixed_kernel_a2a3.py, tests/ut/codegen/test_orchestration_tensor_rw.py
Regression coverage verifies inferred dispatch on a hand-written Group and checks the emitted mixed-kernel task IDs and AIV attribute.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant HandWrittenGroup
  participant ExpandMixedKernel
  participant AIVFunction
  participant OrchestrationCode
  HandWrittenGroup->>ExpandMixedKernel: provide AIC/AIV members with explicit A2A3 pipe
  ExpandMixedKernel->>AIVFunction: set dual_aiv_dispatch=True
  ExpandMixedKernel->>OrchestrationCode: emit MixedKernels mixed_0 with resolved task IDs
Loading

Possibly related PRs

  • hw-native-sys/pypto#2009: Updates propagation of dual_aiv_dispatch=True for external mixed kernels and specialization behavior.

Poem

A rabbit hops through pipes of light,
AIV dispatch now takes flight.
Cube and vector, side by side,
March in their mixed-kernel stride.
Tests count each task just right.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title concisely captures the main change: fixing dual-dispatch for manual no-split pipe groups.
Description check ✅ Passed The description matches the changeset and describes the dual AIV dispatch fix and its validation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: beabd5748f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/ir/transforms/expand_mixed_kernel_pass.cpp Outdated
lyfne123 added a commit to lyfne123/pypto that referenced this pull request Jul 23, 2026
- guard direct pass runs without an active PassContext
- infer dual dispatch only for real no-split transport operations
- keep the orchestration regression tied to an actual pipe handshake
lyfne123 added 2 commits July 22, 2026 18:07
- guard direct pass runs without an active PassContext
- infer dual dispatch only for real no-split transport operations
- keep the orchestration regression tied to an actual pipe handshake
@lyfne123
lyfne123 force-pushed the codex/issue-2097-dual-aiv-dispatch branch from 4fffef1 to ef1662b Compare July 23, 2026 01:12
@YunjiQin
YunjiQin merged commit c9b2674 into hw-native-sys:main Jul 23, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants