Skip to content
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

Enable GPTQModel to handle GraniteMoeParallelExperts #112

Open
fabianlim opened this issue Nov 20, 2024 · 0 comments
Open

Enable GPTQModel to handle GraniteMoeParallelExperts #112

fabianlim opened this issue Nov 20, 2024 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@fabianlim
Copy link
Contributor

fabianlim commented Nov 20, 2024

Granite MoE uses a 3D tensor to hold the expert weights, so GPTQModel does not work out of the box.

There are two options

  1. module swap GraniteMoeParallelExperts to hold a ModuleList of Linears, then AutoGPTQ will be able to detect them and replace them with QuantLinears
  2. write a custom gptq module that handles the GraniteMoeParallelExperts case

Either of the two approaches will solve both quant + inference paths. Option 1 should be easier than Option 2, but in some sense Option 2 should be more proper.

When doing option 2 we should be reusing code from the original gptq.

  • also it should be written generally, to not just only handle this particular GraniteMoeParallelExperts instance, but all cases with 3D tensors
@fabianlim fabianlim added the help wanted Extra attention is needed label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant