Repository navigation
Conversation
|
make编译不过; |
|
Need to add sentencepiece library manually |
|
@wizd I using your fork, the intract mode is not work: it was in dead loop..... |
|
Resolved in #79 |
|
Oh wait, did I get confused? |
|
I think it does. Are you still able to reproduce the issues? |
|
I reran the There are 2 problems still:
|
|
Can you try running from shell script encoded as UTF-8 and outputting to a text file? Your terminal might not be handling Unicode correctly. You’ll also need to re-generate your models from scratch since this PR changes how the ggml files are created. |
|
@ggerganov just in case: did you re-run the quantization script as well? |
Oops .. all good now 🦙 |
|
suggestion: can we add a magic version number? i feel we’ll get further updates?
…On Mon, Mar 13, 2023 at 21:08, Georgi Gerganov ***@***.***> wrote:
> ***@***.***(https://github.com/ggerganov) just in case: did you re-run the quantization script as well?
Oops .. all good now 🦙
—
Reply to this email directly, [view it on GitHub](#87 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AADHVK435NNAH7DLEKXMTEDW35WCRANCNFSM6AAAAAAVYZNR34).
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
|
Does this merge into master? How to test it? The wizd's branch doesn't work well with intract mode. |
|
@ggerganov |
Fix TypeError in low_level chat
…l-fix vulkan: fix turbo3 build + coopmat FA after April upstream sync
* iq3_k: fix Metal dot product I was accessing the scales as 4-byte aligned, but iq3_k is not 4-byte aligned. Instead of throwing an error (as it happens on CUDA when one makes this mistake), Metal silently accepts and we get garbage. * iq3_k: slightly faster Metal dot product --------- Co-authored-by: Iwan Kawrakow <iwan.kawrakow@gmail.com>
Mirror of @apollosenvy's turbo3_0 Vulkan SET_ROWS port (PR PrismML-Eng#33 + PrismML-Eng#87) to the other two turbo types. Reported by @dpblnt in PrismML-Eng#50 with a clean matrix on RX 9060 XT showing turbo3 V works on Vulkan but turbo2/turbo4 V abort with: pre-allocated tensor (cache_v_l*) in a buffer (Vulkan0) that cannot run the operation (SET_ROWS) at llama_context::sched_reserve() time, before any compute runs. Mechanical port across 4 files: - vulkan-shaders/types.glsl: block_turbo2_0 + block_turbo4_0 struct declarations matching the C side (ggml-common.h). - vulkan-shaders/copy_to_quant.comp: SET_ROWS quantize main() blocks for turbo2 (4 centroids, 2-bit pack, no signs byte) and turbo4 (16 centroids, 4-bit nibble pack, no signs byte). WHT setup and reduction structure identical to turbo3 (QK = 128 across all three). Centroid + midpoint tables ported from CENTROIDS_2BIT and CENTROIDS_4BIT in ggml-turbo-quant.c. - vulkan-shaders/vulkan-shaders-gen.cpp: turbo2_0 and turbo4_0 added to the set_rows iteration list at line ~789. - ggml-vulkan.cpp: SET_ROWS pipeline registrations + supports_op switch + dispatch element-count all extended with TURBO2_0 and TURBO4_0 cases. ## Verified on llvmpipe Vulkan (CPU software, AMD MI300X cloud droplet) Patched ggml-vulkan.cpp temporarily during repro to allow llvmpipe (normally filtered out as eCpu); patch reverted before commit. The SET_ROWS abort is a backend-capability check at graph build time so it fires regardless of GPU vs CPU Vulkan backend. | ctk / ctv | tg16 (t/s) | status | |-------------------|-----------:|---------------| | q4_0 / q4_0 | 17.68 | baseline | | q4_0 / turbo3 | 5.91 | already worked| | q4_0 / turbo4 | 6.14 | was aborting | | q4_0 / turbo2 | 5.65 | was aborting | llvmpipe perf numbers are not meaningful (CPU-emulated Vulkan); they are reported here only to confirm the abort is gone and the kernels run end-to-end without divergence. ## Needs GPU validation Cannot validate GPU shader correctness on the droplet (MI300X SR-IOV VF does not expose itself to RADV/amdvlk on cloud). Specifically: - Subgroup shuffle / ballot behavior on real GPU subgroup sizes - Shader compilation under non-llvmpipe Vulkan drivers - PPL / quality on the actual quantization math @dpblnt @apollosenvy if either of you has cycles, would appreciate a quick rebuild on RDNA Vulkan (gfx1100/gfx1200) to confirm: 1. The SET_ROWS abort that triggered PrismML-Eng#50 is gone 2. Output coherence on turbo4 V (not garbage tokens) 3. PPL stays in the expected ballpark vs the CUDA / Metal implementations of the same quants Closes PrismML-Eng#50. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Campaign fold (wip/moe-expert-cache, beta2): adds the generic backend expert-cache interface -- `moe_cache_update`, `moe_cache_take_over`, `moe_cache_promote` and `moe_cache_gather` in the backend iface (ggml-backend-impl.h) -- so a backend can drive a residency policy for a host-resident routed-expert table, plus the scheduler half of the consumer: the routed-expert rebalance onto the layer's owning device and the merged per-layer MoE split (ggml-backend.cpp), the device-side expert gather that defers a gatherable routed table from whole-tensor H2D staging, the input-takeover fast path with its deferred promotion pass, the Meta delegation to the per-device simple backends (ggml-backend-meta.cpp), and the `#define GGML_ENV_STR` cache macro the campaign's gates use. The cache engine and its CUDA consumers land in block 13; the gemma4 `-sm tensor` exclusion is in block 14. The CPU and RPC backend vtables name the four new iface fields (NULL) so the set stays warning-free. Amended for the promotion candidate (beta4): keep the scheduler changes prefill-neutral. The device gather now serves only the below-`sched_stage_min_tokens` band (above it the r16/r26 whole-shard staging wins: Q4_K_M ub8192 staging 5283 vs gather 4035; `-sm layer` ncmoe 40 4511 vs 2625), and the routed-expert rebalance is gated to the decode/verify band (`MUL_MAT_ID` `ne[2] <= 8`), where the cache runs. Prefill then matches `main` (r28) at every measured cell while the below-gate gather wins (ub512 +17 %, ub1024 +19 %) are kept. beta5 (2026-10-02): the device gather now also serves a large (>= 224 MiB) host-resident expert table above the width gate. Re-measured with --lazy-mode off (the qwen4exp PLE mmap warm-up confounds every prefill comparison): qwen4exp 450 MiB ub8192 gather 3052 vs staging 1403; Q8_0 272 MiB 3595 vs 3552; Q4_K_M 144 MiB gather 4291 vs staging 5624, so Q4_K_M keeps the width gate. r35 (2026-10-04): issue ggml-org#87's synchronous graph-input fix is now default-on. The r33 `GGML_SCHED_SYNC_GRAPH_INPUTS=1` A/B candidate still reads the variable, but unset means enabled; `=0` restores the r26 async behaviour. The reporter confirmed it clears their recurrent-state H2D race, and same-seed output is unchanged both ways. r5 (2026-10-05, PR ggml-org#96): re-stage a host-resident expert table for a second MUL_MAT_ID consumer in a later split. `ggml_backend_sched_split_graph` registered a weight as a split input only when it first created the copy, so when the same expert weights fed `MUL_MAT_ID` in two splits the later split reused the earlier split's copy. With the expert cache armed that copy was taken over by the 1-row decode-band consumer (`moe_cache_take_over` aliases it and the op never fills it), so the later wide consumer read stale bytes. qwen4exp's unmasked MTP export (a full-row last-layer FFN next to the gathered logits tail) is exactly that second consumer: the wide op produced NaN in `t_h_nextn`, which reached the drafter's KV and collapsed MTP draft acceptance across every slot. When the copy already exists and the node is a `MUL_MAT_ID` reading WEIGHTS through src[0], register the weights as an input of the current split as well (once per split), so they are staged for this split's routing. Single-consumer graphs are unchanged. Contributor PR ggml-org#96 (@briansp2020). Folded 2026-10-07 (TODO ggml-org#45): the stale `--load-mode none` + `-sm tensor` host-expert warning is removed. Its stated mechanism (host experts landing in a pageable CPU_REPACK buffer) no longer holds: the loader pins the routed experts in `ROCm_Host` and the fault no longer reproduces (14/14 clean on r24). Record: archive/work/host-pinned-buffer-crash/.
Campaign fold (wip/moe-expert-cache, beta2): adds the generic backend expert-cache interface -- `moe_cache_update`, `moe_cache_take_over`, `moe_cache_promote` and `moe_cache_gather` in the backend iface (ggml-backend-impl.h) -- so a backend can drive a residency policy for a host-resident routed-expert table, plus the scheduler half of the consumer: the routed-expert rebalance onto the layer's owning device and the merged per-layer MoE split (ggml-backend.cpp), the device-side expert gather that defers a gatherable routed table from whole-tensor H2D staging, the input-takeover fast path with its deferred promotion pass, the Meta delegation to the per-device simple backends (ggml-backend-meta.cpp), and the `#define GGML_ENV_STR` cache macro the campaign's gates use. The cache engine and its CUDA consumers land in block 13; the gemma4 `-sm tensor` exclusion is in block 14. The CPU and RPC backend vtables name the four new iface fields (NULL) so the set stays warning-free. Amended for the promotion candidate (beta4): keep the scheduler changes prefill-neutral. The device gather now serves only the below-`sched_stage_min_tokens` band (above it the r16/r26 whole-shard staging wins: Q4_K_M ub8192 staging 5283 vs gather 4035; `-sm layer` ncmoe 40 4511 vs 2625), and the routed-expert rebalance is gated to the decode/verify band (`MUL_MAT_ID` `ne[2] <= 8`), where the cache runs. Prefill then matches `main` (r28) at every measured cell while the below-gate gather wins (ub512 +17 %, ub1024 +19 %) are kept. beta5 (2026-10-02): the device gather now also serves a large (>= 224 MiB) host-resident expert table above the width gate. Re-measured with --lazy-mode off (the qwen4exp PLE mmap warm-up confounds every prefill comparison): qwen4exp 450 MiB ub8192 gather 3052 vs staging 1403; Q8_0 272 MiB 3595 vs 3552; Q4_K_M 144 MiB gather 4291 vs staging 5624, so Q4_K_M keeps the width gate. r35 (2026-10-04): issue ggml-org#87's synchronous graph-input fix is now default-on. The r33 `GGML_SCHED_SYNC_GRAPH_INPUTS=1` A/B candidate still reads the variable, but unset means enabled; `=0` restores the r26 async behaviour. The reporter confirmed it clears their recurrent-state H2D race, and same-seed output is unchanged both ways. r5 (2026-10-05, PR ggml-org#96): re-stage a host-resident expert table for a second MUL_MAT_ID consumer in a later split. `ggml_backend_sched_split_graph` registered a weight as a split input only when it first created the copy, so when the same expert weights fed `MUL_MAT_ID` in two splits the later split reused the earlier split's copy. With the expert cache armed that copy was taken over by the 1-row decode-band consumer (`moe_cache_take_over` aliases it and the op never fills it), so the later wide consumer read stale bytes. qwen4exp's unmasked MTP export (a full-row last-layer FFN next to the gathered logits tail) is exactly that second consumer: the wide op produced NaN in `t_h_nextn`, which reached the drafter's KV and collapsed MTP draft acceptance across every slot. When the copy already exists and the node is a `MUL_MAT_ID` reading WEIGHTS through src[0], register the weights as an input of the current split as well (once per split), so they are staged for this split's routing. Single-consumer graphs are unchanged. Contributor PR ggml-org#96 (@briansp2020). Folded 2026-10-07 (TODO ggml-org#45): the stale `--load-mode none` + `-sm tensor` host-expert warning is removed. Its stated mechanism (host experts landing in a pageable CPU_REPACK buffer) no longer holds: the loader pins the routed experts in `ROCm_Host` and the fault no longer reproduces (14/14 clean on r24). Record: archive/work/host-pinned-buffer-crash/.


The tokenization process of LLaMA is filled with magic numbers and not easily replicable. However, I have found that using the SentencePiece library works well. It's possible that the original LLaMA model also used SentencePiece for its tokenization.
test prompt: '我静静的坐在雨中,思考着'
I sit quietly in the rain, thinking
This sentence was heavily tokenized to <0x??>, making it very difficult to replicate.