feat: add kernel preload

This commit is contained in:
2025-11-19 14:16:45 +00:00
parent ffe2b6b974
commit d763aaf304
3 changed files with 61 additions and 0 deletions

View File

@@ -137,3 +137,14 @@ _ensure_initialized()
if __debug__:
_verify_ops_loaded()
# Preload cached kernels if enabled via environment variable
if os.environ.get('DG_PRELOAD_KERNELS', '0') == '1':
try:
deep_gemm_cpp.preload_kernels()
except Exception as e:
# Preloading failure should not block initialization
import warnings
warnings.warn(f"Failed to preload DeepGEMM kernels: {e}")
__version__ = '2.1.2'