Skip to content

Enable -cce-vf-aa-between-iters by default for A5 CCEC builds#1446

Merged
ChaoZheng109 merged 1 commit into
hw-native-sys:mainfrom
yanghaoran29:feat/a5-default-vf-aa-between-iters
Jul 23, 2026
Merged

Enable -cce-vf-aa-between-iters by default for A5 CCEC builds#1446
ChaoZheng109 merged 1 commit into
hw-native-sys:mainfrom
yanghaoran29:feat/a5-default-vf-aa-between-iters

Conversation

@yanghaoran29

@yanghaoran29 yanghaoran29 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add -mllvm -cce-vf-aa-between-iters=true to the default CCEC flags for A5 hardware.
  • This option enables alias analysis across loop iterations. With it on, AA is stricter and directly affects BiSheng VF fusion scale and correctness.
  • Context: without this option, BiSheng fusion can misbehave in some cases; fusion still needs to run under the stricter AA setting. BiSheng plans to make this always-on later; simpler enables it by default on A5 CCEC now to align with that direction.
  • a5sim is unchanged: KernelCompiler leaves ccec unset and uses Gxx15Toolchain, so this LLVM option does not apply there.
  • Board check: DeepSeek V4 qkv_proj_rope.py (decode, -p a5) fails with VF fusion alone (AICore / scheduler stall); adding this option makes it PASS. Turning fusion off also PASSes.

Test plan

  • Confirm CCECToolchain(platform="a5").get_compile_flags() includes -mllvm / -cce-vf-aa-between-iters=true
  • Confirm CCECToolchain(platform="a2a3") and a5sim kernel path do not add this option
  • A5 board: qkv_proj_rope.py -p a5 --mode decode PASSes

@gemini-code-assist

Copy link
Copy Markdown

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 22, 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: 579f5fb9-73f2-4d5f-b31b-365cb45d1417

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

Changes

A5 compiler flag configuration

Layer / File(s) Summary
Compile flag assembly and A5 option
simpler_setup/toolchain.py
CCECToolchain.get_compile_flags() builds a mutable flag list and adds the vf-aa-between-iters LLVM option for a5 and a5sim platforms.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Poem

I’m a rabbit with flags in my hat,
Adding A5’s LLVM tweak just like that.
Loops now peer through each iteration,
With alias analysis in formation.
Hop, compile, and away we go!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly matches the main change: enabling the VF AA flag by default for A5 CCEC builds.
Description check ✅ Passed The description is directly related and accurately explains the A5 CCEC flag change and its motivation.

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.

@yanghaoran29
yanghaoran29 force-pushed the feat/a5-default-vf-aa-between-iters branch from 7e3e6eb to 2ac1b81 Compare July 23, 2026 01:11

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@simpler_setup/toolchain.py`:
- Around line 192-197: Update the platform check in the toolchain flag builder
so it targets only real A5 hardware, removing the ineffective a5sim branch from
CCECToolchain. If a5sim support is required, instead add the option through the
host G++ simulation flag path used when self.ccec is unset; otherwise document
that the setting applies only to A5 hardware.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 40f5e2be-d480-46be-97c4-c201103d41fc

📥 Commits

Reviewing files that changed from the base of the PR and between 717d703 and 2ac1b81.

📒 Files selected for processing (1)
  • simpler_setup/toolchain.py

Comment thread simpler_setup/toolchain.py Outdated
@yanghaoran29
yanghaoran29 force-pushed the feat/a5-default-vf-aa-between-iters branch 2 times, most recently from 3081909 to dd27361 Compare July 23, 2026 01:16
@yanghaoran29

Copy link
Copy Markdown
Contributor Author

Addressed CodeRabbit feedback: narrowed the flag to A5 hardware only (platform == "a5"). a5sim uses Gxx15Toolchain and does not go through CCECToolchain.

@yanghaoran29
yanghaoran29 force-pushed the feat/a5-default-vf-aa-between-iters branch 2 times, most recently from 0cc0b17 to e8caeb2 Compare July 23, 2026 03:05
Pin BiSheng inter-iteration VF alias analysis on A5 hardware CCEC so fusion
runs under the stricter AA that BiSheng plans to make always-on. Skip a5sim:
KernelCompiler leaves ccec unset there and uses Gxx15Toolchain instead.
@ChaoZheng109
ChaoZheng109 merged commit d4071fe into hw-native-sys:main Jul 23, 2026
16 checks passed
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.

2 participants