Repository navigation
Merge upstream master (d854d98ba) into prism - #352
Merged
Merged
Conversation
| fix(fixer) { | ||
| // Add a second newline so the two siblings are separated by a | ||
| // blank line, keeping the trailing indentation. | ||
| return fixer.replaceText(textNode, textNode.value.replace(/\n/, '\n\n')); |
| const int leaf_backend_id = tensor_backend_id(leaf); | ||
| GGML_ASSERT(leaf_backend_id != -1); // all leafs should be assigned by now | ||
|
|
||
| if (tensor_id_copy(leaf_id, leaf_backend_id, 0) == NULL) { |
| } | ||
| ggml_set_input(tensor_copy); | ||
| ggml_set_output(tensor_copy); // prevent ggml-alloc from overwriting the tensor | ||
| tensor_id_copy(leaf_id, leaf_backend_id, c) = tensor_copy; |
| const int split_backend_id = split->backend_id; | ||
| ggml_backend_t split_backend = sched->backends[split_backend_id]; | ||
| ggml_backend_t input_backend = ggml_backend_sched_get_tensor_backend(sched, input); | ||
| struct ggml_tensor * input_cpy = tensor_copy(input, split_backend_id, sched->cur_copy); |
| wdata_src_b + i1n, 0, | ||
| wdata_kernel + i01*ne00*ne03 + i00*ne03, 0, 1); | ||
| } | ||
| dst_data[(i11*stride + i01)*ne0 + i10*stride + i00] += v; |
khosravipasha
approved these changes
Oct 12, 2026
khosravipasha
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. This is not really possible to review so need to see what subset of functionatlies/hardware we want to test before mering.
…rg#30421) Co-authored-by: Hongqiang Wang <wangh@qti.qualcomm.com>
* llama : respect no_alloc in memory caches Assisted-by: dsh:llama.cpp/ggml-org/DeepSeek-V4-Flash-Vision-Exp-GGUF (Mac Studio, M2 Ultra, 192GB) * llama : TODO: move no_alloc out of llama_hparams Assisted-by: dsh:llama.cpp/ggml-org/DeepSeek-V4-Flash-Vision-Exp-GGUF (Mac Studio, M2 Ultra, 192GB) * llama : TODO: move no_alloc out of llama_hparams Assisted-by: dsh:llama.cpp/ggml-org/DeepSeek-V4-Flash-Vision-Exp-GGUF (Mac Studio, M2 Ultra, 192GB)
…based expert detection (ggml-org#30820) * llama-quant : fix quantizing 4D tensors nrows_total was ne[1]*ne[2], so for a 4D tensor only the first ne[2] slices were quantized and the rest of the rows were dropped. Use ggml_nrows(tensor) to count all rows, including ne[3]. Fixes ggml-org#29916 * llama-quant : detect expert tensors by name and fix imatrix size for 4D tensors The MXFP4_MOE path used ne[2] > 1 to detect MoE expert tensors. This is wrong for non-expert tensors with 3 or more dims, e.g. MLA projections (BailingMoE3) and 4D conv kernels. Use the tensor name instead: all tensors used by GGML_OP_MUL_MAT_ID are named *_exps or *_chexps. This also removes the BailingMoE3 special case. The imatrix holds one vector of ne[0] values per 2D slice, so the expected size is ne[0]*ne[2]*ne[3], not ne[0]*ne[2]. This matches how the imatrix is indexed per row for 4D tensors in llama_tensor_quantize_impl. Assisted-by: Claude Opus 5.5
* qwen: merge tensors on convert * convert: use generator functions * qwen4exp: remove conts and pre-scale
…ml-org#31153) * common, grammar: add recursive depth limit, make it a requirement * catch more recursive functions * common : tidy up peg parser changes * grammar : reject candidates in a loop, without a depth limit The depth limit in llama_grammar_reject_candidates_for_stack counted the code points of a vocab token, so any token of 256 chars or more was always rejected under a grammar, such as the 512-space token of GLM-4.7-Flash or the long space tokens of Laguna-S-2.1. The rejection now walks the code points with its own stack of levels instead of recursing: there is no limit and no stack risk, whatever the length of a token from the GGUF, and the masks match master. * grammar : track rejected candidates as indices into the input At a given code point a candidate only differs from its input by the position of its code point pointer, so the levels now carry indices into the input candidates instead of copies. The first level needs no special case and the rejects map back to the input directly. Grammar sampling gets faster than master on GLM-4.7, Laguna, Qwen3.6 and gemma-4 with the json, list and spaces grammars, same masks. * nit : shorten the comment of llama_grammar_reject_step * common : add depth_guard for schema walks * grammar : move GRAMMAR_RECURSIVE_LIMIT into the .cpp * common : reduce recursion limit for peg parser * improve --------- Co-authored-by: Alde Rojas <hello@alde.dev> Co-authored-by: Pascal <admin@serveurperso.com>
* cuda : use std::string instead of VLA for archName
Modernize the code (old C style) and fix the following warnings:
```
ggml/src/ggml-cuda/ggml-cuda.cu:180:19: warning: variable length arrays in C++ are a Clang extension [-Wvla-cxx-extension]
180 | char archName[archLen + 1];
| ^~~~~~~~~~~
ggml/src/ggml-cuda/ggml-cuda.cu:180:19: note: read of non-const variable 'archLen' is not allowed in a constant expression
ggml/src/ggml-cuda/ggml-cuda.cu:179:9: note: declared here
179 | int archLen = strlen(devName);
| ^
```
Signed-off-by: Adrien Gallouët <angt@huggingface.co>
* Add a comment about archName
Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
---------
Signed-off-by: Adrien Gallouët <angt@huggingface.co>
Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
Keep the Prism quantization type IDs and kernels, and adapt the model, batch and graph-cache paths to the upstream APIs. Keep the scalar CUDA RMS reduction by default (GGML_CUDA_RMS_NORM_VECTOR=1 opts into the float4 path), the baseline Qwen3.5 GDN normalization and the short-context GQA decode dispatch, so existing packed models decode exactly as before. Mark observed Hadamard fixture intermediates as outputs.
With one sequence and one state there is no relocation tail, so return the gathered rows directly. The CUDA gather fusions match on that node.
The upstream merge added the clamped SwiGLU GLU op. Pass glu_limit through and apply it in the epilogue instead of falling back to gate*up.
The one-column PTQ1_0 path had no case for the clamped SwiGLU and computed gate*up, so decode disagreed with prefill for models that use it.
This was referenced Oct 29, 2026
Merged
| for (int input_id = 0; input_id < split->n_inputs; input_id++) { | ||
| if (!ggml_backend_sched_is_host_weight(split->inputs[input_id])) { | ||
| ggml_tensor * input = split->inputs[input_id]; | ||
| ggml_tensor * input_cpy = tensor_copy(input, split_backend_id, sched->cur_copy); |
The merge switched the condition to crop_before_nextn() and left the local unused, which fails builds with LLAMA_FATAL_WARNINGS.
Fixes -Werror=reorder in the llm_graph_context constructor after the merge.
Fixes -Werror=unused-variable in the MTP draft paths.
…rk drafter in test-llama-archs common_chat_msg gained extra_json in the merge, so the aggregate initializer hit -Wmissing-field-initializers. DSpark is a drafter that needs a target, like EAGLE3 and DFLASH, which the generated-model test already skips.
The fork drops empty type/oneOf/anyOf unions instead of rejecting them (#333), and the merge kept that behavior. Replace upstream's two rejection asserts with a test of the fork behavior.
…d reduction After the merge, upstream's moe_weighted_reduction matched first and took every pattern, so the fork's exact kernel (#107) never ran and MOE_WEIGHTED_REDUCE, which requires a bit-exact result, failed. Try the exact kernel first; shapes it does not take still use upstream's reduction.
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.
What
PR carried before; its commits are still in the history.
so decode disagreed with prefill for models that use the clamped SwiGLU.
Why
float4 RMS norm, faster low-bit MMVQ, top-k MoE fusions) is the base for the next fork PRs.
How
upstream APIs.
(GGML_CUDA_RMS_NORM_VECTOR=1 opts into the float4 path), and the Qwen3.5 GDN normalization and the short-context
GQA decode dispatch keep their current arithmetic. Switching the RMS default is a separate PR.
Testing
test-backend-ops (CUDA vs CPU) all pass: MUL_MAT 2925, MUL_MAT_ID 1097, MUL_MAT_VEC_FUSION 1618, RMS_NORM, NORM, ADD,
MUL, GET_ROWS, SET_ROWS, SOFT_MAX, ROPE, CPY, SSM_CONV, GATED_DELTA_NET.
Greedy output is byte-identical to current prism on the packed models (27B and 9B PQ2_0, 4B PTQ1_0, 2B Q2_0).
Architectures whose upstream graph changed produce different output, as expected.
H200, current prism vs this branch (alternating runs):
The 9B decode drop (-0.7%) is recovered by two PQ2_0 decode tuning commits that follow in a separate PR (9B reaches
about 430 tok/s and 27B about 181 tok/s with them). The 2B difference is within run-to-run noise on current prism
(its two runs were 743.8 and 736.7).