Skip to content

Hexagon: consistent _f16/_f32 naming#28

Closed
google-labs-jules[bot] wants to merge 14 commits intomasterfrom
hexagon-f16-f32-rename-730959513905403024
Closed

Hexagon: consistent _f16/_f32 naming#28
google-labs-jules[bot] wants to merge 14 commits intomasterfrom
hexagon-f16-f32-rename-730959513905403024

Conversation

@google-labs-jules
Copy link
Contributor

Renamed functions in ggml/src/ggml-hexagon/htp/hvx-*.h and updated usages in ggml/src/ggml-hexagon/htp/*.c to replace _fp16/_fp32 with _f16/_f32. Verified via grep and partial text analysis. Compilation requires Hexagon SDK and was skipped (expected failure).


PR created automatically by Jules for task 730959513905403024 started by @max-krasnyansky

max-krasnyansky and others added 14 commits January 11, 2026 17:27
Factore out all hvx_copy functions into hvx-copy.h header and reduced code duplication.
Update HTP ops infra to support OP_CPY
hex is basically all scalar/core platform stuff (L2, DMA, basic utils)
hvx is all hvx related utils, helpers, etc
htp is higher level stuff like Ops, etc

hvx-utils library got a nice round of cleanup and refactoring to reduce duplication

use hvx_vec_store_a where possible
Moved sigmoid and tanh vector functions from hvx-utils.h to a new header
hvx-sigmoid.h. Implemented aligned and unaligned variants for sigmoid
array processing using a macro pattern similar to hvx-copy.h. Updated
act-ops.c to use the new aligned variant hvx_sigmoid_f32_aa. Removed
unused hvx-sigmoid.c.
Moved `hvx_self_max_f32` and `hvx_self_sum_f32` from `hvx-utils.h`/`.c` to `hvx-reduce.h`.
Renamed them to `hvx_reduce_max_f32` and `hvx_reduce_sum_f32`.
Added aligned (`_a`) and unaligned (`_u`) variants and used macros to unify logic.
Updated `softmax-ops.c` to use the new functions.
Moved `hvx_sum_of_squares_f32`, `hvx_min_scalar_f32`, and `hvx_clamp_scalar_f32` from `hvx-utils.c/h` to `hvx-arith.h`. Implemented aligned/unaligned variants (`_aa`, `_au`, etc.) and used macros to reduce code duplication. Updated `hvx_min_scalar_f32` and `hvx_clamp_scalar_f32` to use `dst, src, ..., n` argument order. Updated call sites in `act-ops.c`.

Refactor Hexagon HVX arithmetic functions (min, clamp) to hvx-arith.h

Moved `hvx_min_scalar_f32` and `hvx_clamp_scalar_f32` from `hvx-utils.c/h` to `hvx-arith.h`. Implemented aligned/unaligned variants (`_aa`, `_au`, etc.) and used macros to reduce code duplication. Updated these functions to use `dst, src, ..., n` argument order and updated call sites in `act-ops.c`. `hvx_sum_of_squares_f32` remains in `hvx-utils.c` as requested.
- Modify `hvx_sum_of_squares_f32` in `ggml/src/ggml-hexagon/htp/hvx-reduce.h` to use `dst, src` signature.
- Implement `_a` (aligned) and `_u` (unaligned) variants for `hvx_sum_of_squares_f32`.
- Update `hvx_reduce_loop_body` macro to support both returning and storing results via `finalize_op`.
- Update existing reduction functions in `hvx-reduce.h` to use the updated macro.
- Update `rms_norm_htp_f32` in `ggml/src/ggml-hexagon/htp/unary-ops.c` to match the new signature.
Refactor Hexagon backend HVX headers and dependent htp code to consistently use `_f16` and `_f32` suffixes instead of `_fp16` and `_fp32` for function names and related variables. This unifies the naming convention across the backend.

- Rename `hvx_vec_*_fp32` to `hvx_vec_*_f32` (e.g., `splat`, `exp`, `tanh`).
- Rename `hvx_vec_*_fp16` to `hvx_vec_*_f16`.
- Rename copy and loop helpers (e.g., `hvx_copy_fp32_aa` -> `hvx_copy_f32_aa`).
- Update internal implementation functions in `act-ops.c`, `matmul-ops.c`, etc.
- Update usages in `.c` files to match new header definitions.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant