-
-
Notifications
You must be signed in to change notification settings - Fork 11.7k
[ModelOpt] Load w13/w2_input_scale for all experts, nvfp4 #26135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This pull request has merge conflicts that must be resolved before it can be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
49543bd to
cbfdd6d
Compare
Signed-off-by: Shu Wang <[email protected]>
cbfdd6d to
597672d
Compare
Signed-off-by: Shu Wang. <[email protected]>
|
For the server (TP4):
client:
server (DP4):
client:
|
Signed-off-by: Shu Wang. <[email protected]>
| # Case input scale: input_scale loading is only supported for fp8 | ||
| if "input_scale" in weight_name: | ||
| # this is needed for compressed-tensors only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: looks like these comments are out of date
| allow_flashinfer = getattr(self.quant_method, "allow_flashinfer", False) | ||
| moe_backend = getattr(self.quant_method, "flashinfer_moe_backend", None) | ||
|
|
||
| use_global_sf = ( | ||
| allow_flashinfer | ||
| and is_flashinfer_supporting_global_sf(moe_backend) | ||
| and "input_scale" in weight_name | ||
| and quant_method_name == "ModelOptNvFp4FusedMoE" | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to put these three lines together and leave a comment on what use_global_sf means in this case since we are in fused_moe/layer.py
mgoin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, although checking for local attrs in fused_moe/layer.py doesn't feel good to keep doing I don't have a better option atm
…ct#26135) Signed-off-by: Shu Wang <[email protected]> Signed-off-by: Shu Wang. <[email protected]> Co-authored-by: Michael Goin <[email protected]>
…ct#26135) Signed-off-by: Shu Wang <[email protected]> Signed-off-by: Shu Wang. <[email protected]> Co-authored-by: Michael Goin <[email protected]>
…ct#26135) Signed-off-by: Shu Wang <[email protected]> Signed-off-by: Shu Wang. <[email protected]> Co-authored-by: Michael Goin <[email protected]> Signed-off-by: Alberto Perdomo <[email protected]>
…ct#26135) Signed-off-by: Shu Wang <[email protected]> Signed-off-by: Shu Wang. <[email protected]> Co-authored-by: Michael Goin <[email protected]> Signed-off-by: 0xrushi <[email protected]>
…ct#26135) Signed-off-by: Shu Wang <[email protected]> Signed-off-by: Shu Wang. <[email protected]> Co-authored-by: Michael Goin <[email protected]> Signed-off-by: 0xrushi <[email protected]>
…ct#26135) Signed-off-by: Shu Wang <[email protected]> Signed-off-by: Shu Wang. <[email protected]> Co-authored-by: Michael Goin <[email protected]>
…ct#26135) Signed-off-by: Shu Wang <[email protected]> Signed-off-by: Shu Wang. <[email protected]> Co-authored-by: Michael Goin <[email protected]>
…ct#26135) Signed-off-by: Shu Wang <[email protected]> Signed-off-by: Shu Wang. <[email protected]> Co-authored-by: Michael Goin <[email protected]>
…ct#26135) Signed-off-by: Shu Wang <[email protected]> Signed-off-by: Shu Wang. <[email protected]> Co-authored-by: Michael Goin <[email protected]>
This matches trt-llm usage. Use all experts' input scales to compute alpha and quantize. This change doesn't affect perf.
Purpose
Test Plan
Test Result
After change: