Skip to content

[codex] remove init stages in qwen3 scope3#92

Merged
zhangqi-chen merged 1 commit intohw-native-sys:mainfrom
high-cloud:codex/remove-init-stages-scope3
Apr 10, 2026
Merged

[codex] remove init stages in qwen3 scope3#92
zhangqi-chen merged 1 commit intohw-native-sys:mainfrom
high-cloud:codex/remove-init-stages-scope3

Conversation

@high-cloud
Copy link
Copy Markdown
Contributor

@high-cloud high-cloud commented Apr 10, 2026

What changed

Remove the redundant initialize stages in examples/models/qwen3/qwen3_32b_decode_scope3.py and renumber the remaining stage annotations.

Why

This scope writes each tile block directly before use, so the extra initialize stages are unnecessary. The stage numbering should stay aligned with the reduced pipeline.

Impact

The scope3 example is easier to read and its stage comments match the actual execution flow.

Versions

  • pypto: 066b194 (main)
  • simpler: d62341b (stable)

Validation

  • python examples/models/qwen3/qwen3_32b_decode_scope3.py

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 10, 2026

📝 Walkthrough

Walkthrough

Removed explicit zero-initialization of resid1_tile in two parallelized auto_incore stages, deferring its population to the residual-add stage. Updated stage numbering comments to reflect the shifted stage mapping after initialization block deletions.

Changes

Cohort / File(s) Summary
Residual Tile Initialization Refactoring
examples/models/qwen3/qwen3_32b_decode_scope3.py
Removed explicit zero-initialization blocks for resid1_tile in two parallelized auto_incore stages; deferred population to residual-assemble stage. Renumbered computation stage labels (Stage 1/2/3/4/5/8&9 → Stage 0/1/2/3&4&5/6&7) to reflect shifted mapping. No changes to function signature or core mathematical operations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🐰 A rabbit hops through tiling chains,
Removing zeros, no more stains!
Now residuals wait for their assembly call,
Deferred with grace—the stages heed it all!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change: removing initialization stages from the qwen3 scope3 example file, which aligns with the changeset.
Description check ✅ Passed The description is clearly related to the changeset, explaining what was removed, why it was necessary, and the impact on code readability.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

@high-cloud high-cloud marked this pull request as ready for review April 10, 2026 03:35
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request simplifies the scope3 function in qwen3_32b_decode_scope3.py by removing redundant initialization stages for the resid1_tile and mlp_tile accumulators. The subsequent processing stages have been renumbered to reflect these changes. I have no feedback to provide.

@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
examples/models/qwen3/qwen3_32b_decode_scope3.py (1)

66-66: Consider using ASCII x for the multiplication symbol.

Ruff flags the Unicode × (MULTIPLICATION SIGN) as ambiguous. While readable, using ASCII x would silence the lint warning.

-                # Stage 0: Output projection: attn_out × wo, tiled by Q_OUT_CHUNK.
+                # Stage 0: Output projection: attn_out x wo, tiled by Q_OUT_CHUNK.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/models/qwen3/qwen3_32b_decode_scope3.py` at line 66, The comment
containing "attn_out × wo, tiled by Q_OUT_CHUNK." uses the Unicode
multiplication sign (×) which Ruff flags; replace it with the ASCII letter 'x'
so the comment reads "attn_out x wo, tiled by Q_OUT_CHUNK." and re-run linting
to confirm the warning is resolved (locate the comment near Q_OUT_CHUNK in
qwen3_32b_decode_scope3.py).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@examples/models/qwen3/qwen3_32b_decode_scope3.py`:
- Line 66: The comment containing "attn_out × wo, tiled by Q_OUT_CHUNK." uses
the Unicode multiplication sign (×) which Ruff flags; replace it with the ASCII
letter 'x' so the comment reads "attn_out x wo, tiled by Q_OUT_CHUNK." and
re-run linting to confirm the warning is resolved (locate the comment near
Q_OUT_CHUNK in qwen3_32b_decode_scope3.py).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fbebb99a-6144-45c5-8f30-2189fededaab

📥 Commits

Reviewing files that changed from the base of the PR and between 4f729f3 and b7255af.

📒 Files selected for processing (1)
  • examples/models/qwen3/qwen3_32b_decode_scope3.py

@zhangqi-chen zhangqi-chen merged commit 0d48e70 into hw-native-sys:main Apr 10, 2026
5 checks passed
sjduan pushed a commit to wangqin1723-max/pypto-lib that referenced this pull request Apr 10, 2026
wangqin1723-max pushed a commit to wangqin1723-max/pypto-lib that referenced this pull request Apr 13, 2026
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