mirror of
https://github.com/turboderp-org/exllamav3.git
synced 2026-03-15 00:07:24 +00:00
BlockSparseMLP: Make sure bias is always applied during calibration
This commit is contained in:
@@ -113,6 +113,8 @@ def routing_dots(bsz, cfg, y, params):
|
||||
activate_all_experts = params.get("activate_all_experts")
|
||||
if activate_all_experts:
|
||||
routing_weights = router_logits.sigmoid()
|
||||
if cfg.e_score_correction_bias is not None:
|
||||
routing_weights += cfg.e_score_correction_bias.unsqueeze(0)
|
||||
factor = cfg.routed_scaling_factor / (routing_weights.sum(dim = -1, keepdim = True) + 1e-20)
|
||||
routing_weights *= factor
|
||||
selected_experts = (
|
||||
|
||||
Reference in New Issue
Block a user