Repository navigation
Conversation
Contributor
|
Handle this by adding an entry to |
1 task done
Contributor
Author
OK. I rework it as a parameter table entry in #31268 . |
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.
Overview
MMVQ normally uses
small_kwhennwarps > 1and K is small enough for a thread block to cover a row in one loop iteration. There are also rules based on the data type and GPU architecture. On Orin, the default single-column layout processes one row per block for most types. It processes two rows per block forQ1_0,Q2_K,Q3_K,IQ1_S, andIQ1_M.This PR removes the K-size limit for single-column MMVQ without
idson Jetson Orin (cc == GGML_CUDA_CC_ORIN). It keeps thenwarps > 1check. It also keeps the rule that single-columnIQ3_XXSandIQ3_Sdo not usesmall_kon Orin. The change applies to AGX Orin, Orin NX, and Orin Nano. It was tested on an Orin Nano Super Developer Kit.Use llama-bench test on Orin Nano Super in different quant types, with MAXN_SUPER +
jetson_clocks, decode (tg128) speed rose. Only modify libggml-cuda.so for each comparison.Use
LFM2.5.Reason
For single-column MMVQ on Orin, the GENERIC parameter table sets
nwarpsto 4. Thesmall_klayout sets the number of rows per block tonwarps, so each block processes four rows. Each thread computes part of all four rows.This lets a thread issue more weight reads at the same time. It may help hide memory access latency. We have not yet confirmed whether memory latency or bandwidth limits the speed.
Change
The change is in
should_use_small_k, insidemul_mat_vec_q_switch_ncols_dst. It setsusetonwarps > 1when all four conditions are met:GGML_CUDA_CC_IS_NVIDIA(cc)cc == GGML_CUDA_CC_ORIN(compute capability 8.7)c_ncols_dst == 1!has_idsThe
!has_idscheck excludes theMUL_MAT_IDpath used for MoE. The data type checks still run after this new condition.Result
Quantization sweep (
compare-llama-bench.py, LFM2.5-VL-3B LM quantized withllama-quantize --pure)Single-column mat-vec (
test-backend-ops perf -o MUL_MAT -b CUDA0 -p 'n=1,', µs/run, mean of 2)LFM2.5 models as distributed (tg128, t/s)
Additional information
GGML_CUDA_DISABLE_FUSIONwill have an impact on this PR. Disabling the fusion will lead to a slight decrease in decoding speed on themasterbranch, whereas this PR will see a notable improvement in decoding speed. Even in PR scenarios, disabling fusion results in faster decoding speeds compared to having it enabled.Fused gate/up path (
GGML_CUDA_DISABLE_FUSION, tg128, t/s, 2 rounds each)This PR has been tested exclusively on the Jetson Orin Nano, and evaluations were conducted solely for the LFM2.5 series of models.
Correctness
The order of accumulation along the K-dimension for each row remains unchanged; only the number of rows processed in each block has changed.
test-backend-ops -o MUL_MAT -b CUDA0(2 runs each)llama-perplexityLFM2.5-2.6B Q4_K_M, WikiText-2,-c 512 --chunks 10 -ub 1llama-perplexityLFM2.5-VL-3B Q4_K_M, same settingsEnvironment
jetson_clocks, and a set of comparisons at the default 25W power level.Related
#20635
#28285
#26843
#15034
Command
Requirements