Skip to content

build: lower CUDA floor to 12.9, stage oversized GEMM smem dynamically - #235

Draft
teo-mateo wants to merge 1 commit into
Neroued:masterfrom
teo-mateo:sm120-cuda-129
Draft

teo-mateo wants to merge 1 commit into
Neroued:masterfrom
teo-mateo:sm120-cuda-129

Conversation

@teo-mateo

Copy link
Copy Markdown

What

  • Lower the CMake CUDA requirement from 13.1 to 12.9.
  • W8/NVFP4 GEMM kernels whose staged storage (activations, weight codes, scales) exceeds the 48 KiB static shared-memory cap that applies on pre-CUDA-13 toolchains now stage that storage in dynamic shared memory. The size is computed at compile time through per-schedule *_dynamic_bytes helpers, and every launch site raises cudaFuncAttributeMaxDynamicSharedMemorySize when the storage exceeds the cap. Kernels whose storage fits the cap keep their static allocation.

Files

  • CMakeLists.txt — version guard 13.1 -> 12.9.
  • src/ops/linear/w8/ — new shared-storage struct and dynamic-bytes helpers; the row-split MMA and small-T MMA kernels select static vs dynamic smem at compile time.
  • Launch sites across attn_input_proj, gdn_input_proj, linear, linear_add, linear_pair, linear_swiglu, and dynamic_grouped_conv — attribute setup and the dynamic smem size argument.

Verification

  • Change set is byte-identical to the author's local worktree (verified per-file diff plus matching git patch-id).
  • No build or numerical test has been run for this PR yet: the repo has no CI, and the local worktree predates this commit. Build on the CUDA 13.1 / sm_120a toolchain and the affected op tests should be run before merge.

Toolchains before CUDA 13 cap statically allocated shared memory at 48 KiB
per block. W8 and NVFP4 GEMM kernels whose staged storage (activations,
weight codes, scales) exceeds the cap now stage it in dynamic shared
memory, sized through the matching dynamic-bytes helpers, and every launch
site raises cudaFuncAttributeMaxDynamicSharedMemorySize when the storage
exceeds the cap. Kernels whose storage fits the cap keep their static
allocation.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 527e71443c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread CMakeLists.txt
endif()

if(CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 13.1)
if(CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 12.9)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Publish the lowered CUDA requirement

When users consult the supported build prerequisites, README.md:25 and every current model card still require CUDA Toolkit 13.1 or newer, while this guard now accepts 12.9. Update those active references with the implementation so the newly supported toolchain is not contradicted or undiscoverable.

AGENTS.md reference: AGENTS.md:L19-L21

Useful? React with 👍 / 👎.

@teo-mateo
teo-mateo marked this pull request as draft September 13, 2026 19:10
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