Skip to content

FIX: "inline" -> "static inline" for bytesFromNibbles and packNibbles - #161

Merged
ggerganov merged 1 commit into
ggml-org:masterfrom
hoangmit:patch-1
Mar 15, 2023
Merged

ggerganov merged 1 commit into
ggml-org:masterfrom
hoangmit:patch-1

Conversation

@hoangmit

@hoangmit hoangmit commented Mar 15, 2023 •

Copy link
Copy Markdown
Contributor

Without the "static" quantifier, it fails to compile in clang:

ld.lld: error: undefined symbol: packNibbles
>>> referenced by ggml.c:520 (llama_cpp/ggml.c:520)
>>>               .../llama_cpp/__ggml__/__objects__/ggml.c.pic.o:(quantize_row_q4_0)

ld.lld: error: undefined symbol: bytesFromNibbles
>>> referenced by ggml.c:1434 (llama_cpp/ggml.c:1434)
>>>               .../llama_cpp/__ggml__/__objects__/ggml.c.pic.o:(ggml_vec_dot_q4_0)
>>> referenced by ggml.c:1435 (llama_cpp/ggml.c:1435)
>>>               .../llama_cpp/__ggml__/__objects__/ggml.c.pic.o:(ggml_vec_dot_q4_0)
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)

Without "static" prefix, it fails to compile in clang
@hoangmit hoangmit changed the title inline -> static inline for "bytesFromNibbles" "inline" -> "static inline" for "bytesFromNibbles" Mar 15, 2023
@hoangmit hoangmit changed the title "inline" -> "static inline" for "bytesFromNibbles" "inline" -> "static inline" for bytesFromNibbles and packNibbles Mar 15, 2023
@hoangmit hoangmit changed the title "inline" -> "static inline" for bytesFromNibbles and packNibbles FIX: "inline" -> "static inline" for bytesFromNibbles and packNibbles Mar 15, 2023
@ggerganov
ggerganov merged commit 113e685 into ggml-org:master Mar 15, 2023
@setzer22 setzer22 mentioned this pull request Mar 15, 2023
2 of 6 tasks
blackhole89 pushed a commit that referenced this pull request Mar 15, 2023
Without "static" prefix, it fails to compile in clang
Deadsg pushed a commit to Deadsg/llama.cpp that referenced this pull request Dec 19, 2023
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
Without "static" prefix, it fails to compile in clang
phuongncn pushed a commit to phuongncn/llama.cpp-gx10-dgx-sparks-deepseekv4 that referenced this pull request Apr 28, 2026
Closes ggml-org#160 

* MSVC fixes

* One more

---------

Co-authored-by: Iwan Kawrakow <[email protected]>
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
Without "static" prefix, it fails to compile in clang
drizzt pushed a commit to drizzt/llama.cpp that referenced this pull request Jun 15, 2026
Add support for the "minicpm5" BPE pre-tokenizer used by
openbmb/MiniCPM5-1B (and its GGUF quants), porting the
implementation from upstream llama.cpp (release b9354).

Without this, loading a MiniCPM5 GGUF fails with:
  error loading model vocabulary: unknown pre-tokenizer type: 'minicpm5'

Changes, consistent with other BPE pre-tokenizers:
- llama-vocab.h: add LLAMA_VOCAB_PRE_TYPE_MINICPM5 enum value
- llama-vocab.cpp: map tokenizer_pre == "minicpm5" (ignore_merges = true)
- llama-vocab.cpp: add the regex_exprs case (regex from the
  MiniCPM5 tokenizer.json)

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
ddvnguyen referenced this pull request in ddvnguyen/llama.cpp Jun 17, 2026
- New tools/llama-engine/ target: thin exe linking server-context + llama-common + llama
- include/llama-hydra.h + src/llama-hydra.cpp: Hydra-specific APIs isolated from upstream
  - llama_state_seq_get_data_to_fd: zero-copy KV state streaming to socket
  - llama_hydra_peer_reachable: TCP connect test for graceful degradation
- Rename --rpc to --rpc-engine (keep --rpc as hidden alias for one release)
- Graceful degradation: engine starts in SOLO mode if peer unreachable
- Build verified (CPU-only, no warnings)

Part of #161 (Epic: phase-optimized inference engine)

Co-Authored-By: opencode <[email protected]>
ddvnguyen referenced this pull request in ddvnguyen/llama.cpp Jun 17, 2026
- Add engine control opcodes (0x40-0x45): CONFIGURE, INFO, PREFILL, DECODE, SET_EXPERT_MODE, SWAP_QUANT
- Add task types and result type for engine control
- Implement RPC handlers with task queue dispatch
- Stub PREFILL/DECODE (actual inference logic deferred to full implementation)
- Build verified (CPU-only, no warnings)

Part of #161 (Epic: phase-optimized inference engine)

Co-Authored-By: opencode <[email protected]>
Soket1 pushed a commit to Soket1/llama.cpp-xdna that referenced this pull request Aug 1, 2026
…-org#161)

Add K and V GEMV phases to f3best xclbin. K/V weights packed into
weight BO alongside Q/O/gate/up/down. K-RoPE on-chip. K/V output
written to c_bo (arg3), host reads back and packs into kv_bo.

Gated behind XDNA_F3BEST_NPU_KV=1 env flag. When active, skips
CPU KV-delegate prefix (~1.5ms/token savings).

