Skip to content

Fix incorrect assertion#22167

Open
fiesh wants to merge 1 commit intoggml-org:masterfrom
fiesh:fix-assertion-failure
Open

Fix incorrect assertion#22167
fiesh wants to merge 1 commit intoggml-org:masterfrom
fiesh:fix-assertion-failure

Conversation

@fiesh
Copy link
Copy Markdown

@fiesh fiesh commented Apr 20, 2026

The assertion check was too strong.

This closes #19839.

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: Yes, to reason about the code paths leading to the assertion failure.

@fiesh fiesh marked this pull request as draft April 20, 2026 13:04
@fiesh fiesh force-pushed the fix-assertion-failure branch from c41ea07 to 2237b3d Compare April 20, 2026 13:38
@fiesh fiesh marked this pull request as ready for review April 20, 2026 14:02
@fiesh
Copy link
Copy Markdown
Author

fiesh commented Apr 20, 2026

This works, but I'm not certain if it's that great. It might also make sense to reduce code duplication by not repeating the assertion every time. But since that's the way it was originally, I wanted to keep the change minimal.

I'd be grateful for somebody with better understanding of the code if the new assertion is correct or just hides a deeper issue. It does seem stable though.

Having `tensor->data == NULL` and `tensor->view_src->data != NULL` is
also a valid state that happens when `--parallel` is > 1.

This closes ggml-org#19839.
@fiesh fiesh force-pushed the fix-assertion-failure branch from 2237b3d to 46031da Compare April 20, 2026 14:06
@fiesh
Copy link
Copy Markdown
Author

fiesh commented Apr 20, 2026

(A minor thing -- I'd also greatly prefer not to use NULL but nullptr instead. Wasn't sure if this was a wanted change or not. If it is, I'd gladly switch it out in this PR as well.)

@github-actions github-actions bot added the ggml changes relating to the ggml tensor library for machine learning label Apr 20, 2026
@am17an
Copy link
Copy Markdown
Contributor

am17an commented Apr 20, 2026

Feels like a backend bug, why would tensor->data not be set?

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.

Eval bug: ASSERT failed

2 participants