Skip to content

Add Qwen3 out-window compile flag#422

Open
sunkaixuan2018 wants to merge 3 commits into
hw-native-sys:mainfrom
sunkaixuan2018:codex/out-window-enable
Open

Add Qwen3 out-window compile flag#422
sunkaixuan2018 wants to merge 3 commits into
hw-native-sys:mainfrom
sunkaixuan2018:codex/out-window-enable

Conversation

@sunkaixuan2018
Copy link
Copy Markdown

Summary

  • Add --enable-out-window-externalization to the Qwen3 14B decode_fwd.py runner.
  • Forward the flag through compile_cfg as enable_out_window_externalization, keeping the default path unchanged when the flag is absent.
  • This PR must be used together with PyPTO PR Add opt-in out-window externalization switch pypto#1597, which adds the underlying compile/pass switch.

Related Issues

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

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

Run ID: e3414dcb-6416-4518-a220-6a40683d4c98

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

The decode forward path CLI gains a new --enable-out-window-externalization boolean flag that toggles out-window externalization behavior. The flag is defined in the argument parser and forwarded directly to the JIT compilation configuration.

Changes

Out-window externalization configuration

Layer / File(s) Summary
Add CLI flag and wire into compilation config
models/qwen3/14b/decode_fwd.py
The --enable-out-window-externalization argument is added to the CLI parser with a default value of False, then passed to compile_cfg.enable_out_window_externalization when invoking run_jit.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A flag takes flight through the CLI breeze,
Configuration flows with such ease,
Out-window dances in JIT's embrace,
Eight lines of code find their place! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding a compile flag for out-window externalization to the Qwen3 model.
Description check ✅ Passed The description is directly related to the changeset, providing context about the new CLI flag, its purpose, and the related dependency.
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.

✏️ 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.

Copy link
Copy Markdown
Contributor

@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 introduces a new command-line argument --enable-out-window-externalization and passes it to the compiler configuration in models/qwen3/14b/decode_fwd.py. The feedback suggests adding a help description to the new argument for better usability, and conditionally passing the compile_cfg dictionary only when the flag is enabled to maintain backward compatibility with older PyPTO versions.

Comment thread models/qwen3/14b/decode_fwd.py
Comment thread models/qwen3/14b/decode_fwd.py Outdated
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.

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 `@models/qwen3/14b/decode_fwd.py`:
- Around line 579-581: The compile_cfg dict in decode_fwd.py unconditionally
includes enable_out_window_externalization which can forward an unsupported
kwarg into fn._compile via compile_kwargs and cause a TypeError; change the code
that builds compile_cfg so it only inserts the enable_out_window_externalization
key when the CLI flag/variable is truthy (or explicitly set) rather than always
adding it — i.e., check the variable (enable_out_window_externalization) before
adding to compile_cfg, or build compile_cfg conditionally, so fn._compile is
only called with supported keys.
🪄 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

Run ID: fb744d05-310e-4188-bb84-c2a934a37c77

📥 Commits

Reviewing files that changed from the base of the PR and between c45855e and 360c3b8.

📒 Files selected for processing (1)
  • models/qwen3/14b/decode_fwd.py

Comment thread models/qwen3/14b/decode_fwd.py Outdated
- Accept simulator platforms in decode_fwd CLI for CI runs
- Only forward enable_out_window_externalization when requested
- Add a static CLI smoke test for the PR regression
Keep the script default small enough for CI simulator runs while preserving the full-model default in build_tensor_specs for explicit callers.
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