Skip to content

kernel-builder: add CUDA capability detection for tvm-ffi builds#357

Merged
danieldk merged 3 commits intomainfrom
tvm-ffi-gpu-detect
Mar 16, 2026
Merged

kernel-builder: add CUDA capability detection for tvm-ffi builds#357
danieldk merged 3 commits intomainfrom
tvm-ffi-gpu-detect

Conversation

@danieldk
Copy link
Member

@danieldk danieldk commented Mar 14, 2026

Make the CMake build to detect the CUDA capability of the GPU by default. This speeds up builds when developing, since we only need to compile for a single capability. Kernels still get built for the full of capabilities when doing a regular kernel build, since it passes BUILD_ALL_SUPPORTED_ARCHS=ON.

Fixes #354.

Make the CMake build to detect the CUDA capability of the GPU by
default. This speeds up builds when developing, since we only need to
compile for a single capability. Kernels still get built for the full
of capabilities when doing a regular kernel build, since it passes
`BUILD_ALL_SUPPORTED_ARCHS=ON`.
@danieldk danieldk marked this pull request as ready for review March 14, 2026 13:20
sayakpaul
sayakpaul previously approved these changes Mar 16, 2026
@@ -36,7 +36,7 @@ endif()
set(KERNEL_REVISION "{{ revision }}" CACHE STRING "Kernel revision, must be unique")
set(OPS_NAME "_{{python_name}}_${BACKEND}_{{ revision }}")

option(BUILD_ALL_SUPPORTED_ARCHS "Build all supported architectures" on)
option(BUILD_ALL_SUPPORTED_ARCHS "Build all supported architectures" off)
Copy link
Member

Choose a reason for hiding this comment

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

When is this turned back on?

Copy link
Member Author

Choose a reason for hiding this comment

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

This mirrors the Torch version. It was set to on for tvm-ffi because the detection is not implemented yet. We set it to on in the Nix builder, so that official builds get the full range of capabilities:

(lib.cmakeBool "BUILD_ALL_SUPPORTED_ARCHS" true)

@danieldk danieldk merged commit e77f2f0 into main Mar 16, 2026
38 checks passed
@danieldk danieldk deleted the tvm-ffi-gpu-detect branch March 16, 2026 12:29
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.

Add tvm-ffi CUDA capability detection (for devshells)

2 participants