Skip to content

hexagon: enable support for TOP_K op - #29113

Merged
max-krasnyansky merged 6 commits into
ggml-org:masterfrom
qualcomm:aparmp/hexagon-topk
Sep 19, 2026
Merged

max-krasnyansky merged 6 commits into
ggml-org:masterfrom
qualcomm:aparmp/hexagon-topk

Conversation

@aparmp-quic

Copy link
Copy Markdown
Contributor

Overview

Adds GGML_OP_TOP_K support on the Hexagon backend.

Additional information

The implementation builds on the existing ARGSORT infrastructure and introduces a VTCM-backed bitonic sort path for efficient top-k selection. Large-row workloads are optimized through tiled candidate selection and parallel chunk processing, reducing work when k is small and improving utilization for single-row tensors. Correctness has been validated using test-backend-ops across a range of tensor sizes and k values.

Note: Backend topk sampling is not enabled by this change. The current sampler capability checks expect larger TOP_K tensor support than provided here. A follow-up PR will update sampler configuration and capability probing accordingly.

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES, to implement, debug, and test the implementation. Manual review is fully performed.

@aparmp-quic
aparmp-quic requested a review from a team as a code owner September 19, 2026 02:13
@github-actions github-actions Bot added documentation Improvements or additions to documentation ggml changes relating to the ggml tensor library for machine learning Hexagon labels Sep 19, 2026
@max-krasnyansky

Copy link
Copy Markdown
Member

@lhez for review/ack

@max-krasnyansky
max-krasnyansky merged commit 7d4b92b into ggml-org:master Sep 19, 2026
28 of 33 checks passed
@BrewTestBot BrewTestBot mentioned this pull request Sep 23, 2026
1 task done
LadislavSopko pushed a commit to 0ics-srls/llama.cpp that referenced this pull request Oct 5, 2026
* hexagon: enable support for TOP_K op

* hex-topk: thread single-row TOP_K, raise VTCM-based size cap

* hex-topk: fix TOP_K mdev row partitioning

* hex-topk: optimize TOP_K large-row selection

* hexagon: clean up comment formatting

* hex-docs: update TOP_K support listings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation ggml changes relating to the ggml tensor library for machine learning Hexagon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants