Skip to content

Conversation

@wenhuach21
Copy link
Contributor

No description provided.

@wenhuach21 wenhuach21 marked this pull request as draft January 8, 2026 09:22
@wenhuach21 wenhuach21 changed the title update reproduce bug Jan 8, 2026
@wenhuach21 wenhuach21 marked this pull request as ready for review January 8, 2026 09:25
@wenhuach21 wenhuach21 changed the title reproduce bug WNA16 does not apply optimized RTN for moe layers by default Jan 9, 2026
@wenhuach21 wenhuach21 requested a review from Copilot January 9, 2026 02:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses an issue where optimized RTN (Round-to-Nearest) quantization was not properly disabled by default for MoE (Mixture of Experts) layers in WNA16 configurations. The change introduces MoE model detection and automatically disables optimized RTN for expert layers to improve efficiency, while allowing users to override this behavior with --enable_opt_rtn.

Key Changes:

  • Added is_moe_model() utility function to detect MoE models by examining config keys and module names
  • Changed default value of disable_opt_rtn from True to None to enable automatic optimization detection
  • Implemented logic to automatically disable optimized RTN for MoE expert layers unless explicitly enabled by the user

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
auto_round/utils/model.py Adds is_moe_model() function to detect MoE models through config inspection and module name checking
auto_round/compressors/config.py Changes disable_opt_rtn default from True to None to allow automatic optimization
auto_round/compressors/base.py Implements MoE detection and automatic optimized RTN disabling for expert layers, with improved logging and user override support

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@yiliu30 yiliu30 left a comment

Choose a reason for hiding this comment

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

Others LGTM.

@wenhuach21 wenhuach21 merged commit 9588bf9 into main Jan 9, 2026
28 checks passed
@wenhuach21 wenhuach21 deleted the fix_0108 branch January 9, 2026 05:45
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.

4 participants