[trimul] add CUDA, HIP, and SYCL benchmarks - #335
Open
zjin-lcf wants to merge 7 commits into
Open
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
🟡 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.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing
src/trimul-cuda:make -B && ./main 1 40 36 2src/trimul-hip:make -B && ./main 1 40 36 2src/trimul-sycl:make -B CUDA=yes CUDA_ARCH=sm_90 ... && ./main 1 40 36 2All three variants report
PASSwith matching error metrics.