Carry ggml-org#25731 (TML Inkling) merged onto b10665 - #138
Carry ggml-org#25731 (TML Inkling) merged onto b10665#138danielhanchen wants to merge 18 commits into
Conversation
Hybrid attention model: 55 sliding-window plus 11 global layers, banded content-dependent relative position bias instead of RoPE, per-layer short convolution state, fine-grained MoE (256 experts top-6 plus 2 shared), attention log-scaling past 128K, 1M context. Includes the GGML_OP_FLASH_ATTN_EXT_BANDED operator (CPU and CUDA, fused into the MMA flash attention kernel with an fp16 accumulator overflow guard), HF to GGUF conversion, chat template with typed content block parsing (interleaved thinking, narration and tool calls), mmproj vision and audio support, and backend op tests at production shapes.
# Conflicts: # ggml/src/ggml-cuda/mmq.cuh # src/llama-model-saver.cpp # src/llama-vocab.h
Upstream 910196f renamed common_chat_params::thinking_end_tag to thinking_end_tags and changed it from std::string to a vector, so data.thinking_end_tag = END_MESSAGE no longer compiles.
# Conflicts: # src/llama-arch.cpp
# Conflicts: # ggml/include/ggml-rpc.h # ggml/src/ggml-backend-meta.cpp # ggml/src/ggml-cuda/ggml-cuda.cu # src/llama-model-saver.cpp # tests/test-llama-archs.cpp
# Conflicts: # src/llama-model.cpp
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e9d6fb214
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| add_executable(test-flash-attn-bias test-flash-attn-bias.cpp) | ||
| target_link_libraries(test-flash-attn-bias PRIVATE ggml) | ||
| add_test(NAME test-flash-attn-bias COMMAND test-flash-attn-bias) |
There was a problem hiding this comment.
Obtain approval before adding standalone test files
Unless prior maintainer approval exists, adding test-flash-attn-bias.cpp here, along with the adjacent generic-hash test, violates the repository's explicit restriction on new files under tests/* and forces two additional binaries into every LLAMA_BUILD_TESTS build. Reuse the existing backend test infrastructure or obtain maintainer approval before registering these targets.
AGENTS.md reference: AGENTS.md:L87-L87
Useful? React with 👍 / 👎.
| test_cases.emplace_back(new test_flash_attn_ext_banded(128, 8, 1, 512, 8192, 1024, 1, GGML_TYPE_F16, GGML_TYPE_F32)); | ||
| test_cases.emplace_back(new test_flash_attn_ext_banded(128, 8, 1, 512, 16384, 1024, 1, GGML_TYPE_F16, GGML_TYPE_F32)); | ||
| test_cases.emplace_back(new test_flash_attn_ext_banded(128, 8, 1, 512, 16403, 1024, 1, GGML_TYPE_F16, GGML_TYPE_F32)); | ||
| test_cases.emplace_back(new test_flash_attn_ext_banded(128, 8, 1, 512, 16896, 1024, 1, GGML_TYPE_F16, GGML_TYPE_F32)); | ||
| test_cases.emplace_back(new test_flash_attn_ext_banded(128, 8, 1, 512, 17024, 1024, 1, GGML_TYPE_F16, GGML_TYPE_F32)); |
There was a problem hiding this comment.
Move production-scale attention cases out of default CTest
The test-backend-ops CTest registration invokes this executable without filters, and its --help confirms that the default mode compares results with the CPU backend. These repeated 512-query x 8K-17K cases, plus the 32K case below, therefore execute both the tested and reference attention paths in every default run; even the first 8K case did not finish within 15 seconds on the inspected CPU. Move these production-scale stress cases behind an opt-in suite or filter and retain small default correctness cases to avoid adding minutes or timeouts to CI.
AGENTS.md reference: AGENTS.md:L87-L87
Useful? React with 👍 / 👎.
|
Retired by #140. danielhanchen#3 landed this same resolution on add-inkling as edee0e1, so ggml-org#25731 is mergeable again and the pin now points at it directly. The swap is a provable no-op: identical trees (2feb59ed) and an identical final merged tree (eb067b53) for the whole pin chain. Branch inkling-25731-b10665 and its base branch stay in place. |
Replaces #108. The pin has to move because
ggml-org#27742(Qwen3.8-Flash-Next) was squash-merged upstream as6c84c7d5and is in every base tag fromb10660on, which is what broke the nightly in run 33141605830.#108isggml-org#25731merged ontob10630. Against a base that carries the qwen4exp squash it no longer merges: upstream declaresfilter_idx/needs_mem_idximmediately aboveif (arch == LLM_ARCH_FALCON_H1) {insrc/llama-model.cpp, and Inkling edits that sameifline.additive_merge.pyrefuses, correctly, because the merge base is not empty.The old qwen4exp carry
#132used to hide this. Its carry-only commitf52a4c39moved thefilter_idxdeclaration off the Inkling anchor.#132is being dropped in the same change, so the accommodation goes with it and Inkling has to face upstream's arrangement directly.This branch is
ggml-org#25731's head4f2eb74bwithb10665merged into it and the one conflict resolved as the union:needs_mem_idxis true only forLLM_ARCH_QWEN4EXP, so Inkling still lands on the plainllama_memory_hybridbranch andfilter_idxstays null there. Both architectures keep the behaviour their own side intended.Base branch is
inkling-25731-b10665-upstream-base, which is tagb10665(ca3d5a3e) unmodified, so the diff here is only the Inkling work.The three old carry commits are gone, on purpose
#108carried three fixes on top of the upstream PR. All three are now in the upstream branch itself, so this carry is a plain merge with nothing extra:60007bad, theRESIZE_ALGO_BICUBIC_PILLOWtoRESIZE_ALGO_BICUBICconversion after ggml-org#27594 deleted the enum3223f7b2, the out-of-boundsmemcpy(result->op_params + 16, ...)inggml_flash_attn_ext_bandedthat wrote ontoggml_tensor::flags27278df7, thehandle_ssm_convspacing inggml/src/ggml-backend-meta.cppVerified by grep against this tree: no
RESIZE_ALGO_BICUBIC_PILLOW, noop_params + 16write, correct spacing.Verification
Built with
-DGGML_RPC=ON -DLLAMA_BUILD_EXAMPLES=ON -DLLAMA_BUILD_TOOLS=ON -DLLAMA_BUILD_SERVER=ON -DLLAMA_BUILD_TESTS=ON, which the nightly legs do not do (they setLLAMA_BUILD_TESTS=OFF):test-llama-archs -s 1exits 0, zero FAIL rowsqwen4expOK (0.00e+00),deepseek4OK (0.00e+00), so the resolution leaves the qwen4exp path intactinklingSKIP, matching the upstream PR's own skip entryUpstream
The same resolution is open as a PR into
danielhanchen:add-inkling(danielhanchen#3). Once that merges,ggml-org#25731goes back to mergeable and this carry can be dropped in favour of pinning the upstream commit directly.