03-model_executor_layers_fused_moe_b12x.py.diff 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. --- baked-ours/model_executor/layers/fused_moe/b12x.py 2026-09-10 19:56:14.000000000 +0200
  2. +++ baked/model_executor/layers/fused_moe/b12x.py 2026-09-11 10:13:47.000000000 +0200
  3. @@ -755,16 +755,20 @@
  4. )
  5. scratch = _workspace_as_b12x_scratch(workspace2, plan)
  6. - _run_b12x_moe_plan(
  7. - plan=plan,
  8. - scratch=scratch,
  9. - hidden_states=hidden_states,
  10. - prepared=prepared,
  11. - topk_weights=topk_weights,
  12. - topk_ids=topk_ids,
  13. - output=output,
  14. - unit_scale_contract=self._quant_mode == "w4a16",
  15. - )
  16. + # Stage 7: phase "moe" of the prefill budget (inert unless DSV41_PREFILL_TIMING=1).
  17. + from vllm.model_executor.kernels.attention.dsa.candidate_blocks import _PrefillTimer
  18. +
  19. + with _PrefillTimer("moe", int(hidden_states.shape[0])):
  20. + _run_b12x_moe_plan(
  21. + plan=plan,
  22. + scratch=scratch,
  23. + hidden_states=hidden_states,
  24. + prepared=prepared,
  25. + topk_weights=topk_weights,
  26. + topk_ids=topk_ids,
  27. + output=output,
  28. + unit_scale_contract=self._quant_mode == "w4a16",
  29. + )
  30. def moe_sum(self, input: torch.Tensor, output: torch.Tensor) -> None:
  31. raise NotImplementedError("LoRA is not supported for B12xExperts")