feat: add optional CUDA kernel system (csrc/) + fused GQA decode attention

Structure:
  csrc/               -- .cu sources + build.py registry
  astrai/extension/   -- compiled .so + __init__.py (import dispatcher)
  setup.py            -- CUDAExtension from csrc/build.py REGISTRY

Control: CSRC_KERNELS=true|false env var at install time.
Fallback: astrai.extension.available dict for runtime detection.
This commit is contained in:
2026-07-06 12:09:58 +08:00
parent 2579658e15
commit e8e228d035
7 changed files with 201 additions and 2 deletions
+12 -2
View File
@@ -7,8 +7,12 @@
# Allow specific file types and root files
!astrai/**/*.py
!scripts/**/*.py
!scripts/**/*.sh
!tests/**/*.py
!csrc/**/*.py
!csrc/**/*.cu
!scripts/**/*.sh
# Allow GitHub files
!/.github/**
@@ -22,4 +26,10 @@
!/CONTRIBUTING.md
!/LICENSE
!/pyproject.toml
!/README.md
!/README.md
# Allow extension modules (only source .py)
!/astrai/extension/**/*.py
# Allow build files
!/setup.py
!/AGENTS.md