feat: add kernel preload
This commit is contained in:
@@ -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'
|
||||
Reference in New Issue
Block a user