Merge tag 'b9888' of https://github.com/ggml-org/llama.cpp into feature/turboquant-kv-cache#208
Open
sxlmnwb wants to merge 258 commits into
Conversation
* ui: add svg block visualizer based on allozaur's mermaid PR * ui: rationalise diagram block styling and pre transforms shared by mermaid and svg * ui: live render streaming svg blocks * ui: also render svg authored in xml code fences * ui: refactor svg block rendering, address review from allozaur - Move the svg size ceiling and DOMPurify config out of sanitize-svg.ts into /constants. - Rename the svg-diagram class to svg-block so the name no longer implies diagrams only. - Replace the svg, xml and svg tag magic strings in the markdown pipeline with shared constants. - Promote the data-svg-rendered marker and its sibling data attributes to constants. * ui: render svg blocks in a shadow root for animation and live zoom Mount each sanitized svg inside an open shadow root so author <style> and keyframe or smil animations run while staying scoped to the host element. Relax the sanitizer to forbid only foreignObject and script, which lets animation, href and external resource refs through for wider compatibility. Render the inline block and the zoom dialog from the same reactive source, so a streaming svg keeps drawing live inside the open zoom popup.
* chat: fix whitespace problems once and for all * Purge trailing spaces from grammar generation * Revert "Purge trailing spaces from grammar generation" This reverts commit b0827ec.
* [SYCL] Centralize Level Zero detection in ggml_sycl_init * use the same wording * get back the warning * [SYCL] Remove per-allocation getenv() for GGML_SYCL_ENABLE_LEVEL_ZERO * bring back the comment * move it up to make sure devices call the shots * move the env detection early * replace g_ggml_sycl_enable_level_zero with a direct call to .ext_oneapi_level_zero * update the comment * switch back to g_ggml_sycl_enable_level_zero with a sentinel * remove the check * Reduce the diff * reword, move lower * move things aroudn * remove forward declaration if favor of a full replace * pre-cache results of zeDeviceGetProperties * put ggml_sycl_get_env back * replace get_sycl_env with ggml_sycl_get_env * add whitespace back * Apply suggestion from @sanmai
…gml-org#24584) * add to support pool_1d, move pool_1d/2d code to pool.cpp/hpp * update ops.md
Assisted-by: pi:llama.cpp/Qwen3.6-27B
…uring last changes (ggml-org#24653) * chat: fix an "oldie but goodie" grammar generator bug that surfaced during last changes * update erroneous case in PEG parser test
* chat: harden peg-native tool call parsing accept an optional leading type: function field in build_json_tools_flat_keys so openai style tool calls parse on templates whose serialization opens on the name field. return a clean error and log the unparsed fragment on a final peg parse failure instead of throwing the raw parser position and input. keep the raw arguments string in func_args_not_string when it is not valid json instead of aborting the prompt render. * chat: surface peg-native parse failures a final peg parse failure threw the raw parser position and input. log the unparsed fragment and raise a clearer error instead, so a model output that does not match the expected format no longer fails silently with an empty assistant turn. minimal change, no behavior change on successful parses. * chat: handle openai style tool calls in peg-native * nits * common: scope OpenAI wrapper grammar trigger via autoparser flag * chat: gate type:function parsing leniency on the analysis flag Thread accept_openai_wrapper from the generator to build_json_tools_flat_keys so the leading "type": "function" field is accepted only when openai_wrapper_trigger is set.
…org#22219) * docs: Add instructions to install `llama.cpp` from conda-forge Signed-off-by: Julien Jerphanion <git@jjerphan.xyz> * Rewording of instructions Co-authored-by: Georgi Gerganov <ggerganov@gmail.com> --------- Signed-off-by: Julien Jerphanion <git@jjerphan.xyz> Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
message on parse error
* Add escape test cases * chat : fix LFM2 tool-call parsing double-escaping
* vulkan: add GGML_OP_COL2IM_1D, follow-up to the CPU op * vulkan: col2im_1d bounded gather loop instead of full-K scan with modulo * vulkan: col2im_1d address review from @jeffbolznv * vulkan: col2im_1d return nullptr for unsupported types, address review from @0cc4m
* Add -cl-fp32-correctly-rounded-divide-sqrt to F16=ON builds Signed-off-by: Todd Malsbary <todd.malsbary@intel.com> * Make GGML_SYCL_F16=ON the default Signed-off-by: Todd Malsbary <todd.malsbary@intel.com> * Leave F32 the default F16 remains explictly set for example and Dockerfile builds. Signed-off-by: Todd Malsbary <todd.malsbary@intel.com> * Revert changes to examples/sycl/build scripts Signed-off-by: Todd Malsbary <todd.malsbary@intel.com> --------- Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
…gml-org#24363) * support OP EXPM1, support all UT cases of FLOOR, TRUNC, ROUND * fix conflict * rebase, support new UT case of repeat, concat
* sycl: support reordered Q4_K and Q5_K MoE MUL_MAT_ID Extend reordered-weight handling to fused MoE MUL_MAT_ID for Q4_K and Q5_K expert tensors and add Q5_K reordered DMMV coverage. Unsupported 3D reorder cases now fall back instead of aborting. * sycl: extend MoE reorder to Q6_K mul_mat_id
* bench : add --offline Signed-off-by: Adrien Gallouët <angt@huggingface.co> * Add default Signed-off-by: Adrien Gallouët <angt@huggingface.co> --------- Signed-off-by: Adrien Gallouët <angt@huggingface.co>
… position (ggml-org#24536) * spec: add spec metrics mean acceptance length and acceptance per pos * fix as suggestion Co-authored-by: Georgi Gerganov <ggerganov@gmail.com> * fix as suggestion Co-authored-by: Georgi Gerganov <ggerganov@gmail.com> * fix as suggestion Co-authored-by: Georgi Gerganov <ggerganov@gmail.com> * fix as suggestions --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
…2930) * implement UMA host-visible memory * update based on 0cc4m's suggestion
* Move post-GEMM MUL required for dequant b4 lora and bias add see ggml-org#23484 : 1. For lora, I would presume we want fully dequantized values before doing the residuals, but this depends on how the LORAs were generated. Literature tells me LORA happens post-mul but pre-bias add ggml-org#8332 2. For ModelOPT, bias-add should happen on [fully-dequantized values](https://github.com/NVIDIA/Model-Optimizer/blob/b49f9b9e2d747af992d78a3aa7f10efe5a8847e1/modelopt/torch/quantization/backends/nvfp4_gemm.py#L59-L64) * Restrict build_ffn for NVFP4 to supported combinations
* ui: add source toggle to mermaid and svg blocks Add a toggle button next to copy and preview that switches a rendered mermaid or svg block to its source code and back. The button is shared by both block types and the rendered view stays the default. The source view reuses the code block scroll container and the highlighted code element captured at transform time, so it matches the app code blocks without highlighting again. Make tall diagrams scroll like text code blocks: safe centering keeps the diagram centered when it fits and falls back to start alignment when it overflows, so the top stays reachable instead of clipping above. Keep the block header opaque and layered above the scrolled diagram, and ignore header clicks in the zoom handler, so a button click never falls through to the zoom dialog. * ui: transparent diagram block header, address review from @allozaur
Signed-off-by: Adrien Gallouët <angt@huggingface.co>
The matmul_tiled path uses large local stack buffers for A_pack and B_pack. On AIX this can trigger a segmentation fault, so reduce the buffer footprint there to keep the tiled path usable.
Performance Impact:
~ 2x gains in PP_Speed for FP32, Q4_0 and Q8_0 models tested with llama-bench, llama-batched-bench and llama-cli.
Models used: Llama3.2 3b Instruct F32, qwen 2.5 3b Q4_0 and Q8_0
…rg#24403) * CUDA: extend K-type validation to V-types for flash attention * reorder
…re/turboquant-kv-cache
Fix Conflicts:
ggml/src/ggml-cuda/fattn.cu
ggml/src/ggml-metal/ggml-metal.metal
src/llama-kv-cache.cpp
src/llama-model-loader.cpp
tests/test-backend-ops.cpp
tests/test-quantize-fns.cpp
tools/server/server-context.cpp
tools/server/server-models.cpp
tools/server/server-models.h
tools/server/server.cpp
Signed-off-by: Salman Wahib <sxlmnwb.dev@gmail.com>
Adds target_compile_options for ggml-cuda to suppress verbose warnings from GGML_ABORT macros and template expansions when using Clang as the CUDA host compiler. - -Wno-missing-noreturn (GGML_ABORT does not return) - -Wno-unreachable-code-break (break after GGML_ABORT) - -Wno-tautological-compare (template type comparisons) - -diag-suppress=177 (NVCC unused variable in templates) Signed-off-by: Salman Wahib <sxlmnwb.dev@gmail.com>
- add banner Signed-off-by: Salman Wahib <sxlmnwb.dev@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary Merge 'b9888' of https://github.com/ggml-org/llama.cpp
Resolved files conflicts:
1. ggml/src/ggml-cuda/fattn.cu
ggml_cuda_fattn_kv_type_supportedfunction2. ggml/src/ggml-metal/ggml-metal.metal
kernel_cpy_tq3_1sandkernel_cpy_tq4_1s(TurboQuant copy kernels)3. src/llama-kv-cache.cpp
4. src/llama-model-loader.cpp
llama_ftype_namestructure from upstream withguessed_prefix_len5. tests/test-backend-ops.cpp
6. tests/test-quantize-fns.cpp
MAX_DOT_PRODUCT_ERROR_LOWBIT7. tools/server/server-context.cpp (5 conflicts)
task.id_slotinstead ofid_slotcache_keyslot selection from the forkbatch.size()instead ofbatch.n_tokensfor consistency with upstreamprompt_checkpoint_restoredflagis_last_user_messagecontinue/breakwithreturnin theiteratelambdallama_get_ctx_other,process_chunk)8. tools/server/server-models.cpp (6 conflicts)
CMD_CHILD_TO_ROUTER_STATE)CMD_CHILD_TO_ROUTER_ERRORhandler for the abort callbackupdate_status_argsstruct for theupdate_statussignatureshould_wakelambda with an inline lambdachild_proc->is_alive()andchild_proc->terminate()methods instead of direct C functionsupdate_last_errorandupdate_download_progress9. tools/server/server-models.h
CMD_CHILD_TO_ROUTER_STATEdefine10. tools/server/server.cpp
common_models_handlerinitialization from upstreampath.empty() && hf_repo.empty())Additional information
Build environment:
Build log:
PANd6hWU
Tested on:
CPU: AMD Ryzen AI 9 HX 370 (8+16) @ 5.16 GHz
GPU 2: NVIDIA GeForce RTX 4060 Max-Q / Mobile [Discrete]
MoE model:
Qwen3.6-35B-A3B-Uncensored-HauhauCS-Aggressive - Q4_K_P
Requirements