-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
[Misc] Support FP8 MoE for compressed-tensors #8588
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
Changes from 6 commits
09b16c6
4dd4202
6b9d69c
c2d05ca
5aec5f2
464aa75
b1cae36
8e32e45
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
from vllm.model_executor.layers.quantization.base_config import ( # noqa: E501 | ||
QuantizationConfig, QuantizeMethodBase) | ||
from vllm.model_executor.layers.quantization.compressed_tensors.compressed_tensors_moe import ( # noqa: E501 | ||
CompressedTensorsMoEMethod) | ||
CompressedTensorsW8A8Fp8MoEMethod, CompressedTensorsWNA16MoEMethod) | ||
from vllm.model_executor.layers.quantization.compressed_tensors.schemes import ( | ||
W4A16SPARSE24_SUPPORTED_BITS, WNA16_SUPPORTED_BITS, | ||
CompressedTensorsScheme, CompressedTensorsW4A16Sparse24, | ||
|
@@ -73,7 +73,17 @@ def get_quant_method( | |
if isinstance(layer, Attention): | ||
return CompressedTensorsKVCacheMethod(self) | ||
if isinstance(layer, FusedMoE): | ||
return CompressedTensorsMoEMethod(self) | ||
# TODO: @dsikka: refactor this to use schemes as other kernels | ||
# are supported + check if the layer is being ignored. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we're now expanding the supported schemes, we should have this just return There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I made a static function |
||
weight_quant = self.target_scheme_map["Linear"].get("weights") | ||
input_quant = self.target_scheme_map["Linear"].get( | ||
"input_activations") | ||
if self._is_wNa16_group_channel(weight_quant, input_quant): | ||
return CompressedTensorsWNA16MoEMethod(self) | ||
elif self._is_fp8_w8a8(weight_quant, input_quant): | ||
return CompressedTensorsW8A8Fp8MoEMethod(self) | ||
else: | ||
raise RuntimeError(f"Unsupported FusedMoe scheme: {scheme}") | ||
return None | ||
|
||
@classmethod | ||
|
Uh oh!
There was an error while loading. Please reload this page.