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

Support Mixtral quantization using HQT #67

Closed
wants to merge 24 commits into from

Conversation

dudilester
Copy link

No description provided.

@dudilester
Copy link
Author

Wrapped the habana static_fused_moe function using a Class
Wrapped the MoE matmul calculations using a Class as well.
When running inference with HQT quantization, transposed weights of the different MoEs are calculated once and statically saved (to avoid re-calculation on each forward call)
MatmulMoe Calsses of the StaticFusedMoe instance are patched using the HQT to quantize its MoE weights and stat tensors.

final_hidden_states += current_hidden_states_static

return final_hidden_states.view(-1, D)
class MoeMatmul(nn.Module):
Copy link

Choose a reason for hiding this comment

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

Better call it MoeLinear as it more acts like a linear than a matmul

Copy link

Choose a reason for hiding this comment

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

or just use Linear without bias

@dudilester dudilester force-pushed the dev/dlester/mixtral_hqt branch from 5d9f4de to e814a4a Compare July 1, 2024 09:18
@dudilester dudilester force-pushed the dev/dlester/mixtral_hqt branch from e814a4a to f4f3437 Compare July 7, 2024 09:46
@dudilester dudilester force-pushed the dev/dlester/mixtral_hqt branch from f4f3437 to 87d95ad Compare July 7, 2024 11:06
@dudilester dudilester closed this Jul 24, 2024
@dudilester dudilester deleted the dev/dlester/mixtral_hqt branch July 24, 2024 12:13
michalkuligowski added a commit that referenced this pull request Jan 15, 2025
remove expert_max hard code (#47)
vLLM-Ext: Full enabling of ALiBi (#34)
Add version inference via setuptools-scm (#58)
Revert "vLLM-Ext: Full enabling of ALiBi (#34)" (#59)
Remove punica_hpu.py from vllm_hpu_extension (#66)
Removed previous (not-pipelined) pa implementation (#72)
Add flag to enable running softmax in fp32 (#71)
Update calibration readme link (#73)
allow lm_head quantization in calibration process (#65)
Pad to bmin if value is less (#67)
Update pyproject.toml (#75)

---------

Co-authored-by: Michał Kuligowski <[email protected]>
mfylcek added a commit that referenced this pull request Jan 21, 2025
remove expert_max hard code (#47)
vLLM-Ext: Full enabling of ALiBi (#34)
Add version inference via setuptools-scm (#58)
Revert "vLLM-Ext: Full enabling of ALiBi (#34)" (#59)
Remove punica_hpu.py from vllm_hpu_extension (#66)
Removed previous (not-pipelined) pa implementation (#72)
Add flag to enable running softmax in fp32 (#71)
Update calibration readme link (#73)
allow lm_head quantization in calibration process (#65)
Pad to bmin if value is less (#67)
Update pyproject.toml (#75)

---------

Co-authored-by: Michał Kuligowski <[email protected]>
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.

6 participants