Skip to content

[trimul] add CUDA, HIP, and SYCL benchmarks - #335

Open
zjin-lcf wants to merge 7 commits into
ORNL:masterfrom
zjin-lcf:add-trimul-benchmarks
Open

[trimul] add CUDA, HIP, and SYCL benchmarks#335
zjin-lcf wants to merge 7 commits into
ORNL:masterfrom
zjin-lcf:add-trimul-benchmarks

Conversation

@zjin-lcf

@zjin-lcf zjin-lcf commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add BF16 Triangle Multiplicative Update benchmarks for CUDA, HIP, and SYCL
  • use fused matrix-core projection/gating kernels with cuBLAS/hipBLAS triangle projection and a SYCL joint-matrix fallback
  • add a shared OpenMP-parallel CPU reference, Makefiles, CMake integration, licensing, and README registration
  • validate both outgoing and incoming variants, including per-element scaled error and aggregate RMS error

Testing

  • src/trimul-cuda: make -B && ./main 1 40 36 2
  • src/trimul-hip: make -B && ./main 1 40 36 2
  • src/trimul-sycl: make -B CUDA=yes CUDA_ARCH=sm_90 ... && ./main 1 40 36 2

All three variants report PASS with matching error metrics.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new trimul-sycl/Makefile has vendor/target configurability issues (notably AdaptiveCpp handling and arch override conventions) that can break builds or reduce usability.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds a new “trimul” benchmark (Triangle Multiplicative Update from the AlphaFold Evoformer) to HeCBench, providing optimized BF16 implementations across CUDA, HIP, and SYCL, plus a shared CPU reference for correctness checking.

Changes:

  • Introduces CUDA (WMMA + cuBLAS), HIP (rocWMMA + hipBLAS), and SYCL (joint_matrix + optional oneMKL) benchmark implementations with validation/timing loops.
  • Adds a shared OpenMP-parallel CPU reference (reference.h) reused by the GPU variants for correctness verification.
  • Registers the new benchmark in the top-level CMake and README.
File summaries
File Description
src/trimul-sycl/Makefile SYCL build/run rules, GPU/ONEMKL toggles, target selection flags
src/trimul-sycl/main.cpp SYCL BF16 implementation using joint_matrix + validation/benchmark harness
src/trimul-sycl/LICENSE License attribution (Apache-2.0) for derived algorithm
src/trimul-sycl/CMakeLists.txt CMake integration for SYCL model
src/trimul-hip/Makefile HIP build/run rules (hipcc + hipBLAS + OpenMP ref)
src/trimul-hip/main.cu HIP BF16 implementation using rocWMMA + hipBLAS + validation/benchmark harness
src/trimul-hip/LICENSE License attribution (Apache-2.0) for derived algorithm
src/trimul-hip/CMakeLists.txt CMake integration for HIP model
src/trimul-cuda/reference.h Shared CPU reference + argument validation helpers
src/trimul-cuda/Makefile CUDA build/run rules (nvcc + cuBLAS + OpenMP ref)
src/trimul-cuda/main.cu CUDA BF16 implementation using WMMA + cuBLAS + validation/benchmark harness
src/trimul-cuda/LICENSE License attribution (Apache-2.0) for derived algorithm
src/trimul-cuda/CMakeLists.txt CMake integration for CUDA model
src/CMakeLists.txt Adds trimul to benchmark registry
README.md Adds trimul to ML category list + benchmark blurb
Review details

Suppressed comments (1)

src/trimul-sycl/Makefile:52

  • LDFLAGS always includes '-Xarch_host -fopenmp'; if VENDOR=AdaptiveCpp (where -fsycl is removed) '-Xarch_host' will still be passed at link time and may fail. Consider making -Xarch_host conditional like in CFLAGS.
# Linker Flags
LDFLAGS = -Xarch_host -fopenmp

  • Files reviewed: 15/15 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/trimul-sycl/Makefile
Comment thread src/trimul-sycl/Makefile Outdated
Allow CUDA_ARCH/HIP_ARCH overrides with ?= and apply -Xarch_host -fopenmp only for DPC++ compile and link.

Co-authored-by: Cursor <cursoragent@cursor.com>
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