[quant] Ignore FP8 quantization layers (#20340)
Co-authored-by: qiuxuan.lzw <qiuxuan.lzw@alibaba-inc.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
@@ -333,6 +333,7 @@ class Envs:
|
||||
SGLANG_PER_TOKEN_GROUP_QUANT_8BIT_V2 = EnvBool(False)
|
||||
SGLANG_NVFP4_CKPT_FP8_NEXTN_MOE = EnvBool(False)
|
||||
SGLANG_QUANT_ALLOW_DOWNCASTING = EnvBool(False)
|
||||
SGLANG_FP8_IGNORED_LAYERS = EnvStr("")
|
||||
|
||||
# Flashinfer
|
||||
SGLANG_IS_FLASHINFER_AVAILABLE = EnvBool(True)
|
||||
|
||||
@@ -131,6 +131,14 @@ class Fp8Config(QuantizationConfig):
|
||||
raise ValueError(f"Unsupported activation scheme {activation_scheme}")
|
||||
self.activation_scheme = activation_scheme
|
||||
self.ignored_layers = ignored_layers or []
|
||||
if ignored_layers_str := envs.SGLANG_FP8_IGNORED_LAYERS.get():
|
||||
self.ignored_layers.extend(
|
||||
[
|
||||
layer.strip()
|
||||
for layer in ignored_layers_str.split(",")
|
||||
if layer.strip()
|
||||
]
|
||||
)
|
||||
self.packed_modules_mapping = packed_modules_mapping or {}
|
||||
self.use_mxfp8 = use_mxfp8
|
||||
if weight_block_size is not None:
|
||||
|
||||
Reference in New Issue
Block a user