Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sbera77
Copy link
Contributor

@sbera77 sbera77 commented Nov 2, 2025

This PR fixes a segmentation fault that occurs while running the test-backend-ops tool in support mode or with --show-coverage flag. This will also allow docs/ops.md to be updated for tracking #14909 as it needs the results from support mode.

Root Cause

Testing does not initialize gf (ggml_cgraph), it calls build_graph method for each test case. The test_moe_expert_reduce test case calls ggml_build_forward_expand(gf, ...) inside its build_graph method but gf is a nullptr in this flow which causes a seg fault.

Solution

Wrap the ggml_build_forward_expand call in a gf null check.

@sbera77 sbera77 requested a review from slaren as a code owner November 2, 2025 12:45
@github-actions github-actions bot added the testing Everything test related label Nov 2, 2025
@sbera77
Copy link
Contributor Author

sbera77 commented Nov 2, 2025

@am17an Please review

Copy link
Collaborator

@am17an am17an left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

Copy link
Member

@slaren slaren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to filter out fusion cases in the supports test, but also initialize gf in eval_support.

@sbera77 sbera77 marked this pull request as ready for review November 2, 2025 14:31
@sbera77
Copy link
Contributor Author

sbera77 commented Nov 2, 2025

Thanks @slaren, I incorporated your suggestions. Please let me know if this was the intended approach

@sbera77 sbera77 marked this pull request as draft November 2, 2025 15:17
@sbera77 sbera77 marked this pull request as ready for review November 2, 2025 16:03
@sbera77 sbera77 marked this pull request as draft November 2, 2025 16:28
@sbera77 sbera77 marked this pull request as ready for review November 2, 2025 16:56
@sbera77
Copy link
Contributor Author

sbera77 commented Nov 2, 2025

@slaren Thank you for your guidance and feedback. Please have a look

  • Fusion cases are now filtered out from both support mode and --show-coverage. This fixes the seg fault (also makes sense to check only individual ops there)
  • Initialized gf in eval_support (though its only used in fusion cases right now, which we filtered out and so this can be removed ?)

@slaren slaren merged commit a2054e3 into ggml-org:master Nov 2, 2025
68 of 72 checks passed
gabe-l-hart added a commit to gabe-l-hart/llama.cpp that referenced this pull request Nov 3, 2025
* origin/master: (169 commits)
opencl: support imrope (ggml-org#16914)
fix: Viewing multiple PDF attachments (ggml-org#16974)
model-conversion : pass config to from_pretrained (ggml-org#16963)
server : add props.model_alias (ggml-org#16943)
ggml: CUDA: add head size 72 for flash-attn (ggml-org#16962)
mtmd: add --image-min/max-tokens (ggml-org#16921)
mtmd: pad mask for qwen2.5vl (ggml-org#16954)
ggml : LoongArch fixes (ggml-org#16958)
sync: minja (glm 4.6 & minmax m2 templates) (ggml-org#16949)
SYCL: optimized repeat_back kernel (3× fewer asm instructions, 2× faster)Feature/sycl repeat back opt (ggml-org#16869)
feat(webui): improve LaTeX rendering with currency detection (ggml-org#16508)
test-backend-ops : fix segfault in moe-expert-reduce test in support mode and coverage (ggml-org#16936)
ci : disable failing riscv cross build (ggml-org#16952)
model: add Janus Pro for image understanding (ggml-org#16906)
clip : use FA (ggml-org#16837)
server : support unified cache across slots (ggml-org#16736)
common : move gpt-oss reasoning processing to init params (ggml-org#16937)
docs: remove llama_sampler_accept reference in sampling sample usage (ggml-org#16920)
CUDA: add FLOOR, CEIL, ROUND, TRUNC unary ops (ggml-org#16917)
devops: fix failing s390x docker build (ggml-org#16918)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants