Skip to content

[RVV]: Add RVV xx-fill kernel - #10915

Open
leduclean wants to merge 1 commit into
google:masterfrom
leduclean:xx-fill-rvv-ukernel
Open

leduclean wants to merge 1 commit into
google:masterfrom
leduclean:xx-fill-rvv-ukernel

Conversation

@leduclean

Copy link
Copy Markdown
Contributor

Summary

  • Add xnn_xx_fill_ukernel__rvv_u4v, an RVV implementation of the xx-fill microkernel (fills a buffer with a repeating 32-bit pattern) using LMUL=4, registered in the xx-fill config/build files.
  • Add bench/xx-fill.cc (modeled on bench/xx-pad.cc) to benchmark it against the scalar_u16 fallback.

LMUL tuning

Tuned empirically on k230 across m8/m4/m2:

  • m4 matches m8's peak throughput on large shapes while fixing m8's only weak spot (small channel counts).
  • m2 trades away large-shape throughput (-21% to -37%) for a bit more on the smallest shape only, a bad trade, not used.

Perf

Measured on k230 (single core, 27 MHz), bytes/s, rvv (m4) vs scalar_u16:

rows channels rvv scalar speedup
1 16 1.00 G/s 806.0 M/s 1.24x
1 64 4.00 G/s 1.22 G/s 3.28x
1 256 8.16 G/s 1.40 G/s 5.84x
1 1024 11.03 G/s 1.45 G/s 7.61x
1 8192 12.20 G/s 1.47 G/s 8.32x
100 256 11.94 G/s 1.45 G/s 8.25x
1024 16 2.47 G/s 1.25 G/s 1.98x

@leduclean
leduclean force-pushed the xx-fill-rvv-ukernel branch 3 times, most recently from b7bfb49 to c681236 Compare August 4, 2026 09:47
@leduclean leduclean changed the title [RVV]: add the xx-fill kernel for rvv [RVV]: Add RVV xx-fill kernel Aug 4, 2026
@leduclean
leduclean force-pushed the xx-fill-rvv-ukernel branch from c681236 to da9feec Compare August 4, 2026 12:36
Comment thread bench/xx-fill.cc Outdated
Comment thread src/xx-fill/xx-fill-rvv-u4v.c Outdated
@leduclean
leduclean force-pushed the xx-fill-rvv-ukernel branch from da9feec to b291b35 Compare August 5, 2026 08:38
@leduclean

Copy link
Copy Markdown
Contributor Author

Thanks for the review!
All comments addressed, PTAL.

@leduclean
leduclean requested a review from qukhan August 5, 2026 09:33
@leduclean

Copy link
Copy Markdown
Contributor Author

Hello @qukhan, same as #10917 this was approved on Aug 17 but hasn't landed yet. I've rebased it on master. Anything else needed on my side?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants