Update: narrow auto_incore scope and switch to Ascend950 in Qwen3 decode#18
Update: narrow auto_incore scope and switch to Ascend950 in Qwen3 decode#18zhangqi-chen merged 1 commit intohw-native-sys:mainfrom
Conversation
- Move `pl.auto_incore()` inside the batch loop to wrap only the KV-head loop (RoPE + cache update) and attention computation - Simplify batch loop to `pl.parallel(BATCH_CFG)` - Switch backend from Ascend910B_PTO to Ascend950 - Remove save_kernels flag from compile_and_run
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on optimizing the Qwen3 decode layer by refining its execution strategy and adapting it for a new hardware platform. The changes aim to improve performance and compatibility through more precise memory management, streamlined batch processing, and an updated target backend for compilation. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA single example file for Qwen3 32B decoding was refactored to restructure control flow: the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📝 Coding Plan
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. Comment |
There was a problem hiding this comment.
Code Review
This pull request refactors the qwen3_decode_layer function to narrow the auto_incore scope, simplifies a parallel loop, and updates the backend configuration. The changes align with the PR description and appear to be a good optimization. I have one comment regarding the removal of a chunk parameter which might have performance implications.
| sin_lo = pl.slice(sin_row, [1, HEAD_DIM_CFG // 2], [0, 0]) | ||
| sin_hi = pl.slice(sin_row, [1, HEAD_DIM_CFG // 2], [0, HEAD_DIM_CFG // 2]) | ||
|
|
||
| for b in pl.parallel(BATCH_CFG): |
There was a problem hiding this comment.
The chunk=4 parameter was removed from this pl.parallel call. While pl.parallel(BATCH_CFG) is a valid simplification, this is now the only pl.parallel call in the function that doesn't specify a chunk size. Given that chunking is often important for performance tuning, was its removal here intentional and verified? If the chunking is still desired, you might need to revert to the explicit form: pl.parallel(0, BATCH_CFG, 1, chunk=4).
pl.auto_incore()inside the batch loop to wrap only the KV-head loop (RoPE + cache update) and attention computationpl.parallel(BATCH_CFG)Summary by CodeRabbit
Refactor
Chores