fix(sglang): expose cfg on SGLangGeneration - #3516
Conversation
create_weight_synchronizer reads generation.cfg unconditionally, before any backend dispatch. SGLangGeneration stored the generation config only as self.sglang_cfg and defined no cfg attribute, so backend=sglang raised AttributeError there instead of getting its HTTPWeightSynchronizer. VllmGeneration, TRTLLMGeneration and MegatronGeneration all expose cfg; megatron_generation.py documents it as the GenerationInterface contract. sglang_cfg already is that same config object, so alias it with a read-only property rather than keep a second reference that could drift. Signed-off-by: Tianyi Zhang <123608656+tianyi-zhang-02@users.noreply.github.com>
|
Closing this in favour of #3519, which carries the identical commit as its first commit — the The underlying bug is unchanged and still worth fixing: Happy to reopen as a standalone five-line PR if you would rather land it separately from the checkpoint-engine work — just say so. |
What does this PR do?
Adds a read-only
cfgproperty toSGLangGeneration, aliasing its existingsglang_cfg.create_weight_synchronizerreadsgeneration.cfgbefore backend dispatch. Without this property, colocated SGLang raisesAttributeErrorinstead of constructing itsHTTPWeightSynchronizer.Testing
SGLangGenerationclassruff checkandruff formatpassIssues
Found while investigating #3288. Draft PR #3330 contains the same property as part of a larger change.
cc @RayenTian @yuki-97