forked from ggml-org/llama.cpp
-
Notifications
You must be signed in to change notification settings - Fork 1
DeepSeek-V3.2-Exp #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
createthis
wants to merge
429
commits into
master
Choose a base branch
from
deepseek_v3_2_exp
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+16,859
−11
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
This comment was marked as off-topic.
This comment was marked as off-topic.
instead always view the full kv_size:
- Before: returned [D_index, n_kv, ns] where n_kv could be 256
during decode with flash-attn.
- Now: always returns [D_index, kv_size, ns].
- If multiple streams are active, the code reshapes to merge the
stream dimension and then returns a 3D view to keep the KV axis
contiguous for the indexer:
- Ensures [D_index, kv_size, ns] semantics regardless of stream
count.
performance reasons.
…nto deepseek_v3_2_exp
remove any score-shaping bias (e.g., ALiBi) from that step. Apply ALiBi only in the final attention computation.
tilelang implementations.
compute_indexer_triplet: lower epsilon in K-indexer normalization
by ensuring dStarts and dEnds are populated.
itself, compiled to cuda c. Note that this creates a dependency on cutlass, so this may forever stay on my private branch.
unit test is failing. Working on it.
fp8 in cuda too. Still not working though.
src/llama-sparse-indexer.cpp where it belongs.
idx_compute_scores_tile ) with the k_indexer_logits_tiled_f32 kernel. In the process, identified and fixed two bugs in idx_compute_scores_tile. Next step is to hopefully use this new test as a pattern to properly unit test the tilelang kernel.
that our FP8 CPU code is correct.
**File:** `ggml/src/ggml-fp8.cpp` **Function:** `template<int E> inline float fp8_to_float(const FP8<E>& in)` Problem: For E4M3 (E=4), GGML’s generic decoder treated all 7 value bits as a finite encoding, so codes `0x7f` and `0xff` decoded to `+4 80` and `-480` instead of NaN. CUTLASS’s `float_e4m3_t` (and the CPU helper in `tests/fp8-e4m3-cpu.h`) interpret the pattern: - exponent = 0xF (all 4 exponent bits) - mantissa = 0x7 (all 3 mantissa bits) as **NaN**, independent of sign, i.e. for both `0x7f` and `0xff`.
GGML_CUDA_DISABLE_GRAPHS=1 \ LLAMA_SPARSE_PROF=1 \ LLAMA_SPARSE_PROF_EACH=1 \ LLAMA_INDEXER_TL_FP8_DEBUG=1 \ LLAMA_INDEXER_TL_PORT=1 \ LLAMA_TL_FP8=1 \ ./scripts/debug-test.sh test-indexer-fused-op-cuda 0 passes. This compares the tilelang vendored kernel with out CPU reference kernel, `idx_compute_scores_tile`.
tilelang vendored kernel mathematically. Slightly slower. 4.82 tok/s vs 6.0 tok/s on my hardware.
restores a fair bit (if not all) of the lost performance: - The inner-most `d` loop does only `dot += qv[d] * kvp[d];` - All FP8 work has been hoisted into the Qq/Kh precomputation loops, which are O(D * H * Tc + D * kv) instead of O(D * H * Tc * kv).
…nternally and matches the CPU FP8 reference, so the H=4 WMMA path test passes
… in the optimized path) now: - Uses FP8 E4M3 quantization for Q and K, - Uses the same per-row K scale `K_sf = amax/448` as the CPU reference, - Uses `k_scale * K_sf` as the final scaling, and - Matches the CPU `idx_compute_scores_tile` FP8 Lightning Indexer to ~3e-6 for the test shape.
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.
Don't merge. WIP.