FlashKDA
FlashKDA copied to clipboard
Report CUTLASS setup and CUDA launch-configuration failures
TL;DR
Fail at the operation that caused a setup or CUDA configuration error instead of continuing to a later, less actionable failure.
Closes #15.
Motivation
Two initialization boundaries currently discard errors:
| Boundary | Current behavior | New behavior |
|---|---|---|
| CUTLASS submodule initialization | Ignore the Git exit status and continue toward compilation | Run from the repository root, check the exit status, and report an actionable error |
| CUDA dynamic shared-memory configuration | Ignore cudaFuncSetAttribute results |
Propagate the CUDA error through C10_CUDA_CHECK |
The documented clone and submodule workflow remains valid. This change improves reporting when that workflow or launch configuration fails.
Changes
- Move CUTLASS initialization into a small testable setup helper.
- Run
git submodule update --init cutlassfrom the repository root. - Enable
check=Truefor the Git subprocess. - Distinguish a missing Git executable from a nonzero Git exit.
- Include the helper in source distributions.
- Check both kernel
cudaFuncSetAttributecalls withC10_CUDA_CHECK.
No architecture selection, kernel launch dimensions, shared-memory sizes, or successful setup behavior changes.
Suggested review order
build_utils.py— setup failure boundary and diagnostics.tests/test_build_utils.py— subprocess behavior.setup.pyandMANIFEST.in— setup integration and source-distribution inclusion.csrc/smxx/fwd_launch.cu— CUDA error propagation.
The two commits are intentionally separated: the first implements the diagnostics, and the second ensures the new setup helper is present in source distributions.
Validation
python -m pytest -q tests/test_build_utils.py— 3 passed.- Built a source distribution and verified that it contains
build_utils.py. - Confirmed that the supported PyTorch CUDA headers define
C10_CUDA_CHECK. python -m py_compile build_utils.py setup.py tests/test_build_utils.pygit diff --check origin/master...HEAD