refactor: unify operator selection behind generic dispatch
Add astrai/extension/dispatch.py: per-family decision tables over composable Specs, with explicit-strict / implicit-loose resolution, ASTR_OPS env overrides, profile presets, and explain traces. Migrate attention (behavior-preserving facade) and rotary onto it; new tests cover spec algebra, resolution semantics, and spec-vs-supports_call consistency.
This commit is contained in:
@@ -27,6 +27,20 @@ from astrai.extension.backend import (
|
||||
attn_backend,
|
||||
get_backend,
|
||||
)
|
||||
from astrai.extension.dispatch import (
|
||||
CallContext,
|
||||
ExplicitSelectionError,
|
||||
ImplRecord,
|
||||
Resolution,
|
||||
Spec,
|
||||
explain,
|
||||
explain_plan,
|
||||
op_backend,
|
||||
register_env_alias,
|
||||
register_family,
|
||||
resolve,
|
||||
resolve_plan,
|
||||
)
|
||||
from astrai.extension.loader import KERNEL_NAMES, is_available
|
||||
from astrai.extension.ops import (
|
||||
TensorLayout,
|
||||
@@ -52,4 +66,16 @@ __all__ = [
|
||||
"is_available",
|
||||
"KERNEL_NAMES",
|
||||
"apply_rotary_emb",
|
||||
"CallContext",
|
||||
"ExplicitSelectionError",
|
||||
"ImplRecord",
|
||||
"Resolution",
|
||||
"Spec",
|
||||
"explain",
|
||||
"explain_plan",
|
||||
"op_backend",
|
||||
"register_env_alias",
|
||||
"register_family",
|
||||
"resolve",
|
||||
"resolve_plan",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user