refactor: unify kernel module loading and packaging

- loader.py: lazy/cached import; is_available defers the actual load; get_module raises on unavailable
- ops/{attention,rotary,fp8}: use get_module instead of touching private _modules or their own _mod() cache
- package-data: ship astrai.extension.lib *.so in built wheels (non-editable installs previously lost every kernel)
This commit is contained in:
2026-08-23 15:57:04 +08:00
parent 4244df2785
commit 2bc4d2b8a8
5 changed files with 65 additions and 63 deletions
+3
View File
@@ -37,6 +37,9 @@ flash = ["flash-attn>=2.6"]
[tool.setuptools.packages.find]
where = ["."]
[tool.setuptools.package-data]
"astrai.extension.lib" = ["*.so"]
[tool.setuptools.dynamic]
version = { attr = "astrai.__version__" }