[Kernels] Add causal_conv1d kernel benchmark#6624
Open
gabrieldemarmiesse wants to merge 1 commit into
Open
Conversation
BEGIN_PUBLIC [Kernels][GPU] Add causal_conv1d forward GPU benchmark Adds a kernel-time benchmark for the channel-first causal_conv1d forward GPU kernel (state_space). It mirrors the validated test launch config (kNThreads=128, kNElts=4), times the kernel via the Bench/Bencher iter_custom harness, and reports achieved memory bandwidth (the op is memory-bound) as 2 * batch * dim * seqlen * sizeof(dtype). dtype and conv width are compile-time defines (default bfloat16, width=4 to match the common Mamba config); batch, dim, seqlen and the SiLU activation flag are runtime args. Since causal_conv1d lives in //max:state_space, which the globbed GPU benchmark deps don't include, the target is declared explicitly (and excluded from the glob) following the existing bench_conv2d/bench_conv3d pattern. END_PUBLIC Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Signed-off-by: Gabriel <[email protected]>
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.
Type of change
Motivation
I want to improve the perf of the causal-conv1d implemented in MAX. I want to use some code I already wrote for my package. For this I need to show i have better numbers. So we must start with a benchmark.
What changed
Added a benchmark for causal-conv1d
Testing
run the benchmark
Checklist
agreed-upon, or this is a trivial fix that does not need prior
approval
smaller PRs where possible (see
pull request sizes)
./bazelw run formatto format my changesAssisted-by:trailer in my commit message or this PR description (seeAI Tool Use Policy)
Assisted by Claude