diff --git a/python/sglang/srt/models/qwen3_5_text.py b/python/sglang/srt/models/qwen3_5_text.py index 8b5e041da..f045c2ce0 100644 --- a/python/sglang/srt/models/qwen3_5_text.py +++ b/python/sglang/srt/models/qwen3_5_text.py @@ -118,6 +118,16 @@ class Qwen3_5ForCausalLM(nn.Module): torch.cuda.empty_cache() torch.cuda.synchronize() + def set_dflash_layers_to_capture(self, layers_to_capture: list[int]): + if not self.pp_group.is_last_rank: + return + if layers_to_capture is None: + raise ValueError( + "DFLASH requires explicit layer ids for aux hidden capture." + ) + self.capture_aux_hidden_states = True + self.model.set_dflash_layers_to_capture(layers_to_capture) + @torch.no_grad() def forward( self,