Skip to content

ggml : fix ggml_clamp - #27644

Merged
ggerganov merged 2 commits into
masterfrom
gg/ggml-fix-clamp
Aug 24, 2026
Merged

ggml : fix ggml_clamp#27644
ggerganov merged 2 commits into
masterfrom
gg/ggml-fix-clamp

Conversation

@ggerganov

Copy link
Copy Markdown
Member

Overview

cont ggml-org/ggml#145

Fix failing test https://github.com/ggml-org/llama.cpp/actions/runs/32657742369/job/97239065076#step:5:12415. The problem is that the first op in the graph split (GGML_OP_CLAMP) ends up being inplace (due to legacy) on the CI Apple runners (due to limited op support):

node #269 (  SOFTPLUS):             node_269 (   1K) [ MTL0         ] use=1,c=1: MTL0#ffn_moe_logits- (   1K) [ NULL         ]
node #270 (      SQRT):      ffn_moe_probs-0 (   1K) [ MTL0         ] use=2,c=1:             node_269 (   1K) [ MTL0         ]
node #272 (       ADD): ffn_moe_probs_biased (   1K) [ MTL0         ] use=1,c=1:      ffn_moe_probs-0 (   1K) [ MTL0         ] blk.0.exp_probs_b.bi (   0K) [ MTL0         ]
node #273 (   ARGSORT):    ffn_moe_argsort-0 (   1K) [ MTL0         ] use=1,c=1: ffn_moe_probs_biased (   1K) [ MTL0         ]
node #275 (  GET_ROWS):    ffn_moe_weights-0 (   0K) [ MTL0         ] use=1,c=1: ffn_moe_probs-0 (res (   1K) [ MTL0         ]       ffn_moe_topk-0 (   0K) [ MTL0         ]

## SPLIT #33: CPU # 1 inputs: [ffn_moe_weights-0 (reshaped) (   0K)] 
node #277 (  SUM_ROWS): ffn_moe_weights_sum- (   0K) [  CPU         ] use=1,c=1: CPU#ffn_moe_weights- (   0K) [ NULL         ]

## SPLIT #34: MTL0 # 1 inputs: [ffn_moe_weights_sum-0 (   0K)] 
node #278 (     CLAMP): ffn_moe_weights_sum_ (   0K) [ MTL0         ] use=1,c=1: MTL0#ffn_moe_weights (   0K) [ NULL         ]
node #279 (       DIV): ffn_moe_weights_norm (   0K) [ MTL0         ] use=1,c=1: ffn_moe_weights-0 (r (   0K) [ MTL0         ] ffn_moe_weights_sum_ (   0K) [ MTL0         ]
node #281 (     SCALE): ffn_moe_weights_scal (   0K) [ MTL0         ] use=1,c=1: ffn_moe_weights_norm (   0K) [ MTL0         ]

Requirements

@github-actions github-actions Bot added the ggml changes relating to the ggml tensor library for machine learning label Aug 24, 2026
@CISC

CISC commented Aug 24, 2026

Copy link
Copy Markdown
Member

Should it not be added to this too?

// ops that return true for this function must not use restrict pointers for their backend implementations
bool ggml_op_can_inplace(enum ggml_op op) {
switch (op) {

@ggerganov
ggerganov requested a review from CISC August 24, 2026 07:32
@ggerganov
ggerganov merged commit 6036c63 into master Aug 24, 2026
22 of 26 checks passed
@ggerganov
ggerganov deleted the gg/ggml-fix-clamp branch August 24, 2026 07:43
therealkenc pushed a commit to therealkenc/llama.cpp that referenced this pull request Aug 24, 2026
* ggml : fix ggml_clamp

* cont : update ggml-alloc
ravel7524 pushed a commit to ravel7524/llama.cpp that referenced this pull request Aug 30, 2026
* ggml : fix ggml_clamp

* cont : update ggml-alloc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants