Skip to content

Commit 192a8e6

Browse files
committed
Clarify mixed-precision gate documentation
Co-authored-by: Copilot <[email protected]> Copilot-Session: e10674c1-6909-4b09-9f5a-d41b28c89d2d
1 parent 1099fff commit 192a8e6

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

‎src/mobius/models/moe.py‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,12 @@ class Qwen2MoELayer(MoELayer):
276276
Forward: ``routing_output + sigmoid(shared_gate(h)) * shared_expert(h)``
277277
278278
``linear_class``, when provided, is used for the shared expert's MLP and
279-
-- by default only -- for ``shared_expert_gate``, and is threaded through
280-
to :class:`MoELayer` so it also drives the dense loop-over-experts
281-
fallback (used when the config doesn't match the native QMoE ABI). It has
282-
no effect on the fused QMoE path, whose quantized parameters are
283-
constructed directly by :meth:`MoELayer._init_qmoe_parameters`.
279+
for ``shared_expert_gate`` unless ``shared_expert_gate_class`` overrides
280+
the gate factory. It is also threaded through to :class:`MoELayer` so it
281+
drives the dense loop-over-experts fallback (used when the config doesn't
282+
match the native QMoE ABI). It has no effect on the fused QMoE path, whose
283+
quantized parameters are constructed directly by
284+
:meth:`MoELayer._init_qmoe_parameters`.
284285
285286
``shared_expert_gate_class`` overrides the factory used for the
286287
``shared_expert_gate`` projection only; when it is ``None`` the gate falls

‎src/mobius/models/qwen35.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ def __init__(
341341
config,
342342
gate=gate,
343343
linear_class=linear_class,
344-
# ``None`` falls back to ``linear_class`` (quantized gate).
344+
# ``None`` falls back to ``linear_class``.
345345
shared_expert_gate_class=Linear if _keeps_modules_float(config) else None,
346346
)
347347

0 commit comments

Comments
 (0)