Skip to content

[AMD][LoRA] AMD LoRA RL support tracker #2705

Open

Description

@Arist12

[AMD][LoRA] AMD LoRA RL support tracker

Bugs hit while bringing LoRA RL up on AMD. Each PR is self-contained — reproduction against main and an explanation of the fix live in its own description.

The AMD enablement itself is already merged upstream: SGLang #34702 and #36379 make the MoE-LoRA align kernel JIT-compile under HIP, and Megatron-Bridge #28 supplies the ROCm Transformer Engine grouped-linear contract fields per-expert MoE LoRA needs.

Checkpoint and resume

  • #2669 — every DP/CP replica writes its own adapter shard and the filename is keyed on the global rank, so resuming at a different world size silently leaves some ranks on a fresh adapter. Writes one shard per realized (TP, PP, EP, ETP) coordinate instead.
  • #2516 — the distributed optimizer's fp32 masters and Adam moments are never checkpointed, so a resumed run either steps straight into NaN or has the restored adapter overwritten on its first step. Saves and restores the parameter state, and refreshes the masters on every path that writes adapter weights.
  • #2733 — the native loader reports success for a shard that matches no parameter, is missing tensors, or holds NaN. Validates before the weight copy, and rejects virtual pipeline chunks, whose colliding parameter names the name-keyed shard format cannot represent.
  • #2580 — the exported PEFT adapter carries none of the base_model.model. prefixes PEFT matches on, so external loaders silently get an identity adapter. Delegates serialization to Megatron-Bridge and promotes the staged export weights-first.
  • #2661 — a run relaunched with --lora-adapter-path restarts at rollout 0, re-steps the LR schedule and never finds the dataset cursor, because the LoRA save path writes no latest_checkpointed_iteration.txt and the bridge branch repoints --load. Treats a standard iter_*/adapter path as a resume; anything else stays an explicit warm start.
  • #3102 — RolloutDataSource.save(rollout_id) writes the live cursor, which in async training already belongs to a later rollout, so resuming skips samples. Snapshots the cursor after each generate and saves the one matching rollout_id.

Recipe

  • #2784 — MI350X/MI355X Qwen3-30B-A3B MoE LoRA launcher, run at its defaults for 30 rollouts on both expert-adapter layouts.

Dependencies

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions