fix(ds4): correct layer-split HC handoff, per-device state, and greedy decode in local path#507
Draft
Graffioh wants to merge 4 commits into
Draft
Conversation
Contributor
|
We plan to run two AMD GPUs in the same HIP process. g_scratch is currently shared across devices, so the second shard may reuse scratch memory allocated on the first GPU. Please keep one scratch buffer per HIP device, set the correct device in HC worker threads |
8f89434 to
bf8dc45
Compare
bf8dc45 to
ecf55b1
Compare
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
Fixes correctness and device-isolation issues in the DeepSeek4 HC layer-split path:
Stack
Implementation
Local layer split now follows the correct HC flow:
Runtime caches are owned by each shard and keyed by weights, context, backend, device, layer range, and output ownership. HC scratch is stored in independently locked slots indexed by CUDA/HIP device.
For greedy decode, the final shard uses
ggml_argmaxand returns oneint32_t. Full logits are transferred only when CPU-side sampling or penalties require them. This applies to cached, dynamic, fused, local, and remote target-shard paths.Validation
git diff --checkand C++ syntax checks passedtest_deepseek4_unitanddflash_server[0,22)/[22,43)oncuda:0completed sequential greedy requests without HC, CUDA, crash, or abort errorsdevice 0 -> device 1 -> device 0scratch path