Skip to content

[MoE] Hot experts on RNGD during training (host dispatch, device expert graphs) #14

Closed

Description

@gspark-etri

Problem

In MoE training on RNGD (#6) every expert runs on the host. In inference (OptimusPrime moe_offload) hot experts stay resident on RNGD and only cold ones run on the host; training should do the same.

Evidence

Inference: Qwen3-30B / Solar-Open-100B with RNGD expert tiers (OptimusPrime rngd-opt, 186–640 µs per token for k=1..8 experts). Training today: all S×top-k expert evaluations on the host CPU, forward + recomputed forward + backward per layer.

Proposal

Routing and token dispatch stay on the host (no device gather). Per (H, F, bucket of rows) compile expert forward and backward graphs (backward: dx; and dW for full FT); hot experts' weights resident on the device, rows gathered on the host, padded to the bucket, uploaded, computed, results scattered back on the host. Placement from a routing profile, re-planned between steps as routing drifts (the inference planner's adaptive re-placement).

Scope

LoRA (experts frozen) first, then full FT (dW for resident experts, host AdamW, re-upload).

Done when

Device-expert path == host path on CPU backend (outputs and gradients); on RNGD, hot fraction and step time vs all-host reported for Qwen3-30B-A3B.

Owner

@gspark-etri

Activity

  1. self-assigned this
    on Oct 20, 2026
  2. added 10 commits that reference this issue on Oct 20, 2026
    404f471
    8966da9
    b22b60b
    6fb844d
    e39197d
    be90955
    3fe5e54
    eb9d840
    de385bd
    86f5b71
  3. gspark-etri commented on Oct 21, 2026

    @gspark-etri
    ContributorAuthor

    Done-when met by #38 and #44:

    • CPU backend: the device-expert path equals the host path. test_moe_hot_experts_on_device_match_host checks outputs and LoRA gradients, plus the device-call count. test_host_mlp_keep_graph_equals_recompute checks LoRA input gradients and full-FT parameter gradients, bitwise.
    • RNGD, Qwen3-30B-A3B, LoRA r16, hot fraction 0.25: median step 5.19 s with hot experts, against 8.00 s host-only with the same keep_graph change and 9.21 s for host-only as on main. That is 6 of 6 rounds faster, a paired median of −33 % (MoE: keep the host MoE forward graph for backward; hot experts beat host-only on RNGD #44).
    • Full FT: the batched path carries the expert weight gradients back to host AdamW through the stacked host weights (MoE hot experts: one batched device call per layer #38). Device dW kernels for resident experts were not needed for this criterion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions