UPSTREAM PR #21071: hexagon: optimize HMX matmul operations#1351
Open
UPSTREAM PR #21071: hexagon: optimize HMX matmul operations#1351
Conversation
…ales initialization
# Conflicts: # ggml/src/ggml-hexagon/htp/hmx-matmul-ops.c
# Conflicts: # ggml/src/ggml-hexagon/htp/hmx-matmul-ops.c
|
No meaningful performance changes were detected across 127615 analyzed functions in the following binaries: build.bin.llama-bench, build.bin.libmtmd.so, build.bin.libllama.so, build.bin.llama-tts, build.bin.llama-cvector-generator, build.bin.libggml-cpu.so, build.bin.libggml.so, build.bin.libggml-base.so, build.bin.llama-quantize, build.bin.llama-qwen2vl-cli, build.bin.llama-tokenize, build.bin.llama-gemma3-cli, build.bin.llama-gguf-split, build.bin.llama-llava-cli, build.bin.llama-minicpmv-cli. 💬 Questions? Tag @loci-dev |
7638ab4 to
f1b46d5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Source pull request: ggml-org/llama.cpp#21071
Overview
This pull request refactors several matrix multiplication and data handling routines in
ggml-hexagon/htp/hmx-matmul-ops.cto improve type safety, consistency, and code clarity. The main changes involve standardizing loop counters and size-related variables to usesize_tinstead ofint, updating function signatures accordingly, and simplifying tile indexing logic. Additionally, the initialization of column scales is made more consistent, and some redundant or legacy code paths are removed.Type safety and consistency improvements:
inttosize_tacross multiple functions (e.g.,core_dot_chunk_fp16,core_mma_chunk_fp16,transfer_output_chunk_fp16_to_fp32) and updated related calculations and function signatures for better type safety and to prevent integer overflow issues. [1] [2] [3] [4] [5]const size_tfor sizes and counts, improving code clarity and reducing potential bugs from type mismatches. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]Additional information
Tested with Qwen3.5-2b-q4, works well
Requirements