Skip to content

Fix server crashes - #2076

Merged
SlyEcho merged 1 commit into
masterfrom
fix-server-crashes
Jul 3, 2023
Merged

SlyEcho merged 1 commit into
masterfrom
fix-server-crashes

Conversation

@SlyEcho

@SlyEcho SlyEcho commented Jul 3, 2023

Copy link
Copy Markdown
Contributor

-1 is not a valid token and can cause segfaults, but it may be returned in some cases where a valid token was not generated.

@SlyEcho
SlyEcho requested a review from Green-Sky July 3, 2023 00:42

@Green-Sky Green-Sky left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm mergeable, but i think token index 0 is the token for unknown. at least with the llama vocab. (llama.cpp never uses this token, I know this because I recently generated a bytewise vocab, and realized the first token is SPACE + DOUBLE-QUESTIONMARK + SPACE )

@SlyEcho

SlyEcho commented Jul 3, 2023

Copy link
Copy Markdown
Contributor Author

Well maybe it should not return anything in some cases. Relying on magic constants is not good.

@SlyEcho
SlyEcho merged commit 1cf14cc into master Jul 3, 2023
@SlyEcho
SlyEcho deleted the fix-server-crashes branch July 3, 2023 21:05
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
phuongncn pushed a commit to phuongncn/llama.cpp-gx10-dgx-sparks-deepseekv4 that referenced this pull request Apr 28, 2026
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
bong-water-water-bong pushed a commit to bong-water-water-bong/llama.cpp that referenced this pull request Sep 4, 2026
…ooling

- ggml-cpu.c MUL_MAT_ID_Q4NX: compute all batch dims (n_tok=ne11*ne12*ne13),
  read expert ids with per-dim strides (nb[0]/nb[1]), flatten (i11,i12,i13)
  src1 column mapping — mirrors ggml_mul_mat_id (ggml-org#2076)
- debug probes (env-gated) for ggml-org#2089/ggml-org#2075 bisection: KV_CLEAR_DBG,
  GGML_DUMP_RSZ (rs_z/src/refcounts), GGML_DUMP_CPYV, GGML_DUMP_IDXS,
  Q4NX_ID_DBG, GGML_DUMP_MUL_CHK, SETROWS_DBG, run-id'd node dumps
- minimal_decode.cpp: minimal llama_decode() driver to isolate cca_state
  carry-over (bypasses CLI warmup/diagnostic)
bong-water-water-bong pushed a commit to bong-water-water-bong/llama.cpp that referenced this pull request Sep 4, 2026
The dense Q4NX matmul wrote each output element at dst_col[o * (nb1/4)]
(= stride 1024) instead of dst_col[o] (stride 1), so every output row
landed at the wrong offset and only element 0 was correct. The MoE
(MUL_MAT_ID_Q4NX) already used nb0 correctly.

Verified: zaya-q4nx-c43.gguf now decodes "The capital of France is Paris."
(oracle token 9079), deterministic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants