Skip to content

Added enum to llama_token_get_type return type for C compliance - #2774

Merged
slaren merged 1 commit into
ggml-org:masterfrom
MarcusDunn:llama-cpp-h-C-enum-return-type
Aug 24, 2023
Merged

slaren merged 1 commit into
ggml-org:masterfrom
MarcusDunn:llama-cpp-h-C-enum-return-type

Conversation

@MarcusDunn

Copy link
Copy Markdown
Contributor

Not sure if a typedef would be preferred. I went off current enum usage around log levels.

The declaration without the enum caused an error for me when trying to create rust bindings.

I am neither a C or C++ dev, I am unsure of the consequences (if any) of this on the cpp side of things.

@slaren
slaren merged commit 2e5f70a into ggml-org:master Aug 24, 2023
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 added a commit to 1bit-MONSTER/llama.cpp that referenced this pull request Nov 21, 2026
…me (engine#3120) (#465)

Fourteen rows aborted on a kernel name before their CPU reference ran: they name the
Loom kernel they were written around, and the shipped (add-on) build schedules the
add-on's. Every one of them resolves to a named registration at add-on bc3051d:

  kquant_tokens_q8     hip:k_61d118a92b4c = HRX_ID_kqt_swiglu_q4k_q4k
  dense_decode_kquant  hip:k_3eef74efaf0a = HRX_ID_dense_q4k_swiglu_q8_decode
  hrx_dense_prefill    hip:k_a074247a0b6a = HRX_ID_hrx_dp_f32_to_f16,
                       hip:k_f7cc5eb2ed87 = HRX_ID_hrx_dp_mm_iq4_xs_m64_w4_f2
  gemv_wide_decode     hip:k_d3eccfeebe3f = HRX_ID_gemv_wide_q4k_r2w8u2
  fa_prompt_f16        hip:k_c8f927eca76a = HRX_ID_fa_prompt_f16_d128

require_kernel_subsequence_route() takes an optional add-on route; when one is passed
the row accepts any `hip:` object (the ids are content hashes, so pinning one rots --
engine#456/ggml-org#2774's rule) and then compares the value, which a wrong kernel still fails.
The route is passed where each row is BUILT and never derived from the expected kernel
name: these names are shared -- ggml_flash_attention_f32_f16_wmma is expected by seven
rows here, and ..._swiglu_q4_q8_1_x4_lowtoken_dot by rows the add-on and the Loom kquant
family serve differently -- so a name-level arm would accept a mix-up in rows that pass
today for the right reason.

One shape is not an add-on case: q4_k/q4_k swiglu at 1 token is served by the Loom
kquant swiglu family (engine#444), which test-hrx-ops.cpp accepts and this file never
did; it gets its own `loom_route` argument rather than being folded into the add-on arm.

Compile-verified with the flag set of the last hrx-ops-test build (-fsyntax-only, no
link, no device): clean apart from the pre-existing -Wswitch at glu_op_name:9052.

Co-authored-by: bong-water-water-bong <[email protected]>
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