Support LoRA publication to remote inference engines - #2202
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new 'remote_upload' transfer mode for LoRA adapters, enabling training workers to stream and upload adapter files directly to remote vLLM inference servers via HTTP PUT endpoints with SHA256 checksum verification. The review feedback focuses on improving robustness and performance: it recommends replacing Python 3.11's hashlib.file_digest with a chunked fallback for backward compatibility, wrapping JSON parsing in a try-except block to prevent masking HTTP errors, and offloading blocking synchronous I/O operations (such as shutil.rmtree and os.remove) to background threads using asyncio.to_thread to avoid blocking the event loop.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 223abe4. Configure here.
Signed-off-by: Hersh Godse <hersh@trajectory.ai>
Signed-off-by: Hersh Godse <hersh@trajectory.ai>
Signed-off-by: Hersh Godse <hersh@trajectory.ai>

Summary
Validation
4f5ccd8e: zero mean.006000; withheld sampler change0; post-update mean.000706; held-out mean.000761.The live replay required
remote_upload: trainer-local storage is not visible on the disaggregated inference node. The upload endpoint follows the same private control-plane trust boundary as SkyRL's existing load, pause, and weight-update endpoints; this PR bounds each streamed file to 128 GiB and cleans failed or abandoned client publications, but does not introduce a separate authentication system for one endpoint.Replica rollback is fail-closed rather than transactional: if any replica rejects publication, SkyRL removes the named adapter from every reachable replica and raises. A versioned two-phase router cutover would be a broader control-plane change and is not claimed here.
Note
Medium Risk
Changes inference control-plane LoRA delivery and generation routing; failures are handled with rollback, but multi-replica publication is not fully transactional and upload endpoints rely on the existing private trust boundary.
Overview
Adds
remote_uploadas an alternative to shared-disk LoRA sync for disaggregated vLLM inference: training workers can pushadapter_model.safetensorsandadapter_config.jsonover HTTP with declared size and SHA-256 checks, then load byupload_idon each replica.RemoteInferenceClientfans out chunked PUTs, verifies server-returned digests, publishes via/skyrl/v1/load_lora_adapter, and on partial failure unloads the adapter name everywhere and raises; staged upload dirs are always discarded afterward.VLLMServerActorimplements the upload/load/discard endpoints (128 GiB cap, streaming validation) and extends/skyrl/v1/generateto honor amodelLoRA name instead of rejecting LoRA on that route.policy.model.lora.transfer_mode(shared_filesystem|remote_upload) is wired from FSDP and Megatron export paths intoload_lora_adapter; default behavior stays shared filesystem.Reviewed by Cursor Bugbot for commit 49b65c3. Bugbot is set up for automated code reviews on this repo. Configure here.