Skip to content

Optimize Hexagon binary ops with DMA and context struct#31

Open
max-krasnyansky wants to merge 1 commit intomasterfrom
optimize-hexagon-binary-ops-1502924534163750575
Open

Optimize Hexagon binary ops with DMA and context struct#31
max-krasnyansky wants to merge 1 commit intomasterfrom
optimize-hexagon-binary-ops-1502924534163750575

Conversation

@max-krasnyansky
Copy link
Owner

Optimize Hexagon binary ops with DMA and context struct

  • Introduced struct htp_binary_context in binary-ops.c to hold precomputed values and context, reducing reliance on shared htp_ops_context for thread-local data.
  • Refactored binary_job_f32_per_thread to use a double-buffered DMA pipeline for efficient data movement between DDR and VTCM.
  • Implemented aligned HVX operations for binary ops by ensuring VTCM buffers are VLEN-aligned.
  • Added support for broadcasting in DMA logic, including row broadcasting (stride 0) and inner broadcasting (splatting).
  • Updated execute_op_binary_f32 to calculate optimal VTCM usage and initialize the new context.
  • Fixed potential race condition in binary_add_id_job_f32_per_thread by correcting spad offset calculation.

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

- Introduced `struct htp_binary_context` to localize precomputed values.
- Implemented double-buffered DMA pipeline in `binary_job_f32_per_thread`.
- Enabled aligned HVX operations via VTCM alignment.
- Added support for row and inner broadcasting.
- Fixed spad addressing in `binary_add_id_job_f32_per_thread`.

Co-authored-by: max-krasnyansky <1380796+max-krasnyansky@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 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.

@github-actions github-actions bot added the ggml label Feb 5, 2026
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