diff --git a/python/sglang/srt/models/deepseek_v2.py b/python/sglang/srt/models/deepseek_v2.py index da96f9ba3..8246f8ea5 100644 --- a/python/sglang/srt/models/deepseek_v2.py +++ b/python/sglang/srt/models/deepseek_v2.py @@ -2564,9 +2564,12 @@ class DeepseekV2ForCausalLM(nn.Module, DeepseekV2WeightLoaderMixin): self.model.layers_to_capture = [2, num_layers // 2, num_layers - 3] else: self.capture_aux_hidden_states = True - # we plus 1 here because in sglang, for the ith layer, it takes the output - # of the (i-1)th layer as aux hidden state - self.model.layers_to_capture = [val + 1 for val in layer_ids] + # TODO (Qiaolin-Yu): check if other draft models need similar layer id + # adjustment + if layer_ids and layer_ids[0] == 1: + self.model.layers_to_capture = [val + 1 for val in layer_ids] + else: + self.model.layers_to_capture = list(layer_ids) def set_dflash_layers_to_capture(self, layer_ids: List[int]): if not self.pp_group.is_last_rank: