Skip to content

Add challenge 94: SSM Selective Scan (Medium)#246

Merged
shxjames merged 1 commit into
mainfrom
add-challenge-94-ssm-selective-scan
May 4, 2026
Merged

Add challenge 94: SSM Selective Scan (Medium)#246
shxjames merged 1 commit into
mainfrom
add-challenge-94-ssm-selective-scan

Conversation

@claude
Copy link
Copy Markdown
Contributor

@claude claude Bot commented Apr 14, 2026

Summary

  • Adds challenge 94: SSM Selective Scan (Medium difficulty), the core recurrence at the heart of Mamba-style state space models
  • Solvers implement the full selective scan: discretize A using exp(delta * A), update a vector-valued hidden state h of size d_state for each of d_model independent channels, and compute output via the C projection plus a skip connection
  • Teaches parallel scan algorithms (the naive sequential loop is O(seq_len); a good GPU solution uses a parallel prefix scan), multi-dimensional hidden state management, and memory layout for 4D tensors
  • Clearly distinct from challenge 82 (Linear Recurrence), which has a scalar hidden state — here the state is d_state-dimensional per channel, requiring a C-projection output step
  • All 6 starter files provided; CUDA reference solution validated against the live T4 platform (✓ All tests passed)

Test plan

  • pre-commit run --all-files passes (black, isort, flake8, clang-format, mojo format)
  • Example test passes on T4 via run_challenge.py --action run
  • All functional + performance tests pass on T4 via run_challenge.py --action submit
  • Checklist in CLAUDE.md verified: HTML starts with <p>, correct <h2> sections, <pre> example, performance bullet, SVG diagram, 10 functional test cases, performance test fits 5× in 16 GB VRAM

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@shxjames shxjames merged commit 45e64f1 into main May 4, 2026
4 of 5 checks passed
@shxjames shxjames deleted the add-challenge-94-ssm-selective-scan branch May 4, 2026 02:40
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.

1 participant