Skip to content

Add challenge 90: Causal Depthwise Conv1d (Medium)#233

Open
claude[bot] wants to merge 1 commit intomainfrom
add-challenge-90-causal-depthwise-conv1d
Open

Add challenge 90: Causal Depthwise Conv1d (Medium)#233
claude[bot] wants to merge 1 commit intomainfrom
add-challenge-90-causal-depthwise-conv1d

Conversation

@claude
Copy link
Copy Markdown
Contributor

@claude claude bot commented Apr 2, 2026

Summary

  • Adds challenge 90: Causal Depthwise 1D Convolution (Medium difficulty)
  • The solver must implement a batched depthwise causal 1D conv over a (B, L, D) tensor, where each channel d is convolved with its own kernel weight[d, :] and only past/present positions are accessible (zero-padded boundary)
  • This is the short convolution used in Mamba/SSM models before the selective scan, making it a real-world inference building block
  • Teaches: channels-last memory layout, sliding-window boundary conditions, no cross-channel mixing (depthwise structure), and the tradeoff between tiling along L vs. D

Key design decisions

  • Convention: weight[d, 0] applies to the current position, weight[d, K-1] to the oldest — natural convolution notation (reference impl flips before calling F.conv1d)
  • Performance test: B=8, L=2048, D=4096, K=4 (Mamba-like dimensions, ~512 MB total, fits 5× in 16 GB)
  • Difficulty: Medium — empty solve stub only, no kernel scaffold

Test plan

  • Validated locally: example test passes with reference CUDA solution on NVIDIA TESLA T4
  • All 6 starter files present and correct
  • pre-commit run --all-files passes (black, isort, flake8, clang-format, trim whitespace)
  • Checklist in CLAUDE.md verified: HTML starts with <p>, uses <h2> sections, example matches generate_example_test(), performance bullet matches generate_performance_test()

🤖 Generated with Claude Code

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>
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.

0 participants