docs: add self-contained multi-LoRA RL example (SGLang + TensorRT-LLM backends)#12
Open
kiddyboots216 wants to merge 1 commit into
Open
docs: add self-contained multi-LoRA RL example (SGLang + TensorRT-LLM backends)#12kiddyboots216 wants to merge 1 commit into
kiddyboots216 wants to merge 1 commit into
Conversation
… backends) A single-file, engine-agnostic example for RL-style training of many LoRA adapters over one shared base: train each adapter, export it, serve it, and sample per-adapter rollouts (with token logprobs). The same recipe runs against two rollout backends behind one RolloutEngine interface — SGLang (HTTP) and TensorRT-LLM (in-process LLM API + LoRARequest). The header is a runbook for launching the XORL training server (using a LoRA config from this repo) and the rollout engine, then running the recipe.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a single self-contained example —
examples/server/multilora/multilora_rl_recipe.py— for RL-style training of many LoRA adapters over one shared base model, with rollouts served by a pluggable inference engine.The flow: create N LoRA adapters (heterogeneous rank/optimizer) → train each a few steps → export → make servable → sample per-adapter rollouts (with per-token logprobs). It has no sibling imports and inlines its session specs, so it reads and runs as one file.
Two rollout backends implement the same
RolloutEngineinterface:SGLangEngine— HTTP: the training server'screate_sampling_session+ SGLang/generatewith per-requestlora_path+return_logprob.TRTLLMEngine— TensorRT-LLM's in-processLLMAPI +LoRARequest+SamplingParams(moe_backend="CUTLASS", per-expert PEFT adapters).The module header is a runbook: how to launch the XORL training server (using
examples/server/configs/lora/qwen3_30b_a3b_lora.yaml), launch the rollout engine, and run the recipe.Notes