Add challenge 90: Causal Depthwise Conv1d (Medium)#233
Open
claude[bot] wants to merge 1 commit intomainfrom
Open
Add challenge 90: Causal Depthwise Conv1d (Medium)#233claude[bot] wants to merge 1 commit intomainfrom
claude[bot] wants to merge 1 commit intomainfrom
Conversation
Implement the causal depthwise 1D convolution used in Mamba/SSM models, where each channel is convolved independently with only past and present input positions (zero-padded left boundary). Teaches GPU memory access patterns for channels-last layout and sliding-window boundary handling. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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
(B, L, D)tensor, where each channeldis convolved with its own kernelweight[d, :]and only past/present positions are accessible (zero-padded boundary)Key design decisions
weight[d, 0]applies to the current position,weight[d, K-1]to the oldest — natural convolution notation (reference impl flips before callingF.conv1d)B=8, L=2048, D=4096, K=4(Mamba-like dimensions, ~512 MB total, fits 5× in 16 GB)solvestub only, no kernel scaffoldTest plan
pre-commit run --all-filespasses (black, isort, flake8, clang-format, trim whitespace)<p>, uses<h2>sections, example matchesgenerate_example_test(), performance bullet matchesgenerate_performance_test()🤖 Generated with Claude Code