Weight stream: [Q:64|K:16|V:16|O:64|gate:256|up:256|down:256]=928
Cache key: _kv suffix added.

Co-Authored-By: Claude Fable 5 <[email protected]>
Soket1 pushed a commit to Soket1/llama.cpp-xdna that referenced this pull request Aug 1, 2026
…ml-org#161)

KV head has 128 output rows (H8/NH=1024/8), not 64 (head_dim).
Each K/V projection: 128/M=32 tiles, not 16.
Total weight stream: 64+2*32+64+256+256+256 = 960 tiles.
Loop bound %cKV = KV_T (32), not KV_T*2 (64).
Soket1 pushed a commit to Soket1/llama.cpp-xdna that referenced this pull request Aug 1, 2026
ckti pushed a commit to ckti/llama.cpp-consolidated that referenced this pull request Sep 13, 2026
… (+4-36% decode) (ggml-org#161)

* metal: run the 2048-wide FWHT on the threadgroup kernel, not one simdgroup

At decode a folded model applies the Hadamard transform to a 2048-wide
activation row once per folded weight per token. The register kernel handles
that row with a single simdgroup: 32 threads, 64 registers each, 11 serial
butterfly stages, and the rest of the GPU waits on it. The threadgroup variant
already exists for 4096 and 8192; extend it to 2048 by instantiating
kernel_fwht_tg for that width and lowering the dispatch threshold to match.

Stubbing the butterflies to a copy bounded the transform at about 26 percent
of decode on a folded small model. This change recovers essentially all of it.

Measured on an M5 Pro, llama-bench r=3, two interleaved passes, a folded
small dense model: decode 147.4 -> 200.6 tok/s (+36%), prefill 4610 -> 4745
(+2.9%). Greedy output is coherent and identical in shape to the previous
kernel.

* metal: run every folded Hadamard width on the threadgroup FWHT kernel

The previous change moved widths of 2048 and above onto the threadgroup
kernel, but folded models in this family use 512, 1024, 2048 and 4096, so two
of the four were left on the register kernel and still ran a whole row on a
single simdgroup at decode. Instantiate the threadgroup variant for 512 and
1024 as well and lower the dispatch threshold to 512. Widths below that keep
the register kernel: at 256 threads they would have no elements per thread.

The transform is independent of the weight format, so this applies to every
low-bit band a folded model ships.

Measured on an M5 Pro, llama-bench r=2..3, two interleaved passes:
  block 512:  decode 105.6 -> 109.4 tok/s (+3.6%), prefill 1960 -> 2004 (+2.2%)
  block 1024: decode  24.2 ->  26.2 tok/s (+8.2%), prefill  341 ->  357 (+4.8%)
The gain tracks how many serial butterfly stages a row costs, so it grows with
width: an earlier measurement at 2048 was +36% decode.

test-backend-ops -o MUL_MAT_HADAMARD: 24 cases, 24 OK, 0 FAIL, exit 0,
covering blocks 512, 1024 and 2048.
wangqi pushed a commit to wangqi/llama.cpp that referenced this pull request Sep 18, 2026
… (+4-36% decode) (ggml-org#161)

* metal: run the 2048-wide FWHT on the threadgroup kernel, not one simdgroup

At decode a folded model applies the Hadamard transform to a 2048-wide
activation row once per folded weight per token. The register kernel handles
that row with a single simdgroup: 32 threads, 64 registers each, 11 serial
butterfly stages, and the rest of the GPU waits on it. The threadgroup variant
already exists for 4096 and 8192; extend it to 2048 by instantiating
kernel_fwht_tg for that width and lowering the dispatch threshold to match.

Stubbing the butterflies to a copy bounded the transform at about 26 percent
of decode on a folded small model. This change recovers essentially all of it.

Measured on an M5 Pro, llama-bench r=3, two interleaved passes, a folded
small dense model: decode 147.4 -> 200.6 tok/s (+36%), prefill 4610 -> 4745
(+2.9%). Greedy output is coherent and identical in shape to the previous
kernel.

* metal: run every folded Hadamard width on the threadgroup FWHT kernel

The previous change moved widths of 2048 and above onto the threadgroup
kernel, but folded models in this family use 512, 1024, 2048 and 4096, so two
of the four were left on the register kernel and still ran a whole row on a
single simdgroup at decode. Instantiate the threadgroup variant for 512 and
1024 as well and lower the dispatch threshold to 512. Widths below that keep
the register kernel: at 256 threads they would have no elements per thread.

The transform is independent of the weight format, so this applies to every
low-bit band a folded model ships.

Measured on an M5 Pro, llama-bench r=2..3, two interleaved passes:
  block 512:  decode 105.6 -> 109.4 tok/s (+3.6%), prefill 1960 -> 2004 (+2.2%)
  block 1024: decode  24.2 ->  26.2 tok/s (+8.2%), prefill  341 ->  357 (+4.8%)
The gain tracks how many serial butterfly stages a row costs, so it grows with
width: an earlier measurement at 2048 was +36% decode.

test-backend-ops -o MUL_MAT_HADAMARD: 24 cases, 24 OK, 0 FAIL, exit 0,
covering blocks 512, 1024 and 2048.

(cherry picked from commit 8c0170d)
SimonTeixidor pushed a commit to SimonTeixidor/llama.cpp that referenced this pull request Oct 12, 2026
vulkan : GDN conv straight from x and the state, and a short-row RMS norm with two fusions
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