Skip to content

Port 14 HeCBench benchmarks to Kokkos#67

Merged
kento merged 4 commits into
masterfrom
copilot/port-benchmarks-for-kokkos-one-more-time
Apr 12, 2026
Merged

Port 14 HeCBench benchmarks to Kokkos#67
kento merged 4 commits into
masterfrom
copilot/port-benchmarks-for-kokkos-one-more-time

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 12, 2026

HeCBench had ~377 benchmarks without Kokkos implementations. This PR adds 14 new Kokkos ports, each verified against CPU reference outputs.

New Kokkos ports

Benchmark Verification
channelSum PASS (NCHW + NHWC)
resize Correct (nearest-neighbor + bilinear)
ising Correct checksum
pool PASS
rainflow PASS
hypterm RMS Error = 0.0
distort Max error = 0
lrn Correct (fwd + bwd)
murmurhash3 Correct
extend2 Correct
geodesic Max error = 0.0
degrid Correct
haccmk PASS
page-rank Max diff = 0.0

Implementation patterns

All ports follow the same conventions:

  • Kokkos::View<T*> for device storage; create_mirror_view + deep_copy for transfers
  • Kokkos::parallel_for / Kokkos::parallel_reduce with KOKKOS_LAMBDA
  • KOKKOS_INLINE_FUNCTION for device-callable helpers (replacing #pragma omp declare target)
  • Kokkos::fence() after each kernel dispatch
  • System Kokkos 3.7 (OpenMP backend) Makefile pattern consistent with existing ports
Kokkos::parallel_for("kernel_name", N, KOKKOS_LAMBDA(const int i) {
  // device work
});
Kokkos::fence();

Copilot AI and others added 4 commits April 12, 2026 11:16
…benchmarks

- resize-kokkos: nearest-neighbor and bilinear image resize via Kokkos::parallel_for
  with templated CHANNELS_PER_ITER; tests 1/2/4-byte pixel types
- ising-kokkos: Ising model black/white sublattice updates via MDRangePolicy<Rank<2>>;
  init_spins and update_lattice_black/white kernels
- pool-kokkos: 2D average/max pool gradient kernel via Kokkos::parallel_for;
  KOKKOS_INLINE_FUNCTION AvgPoolGrad/MaxPoolGrad; verifies against CPU reference (PASS)
- rainflow-kokkos: rainflow cycle counting with per-thread Execute/Extrema as
  KOKKOS_INLINE_FUNCTION; parallel_for over num_history items; verifies (PASS)
- hypterm-kokkos: 3D hyperbolic term kernels via MDRangePolicy<Rank<3>>; three
  directional sweeps; RMS error 0.0 vs CPU reference
- distort-kokkos: barrel distortion via parallel_for; getRadialX/Y and
  sampleImageTest as KOKKOS_INLINE_FUNCTION; Properties captured by value;
  max channel error 0

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: kento <1034379+kento@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: kento <1034379+kento@users.noreply.github.com>
- lrn-kokkos: parallel_for for fwd/bwd LRN kernels with nested lambdas
- murmurhash3-kokkos: parallel_for over keys with KOKKOS_INLINE_FUNCTION hash
- extend2-kokkos: sequential DP on host execution space via Kokkos Views
- geodesic-kokkos: parallel_for for geodesic distance computation
- degrid-kokkos: parallel_for over visibility points with sequential inner GCF loop
- haccmk-kokkos: parallel_for over particles with sequential inner N-body loop

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: kento <1034379+kento@users.noreply.github.com>
Agent-Logs-Url: https://github.com/kento/HeCBench/sessions/9f653ec5-d58e-4f3e-b35d-5b26107f0eb3

Co-authored-by: kento <1034379+kento@users.noreply.github.com>
@kento kento marked this pull request as ready for review April 12, 2026 13:41
@kento kento merged commit a830fdb into master Apr 12, 2026
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