Skip to content

Comments

Add softmax impl mode switch and benchmark/test wiring#39

Merged
debashishc merged 2 commits intoinit-harnessfrom
tmp/init-harness-softmax-infra
Feb 8, 2026
Merged

Add softmax impl mode switch and benchmark/test wiring#39
debashishc merged 2 commits intoinit-harnessfrom
tmp/init-harness-softmax-infra

Conversation

@debashishc
Copy link
Contributor

@debashishc debashishc commented Feb 8, 2026

Summary

  • add FORGE_SOFTMAX_IMPL mode selection to softmax_online (auto, ref, kernel)
  • in kernel mode, fail fast with clear errors when kernel module/entrypoints are missing
  • keep auto mode contributor-friendly by falling back to the reference implementation
  • add tests for impl-mode behavior and invalid mode handling
  • add --impl to bench/benchmark_online_softmax.py and remove the hard N divisibility assertion
  • make bench/run.py skip softmax cases cleanly when strict kernel mode is unavailable
  • document softmax impl mode usage in DEVELOPMENT.md

Validation

  • uv run ruff check forge_cute_py/ops/softmax_online.py tests/test_softmax_online.py bench/benchmark_online_softmax.py bench/run.py
  • uv run ruff format forge_cute_py/ops/softmax_online.py tests/test_softmax_online.py bench/benchmark_online_softmax.py bench/run.py
  • uv run pytest tests/test_softmax_online.py -q
  • uv run pytest -q
  • uv run python bench/benchmark_online_softmax.py --m-sizes 64 --n-sizes 256 --dtypes float16 --warmup 2 --iterations 5 --impl auto
  • uv run python bench/benchmark_online_softmax.py --m-sizes 64 --n-sizes 256 --dtypes float16 --warmup 2 --iterations 5 --impl kernel
  • FORGE_SOFTMAX_IMPL=kernel uv run python bench/run.py --suite smoke --op softmax_online

Notes

  • includes cherry-picked benchmark script commit authored by jonah <jsamost@gmail.com> (a9d4983)
  • follow-up docs-only patch will be opened separately

@debashishc debashishc merged commit 7ef01b2 into init-harness Feb 8, 2026
2 checks passed
@debashishc debashishc deleted the tmp/init-harness-softmax-infra branch February 8, 2026 06:02
debashishc added a commit that referenced this pull request Feb 8, 2026
## Summary
- fix stale docs references to removed `CLAUDE.md`
- correct public API wording in `DEVELOPMENT.md`
(`forge_cute_py.ops.<op>()`)
- update README benchmark quick reference with softmax benchmark
commands and impl-mode notes
- clarify current release state in `CONTRIBUTING.md` (`v0.1.0-rc1`
exists; final `v0.1.0` pending)
- add changelog bullets for softmax impl-mode selection and benchmark
CLI updates

## Scope
- docs-only patch (`README.md`, `DEVELOPMENT.md`, `ROADMAP.md`,
`CHANGELOG.md`, `CONTRIBUTING.md`)
- no runtime code changes

## Notes
- follow-up to #39
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.

2 participants