feat: batchgen_kernels versioning, ccache, JIT dev mode, and multi-arch support - #112
Merged
Conversation
added 2 commits
March 24, 2026 21:16
…_dim) For models with rotary_dim < head_dim (e.g., MiniMax rotary_dim=64, head_dim=128), the kernel now copies dims [2*half_dim, head_dim) from input to output. Zero overhead for models where 2*half_dim == head_dim (loop never executes).
…ch support Add proper version management (0.2.0), incremental build support via ccache/sccache auto-detection, JIT dev mode (BATCHGEN_KERNELS_DEV=1), runtime compatibility check in batchgen, and BUILD_ARCH gating for multi-architecture wheel builds (sm90a/sm100/all). Single source of truth: batchgen_kernels/_version.py
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add proper version management, incremental build support, and multi-architecture infrastructure to
batchgen_kernels. Previously, the version was hardcoded as "0.1.0" in three places with no tagging, no compatibility checks, and full recompilation required for any change.Motivation
.cufile required recompiling all 37 CUDA files (~10-20 min). No caching.Changes
1. Version infrastructure (single source of truth)
_version.py:__version__ = "0.2.0",version_info = (0, 2, 0), arch-aware__version_full__setup.pyandpyproject.tomlread version dynamically — one place to bumpbatchgen-kernels-v{X.Y.Z}+sm90a2. Runtime compatibility check
batchgen/kernel_compat.py: checksbatchgen_kernels.version_info >= MIN_KERNELS_VERSIONatimport batchgen3. ccache/sccache integration
setup.pyauto-detects ccache or sccache and configures CC/CXX wrappers.cufiles recompile.4. JIT dev mode
BATCHGEN_KERNELS_DEV=1enables JIT fallback inload_extension()_jit_registry.pymirrors all 22 CUDAExtension configs for JIT compilation.cufile and test immediately without rebuilding the wheel5. Multi-architecture build gating
BUILD_ARCHenv var:"sm90a"(default),"sm100","all"BUILD_ARCHbatchgen_kernels-0.2.0+sm90a-*.whl(PEP 440 local version)6. External user support
nvccpathbatchgen_kernels/_version.pybatchgen_kernels/_jit_registry.pybatchgen_kernels/__init__.pyload_extension()with JIT fallbackbatchgen_kernels/setup.pybatchgen_kernels/pyproject.tomlbatchgen/kernel_compat.pybatchgen/__init__.pyType of Change
Checklist