Fix DSV4 DSpark sample-from-anchor initialization (#36419)

Co-authored-by: weireweire <20922698+weireweire@users.noreply.github.com>
This commit is contained in:
weireweire
2026-08-25 23:18:58 -07:00
committed by GitHub
co-authored by weireweire
parent 04c1036bb3
commit db15976fe9
@@ -52,6 +52,7 @@ from sglang.srt.models.dspark import (
)
from sglang.srt.runtime_context import get_parallel
from sglang.srt.speculative.dspark_components.dspark_config import (
get_dspark_sample_from_anchor,
parse_dspark_draft_config,
)
from sglang.srt.speculative.ragged_verify import (
@@ -691,6 +692,7 @@ class DeepseekV4ForCausalLMDSpark(nn.Module):
self.gamma = int(
dspark_config.resolve_gamma(default=int(config.num_hidden_layers))
)
self.sample_from_anchor = get_dspark_sample_from_anchor(config)
self.block_size = self.gamma
if dspark_config.target_layer_ids is not None:
self.num_stages = len(dspark_config.target_layer_ids)