Skip to content

Conversation

@chraac
Copy link
Contributor

@chraac chraac commented Nov 12, 2025

Description

This PR introduces a new hex_supported_buffer function to improve buffer support checking in the ggml-hexagon backend.

Changes

  • Refactored buffer support checking: Added a dedicated hex_supported_buffer() function to centralize and improve the logic for determining whether a buffer is supported by the Hexagon backend

Benefits

  • Better maintainability: Centralized buffer support logic makes the codebase easier to maintain and update
  • Improved clarity: The new function provides a clearer and more explicit way to check buffer compatibility
  • Reduced duplication: Eliminates redundant buffer checking code throughout the Hexagon backend

@chraac chraac marked this pull request as draft November 12, 2025 15:38
@github-actions github-actions bot added the ggml changes relating to the ggml tensor library for machine learning label Nov 12, 2025
@chraac chraac changed the title [WIP] ggml-hexagon: add hex_supported_buffer for better buffer supported check ggml-hexagon: add hex_supported_buffer for better buffer supported check Nov 13, 2025
@chraac chraac force-pushed the dev-small-refactoring branch from a9d132d to d1bfadd Compare November 20, 2025 02:19
@max-krasnyansky
Copy link
Collaborator

Very nice!
It was long on my TODO list to rework that part to remove the duplication.
I started with offloading MatMul only and then we added a bunch of Ops but didn't get around to refactoring things.

btw For the supported buffer I was just going to move it into the device_supprots_op() just like other backends do (CUDA, etc) where they just iterate over all valid buffs and check if they are compatible.
This way we won't even need to check buffers in each Op. But there some extra checks needed for repacked buffers.
So might need to keep some in the Ops too. Taking another look ...

@max-krasnyansky max-krasnyansky marked this pull request as ready for review November 23, 2025 22:23
@max-krasnyansky max-krasnyansky merged commit d5bc1ad into ggml-org:master Nov 23, 2025
72 of 74 checks passed
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