Conversation
…model optimization Signed-off-by: Xin He <xin3.he@intel.com>
|
@copilot resolve the merge conflicts in this pull request |
# Conflicts: # auto_round/utils/missing_tensors.py Co-authored-by: xin3he <83260933+xin3he@users.noreply.github.com>
|
/azp run Unit-Test-CUDA-AutoRound |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
🟡 Changes recommended
The new NVFP4 dequantization path can crash on int8-packed weights due to a uint8-only unpack assertion, and the fused-expert split patterns/documented behavior are inconsistent for up_gate_proj.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR refactors fused-expert tensor splitting and RTN weight packing utilities into auto_round.utils.model_free_utils, updates call sites/tests to the new import path, and extends the splitting/normalization logic to better handle special fused-expert naming and NVFP4 source tensors in model-free shard processing.
Changes:
- Moved
split_fused_expert_tensors/quantize_weight_rtnintoauto_round.utils.model_free_utilsand updated imports in core code + tests. - Enhanced fused-expert tensor splitting to recognize native FusedMoE suffix conventions and to support a “keep fused” passthrough for specific
model_typevalues. - Updated NVFP4 handling in model-free shard processing to dequantize NVFP4-packed sources when the target scheme is not NVFP4 (instead of letting packed companions fall through).
File summaries
| File | Description |
|---|---|
auto_round/utils/model_free_utils.py |
New home for fused-expert splitting + RTN packing; adds NVFP4 dequantization path and related plumbing. |
auto_round/utils/missing_tensors.py |
Removes local implementations and re-imports helpers from model_free_utils for backward compatibility. |
auto_round/utils/offload.py |
Updates runtime import to the new module for expert tensor splitting. |
auto_round/compressors/shard_writer.py |
Updates runtime import to the new module for fused expert expansion during shard writing. |
auto_round/utils/__init__.py |
Adds a wrapper-based re-export for copy_missing_tensors_from_source. |
test/unit/common/utils/test_missing_tensors.py |
Adds coverage for the new “keep fused for specific model_type” passthrough behavior. |
test/unit/test_cpu/export/test_qlinear_pack_clamp.py |
Updates test import path for quantize_weight_rtn. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ntiguity in dequantization Signed-off-by: Xin He <xin3.he@intel.com>
|
/azp run Unit-Test-CUDA-AutoRound |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Description
This pull request refactors utility functions related to fused expert tensor splitting and weight quantization by moving them from
auto_round.utils.missing_tensorsto a new module,auto_round.utils.model_free_utils. This change improves code organization and modularity. The import paths are updated throughout the codebase to reflect this, and the moved functions are re-exported for backward compatibility.Refactoring and Code Organization:
split_fused_expert_tensorsandquantize_weight_rtnfromauto_round.utils.missing_tensorstoauto_round.utils.model_free_utils, and updated all internal imports and usages accordingly. [1] [2] [3] [4] [5]auto_round/utils/__init__.py, re-exportedcopy_missing_tensors_from_sourceas a wrapper to maintain backward compatibility with previous imports.Cleanup:
split_fused_expert_tensorsandquantize_weight_rtnfromauto_round.utils.missing_tensors.py. [1] [2]These changes do not affect functionality but improve maintainability and clarity by separating model-free utilities from tensor-missing logic.
Type of Change
Bug fix
Related Issues
Fixes or relates to #
Checklist Before Submitting
/azp run Unit-Test-CUDA-AutoRound.