fix(ds4): propagate sampler config in layer split#508
Draft
Graffioh wants to merge 1 commit into
Draft
Conversation
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.
Summary
DeepSeek4LayerSplitAdapterStack
Problem
LayerSplitBackend::run_from_state()callsadapter_->begin_request(req)before prefill and decode. The Qwen35, Gemma4, and Laguna layer-split adapters copyreq.samplerinto their request-local sampler state, but the DeepSeek4 adapter discarded the request:As a result, DeepSeek4 layer-split requests silently retained the default sampler configuration. A request sent with
temperature: 0.01andseed: 42still reachedrun_layer_split_ar_decode()withsampler.temp == 0under GDB.The adapter now follows the same contract as the other layer-split implementations:
A non-zero seed explicitly requests reproducible sampling. Seed zero keeps the RNG's existing nondeterministic state and does not disable temperature sampling.
Validation
6c7ee19)git diff --check: passedtemperature: 0.01reachedrun_layer_split_ar_decode()withsampler.temp == 0temperature: 0.01andseed: 42returned the coherent responseThe capital of France is Paris.Follow-up
TO INVESTIGATE: Greedy layer-split decode with
temperature: 0has a separate common-runtime issue:run_layer_split_ar_decode()currently skips logits processing instead of selecting their argmax. That cross-model fix is intentionally kept out of this DeepSeek4-specific change.