Skip to content

Add GCS/filesystem-based weight synchronization - #2295

Open
niting wants to merge 1 commit into
google:mainfrom
niting:gcs-weight-sync
Open

niting wants to merge 1 commit into
google:mainfrom
niting:gcs-weight-sync

Conversation

@niting

@niting niting commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Description

This change introduces a GCS and shared-filesystem based weight synchronization transport (GcsSyncHandler / FilesystemSyncHandler) to Tunix as an alternative/fallback to Raiden.

Motivation

Raiden P2P weight sync can encounter issues with C++ FFI compatibility, complex mesh geometries, and timing drift across slices. This change provides a reliable, decoupled checkpoint-based weight sync mechanism that works over GCS and shared/parallel filesystems (e.g. Lustre / Parallelstore).

Key Changes

  • gcs_weight_sync.py: Added GcsSyncHandler (implementing WeightSyncHandler), apply_checkpoint_to_runner (restoring via Orbax and patching runner state in-place), and monkey-patching for TPUWorker (load_gcs_weights / load_filesystem_weights).
  • weight_sync.py & weight_sync_coordinator.py:
    • Added WeightSyncMode.GCS = "gcs" and alias support for filesystem.
    • Wired create_default_handler to construct GcsSyncHandler.
    • Plumbed checkpoint_path through extra_config into WeightSyncRequest.
    • Added needs_manifest_preflight flag to bypass P2P manifest checks for checkpoint sync.
  • Rollout & Sampler Plumbing:
    • Updated VllmSamplerAdapter and RLVllmSamplerV2 to load weights via load_gcs_weights/load_filesystem_weights in weight_sync().
  • Node Runners & K8s Launchers:
    • Added --weight_sync_mode flag to run_trainer_node.py, run_rollout_node.py, and k8s_launcher.sh.
  • Tests:
    • Added unit tests in tests/experimental/weight_sync/gcs_weight_sync_test.py, tests/experimental/weight_sync/weight_sync_coordinator_test.py, and tests/experimental/rollout/vllm_sampler_adapter_test.py.

Verification

  • Tested up to 3 steps on DeepSWE workflows.
  • Unit tests added for registration, transfer, and runner state leaf patching.

This has been tested uptil 3 steps on DeepSWE workflows and seems to be
working fine. This is very useful to rule out issues with Raiden. I will
also try to follow up with chanages that add a single host based weight
sync on lustre.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants