File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments