[Core] Replace routing replay with device cache and async D2H pipeline (#39917)

Signed-off-by: Tomer Barnatan <tbarnatan@nvidia.com>
This commit is contained in:
TomerBN-Nvidia
2026-05-07 11:24:56 -07:00
committed by GitHub
parent 8eb401134e
commit 8189a15914
15 changed files with 1398 additions and 642 deletions
@@ -246,6 +246,9 @@ class FusedMoE(PluggableLayer):
not supported by the router (or the experts).
"""
# Auto-incrementing layer ID for routing replay buffer binding.
_next_moe_layer_id: int = 0
# --8<-- [end:fused_moe]
def __init__(
@@ -290,6 +293,10 @@ class FusedMoE(PluggableLayer):
):
super().__init__()
# Assign unique layer ID for routing replay buffer binding.
self.moe_layer_id = FusedMoE._next_moe_layer_id
FusedMoE._next_moe_layer_id += 1
if params_dtype is None:
params_dtype = torch.get_default_dtype()
self.params_dtype = params_dtype