Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion python/sglang/srt/layers/quantization/moe_wna16.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,13 @@ def get_quant_method(


def is_layer_skipped_quant(prefix: str, modules_to_not_convert: List[str]):
return any(module_name in prefix for module_name in modules_to_not_convert)
# Optimize by short-circuiting for empty list, and avoid generator overhead by using set lookup if possible.
# However, the logic is substring matching not equality, so fastest is to avoid any function call per loop.
# Hoisting 'in' out of generator expression for micro-optimization, and eliminate generator object.
for module_name in modules_to_not_convert:
if module_name in prefix:
return True
return False


class MoeWNA16Method(FusedMoEMethodBase):
Expand Down