Skip to content

[DO NOT MERGE] Copy of #2740 - #2766

Draft
Xiaoyu Z (xiaoyu-work) wants to merge 1 commit into
mainfrom
pin-eager-experts-for-moe-quant
Draft

Xiaoyu Z (xiaoyu-work) wants to merge 1 commit into
mainfrom
pin-eager-experts-for-moe-quant

Conversation

@xiaoyu-work

Copy link
Copy Markdown
Member

Describe your changes

Independent copy of #2740: Pin the eager experts implementation in moe=True quantized checkpoints.

Copies Iyanuoluwa007/Olive:pin-eager-experts-for-moe-quant to the same branch name in microsoft/Olive, preserving the original commits. The original PR remains unchanged.

Validation: the copied branch head matches the source PR head. Tests and lintrunner -a were not run for this copy-only operation; the existing code has not been revalidated.

Checklist before requesting a review

  • Add unit tests for this change.
  • Make sure all tests can pass.
  • Update documents if necessary.
  • Lint and apply fixes to your code by running lintrunner -a
  • Is this a user-facing change? If yes, give a description of this change to be included in the release notes.

(Optional) Issue link

Source PR: #2740.

transformers picks the grouped_mm fused-experts forward by default, even on
CPU. It transposes the expert weight, which a storage-only QuantTensor can't
do, so running a reloaded Rtn/Gptq/KQuant(moe=True) checkpoint crashed with
"Shape-movement / view ops ... are not supported on an Olive QuantTensor".

save_pretrained doesn't persist the experts implementation, so finalize()
now writes "experts_implementation": "eager" to the saved config.json (after
save_metadata, which rewrites that file). from_pretrained then loads the
checkpoint with the eager forward, which uses the weight without moving it.

Fixes #2619

This branch has not been deployed

No deployments
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