Skip to content

Report CUTLASS setup and CUDA launch-configuration failures - #19

Open
morluto wants to merge 2 commits into
MoonshotAI:masterfrom
morluto:codex/cuda-errors
Open

Report CUTLASS setup and CUDA launch-configuration failures#19
morluto wants to merge 2 commits into
MoonshotAI:masterfrom
morluto:codex/cuda-errors

Conversation

@morluto

@morluto morluto commented Jul 27, 2026

Copy link
Copy Markdown

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 cutlass from the repository root.
  • Enable check=True for the Git subprocess.
  • Distinguish a missing Git executable from a nonzero Git exit.
  • Include the helper in source distributions.
  • Check both kernel cudaFuncSetAttribute calls with C10_CUDA_CHECK.

No architecture selection, kernel launch dimensions, shared-memory sizes, or successful setup behavior changes.

Suggested review order

  1. build_utils.py — setup failure boundary and diagnostics.
  2. tests/test_build_utils.py — subprocess behavior.
  3. setup.py and MANIFEST.in — setup integration and source-distribution inclusion.
  4. 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.py
  • git diff --check origin/master...HEAD

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.

Surface CUTLASS initialization and CUDA launch-configuration failures

1 participant