Skip to content

[Feature] Refactor Refit Unit Tests with SHA256 Verification #18893

@zhaochenyang20

Description

@zhaochenyang20

Checklist

Motivation

Recently, the SHA256 checksum has been a powerful tool to verify whether the weights have been correctly updated and remain bit-for-bit identical to the target state. @dreamyang-liu

Currently, SGLang supports three major weight refit strategies for RL systems:

  1. update_weights_from_disk
  2. update_weights_from_tensor
  3. update_weights_from_distributed

However, the existing unit tests for these interfaces could be more robust. We believe using SHA256 to verify the weight buffers after refitting will provide a much stricter guarantee of correctness, preventing silent mismatches in RL rollout and training loops.

In this sense, we can try to:

  1. Refactor LLM Refit Tests: Rewrite the unit tests for the three LLM refit interfaces using SHA256 verification.
  2. Correctness Guarantee: Ensure that after any refit operation, the in-memory weights match the source perfectly.

Related resources

https://docs.sglang.io/advanced_features/sglang_for_rl.html#open-to-use-refit-functionality

#18306

#18891

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