Skip to content

feat: extend checkpoint-engine refit to SGLang (and Megatron) generation backends #3288

Open

Description

@terrykong

Summary

Checkpoint-engine refit (added in #2608) currently supports only the vLLM generation backend. Requests with a SGLang or Megatron generation backend are rejected at setup:

# nemo_rl/algorithms/grpo.py
if checkpoint_engine_config is not None and backend != "vllm":
    raise NotImplementedError(
        "checkpoint-engine refit is only supported for the vLLM generation "
        f"backend, but policy.generation.backend={backend!r}. ..."
    )

This is a feature request to extend checkpoint-engine refit (and the NIXL backend) to the other generation backends — at minimum SGLang, and Megatron generation if applicable.

Scope / clarification

The restriction is on the generation side only. Checkpoint-engine already supports Megatron, DTensor, and DTensor v2 policy (training) backends on the send side — so this request is specifically about the receive side (the generation engine) being limited to vLLM.

Motivation

Users on SGLang rollouts cannot use the RDMA/NIXL non-colocated refit path and must fall back to the existing transports. A generation-backend-agnostic checkpoint-engine receive path would let SGLang (and any future backend) benefit from the same streamed, bucketed weight transfer.

Notes

  • The design doc already lists this under current limitations: "SGLang checkpoint-engine refit is not implemented." (docs/design-docs/checkpoint-engines.md).
  • The CheckpointEngine transport abstraction is backend-agnostic; the work is on the generation-worker receive/apply side (an SGLang analog of VllmCheckpointEngineMixin / the worker-extension wiring).
  • Tracking issue to be referenced from the setup NotImplementedError so users hitting the guard can follow progress (mirrors how [Refit] Support remote sparse refit in PPO and distillation #3275 tracks the PPO/distillation gap for sparse-delta refit).

Filed as a follow-up to the #2608 review.

Activity

  1. tianyi-zhang-02 commented on Aug 6, 2026

    @tianyi-zhang-02
    Contributor

    I'd like to take this. After tracing both backends I went with Option A: receive checkpoint-engine batches in the SGLang generation worker, then reuse the existing flattened_bucket CUDA-IPC handoff to the server process, so there is no second weight-ingest format to maintain. Dense and standard full-weight MoE are covered; the vLLM-specific shard_expert_weights=true path can follow separately.

    Implementation is in #3519.

  2. tianyi-zhang-02 commented on Aug 7, 2026

    @tianyi-zhang-02
    Contributor

    #3519 implements this and is ready for review. NIXL terminates in the SGLang generation worker, and the weights are handed to the server subprocess over same-node CUDA IPC through the existing flattened_bucket / /update_weights_from_tensor contract, so there is no second weight-ingest format to maintain.

    Before I take it further I would like to resolve an overlap. Three drafts currently touch this ground:

    #3330 and #3426 both rewrite stream_weights_via_http_impl, and #3330 also contains the SGLangGeneration.cfg property that #3519 depends on. I would rather not have three of us converge on the same files without a plan.

    So: which of these do you want to carry the SGLang refit path? I am happy to rebase #3519 onto one of them, keep it standalone, or close it if this is already covered by work in flight.

    If #3519 is the one to go forward with, my remaining items before it leaves draft are the docs update (checkpoint-engines.md and checkpoint-engine-refit.md both still say SGLang is unsupported), registering the functional test with a CI shard, and stronger multi-rank coverage in the unit tests.

  3. wdykas commented on Aug 20, 2026

    @wdykas
    Contributor

    have an AI generated mr for megatron inference here #3739. Will try to get it in shape to merge next week

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions