Workflow for FLA backend dispatch decorators and backend implementations. Use when touching fla.ops.backends, @dispatch-decorated functions, BaseBackend subclasses, backend verifier methods, backend env vars, or backend tests.
70
86%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Use this skill for the runtime backend dispatch system implemented in
fla/ops/backends/__init__.py.
@dispatch('<operation>').fla.ops.<operation>.backends, unless the operation
has a custom module in _OPERATION_BACKEND_MODULES (for example modules).BackendRegistry('<operation>') and register
BaseBackend subclasses.priority where lower means
higher priority.is_available() and is_enabled() are both
true.is_available() and is_enabled() directly; do not
rely on the cached can_use() path inside code that must be torch.compile
friendly.<func_name>_verifier exists, it must return (True, None) or
(False, reason). Rejected calls fall back to the next backend.FLA_DISABLE_BACKEND_DISPATCH=1 bypasses the decorator entirely.torch.compiler.disable, so keep backend
selection logic outside compiled graphs and keep compiled work inside the
selected backend implementation.For a new backend:
BaseBackend subclass under the operation's backends/ package.backend_type, package_name, env_var, default_enable, and priority.<public_function_name>_verifier(...) with the same public call
surface as the decorated function.<public_function_name>(...) and keep return values identical to
the default implementation.backends/__init__.py.torch.is_grad_enabled() or
torch.is_inference_mode_enabled() as appropriate.FLA_DISABLE_BACKEND_DISPATCH=1 and still get the same
API behavior.@dispatch('kda') maps to fla.ops.kda.backends; special cases belong in
_OPERATION_BACKEND_MODULES.FLA_DISABLE_BACKEND_DISPATCH=1 when comparing against
the Triton/default path.FLA_FLASH_KDA, FLA_TILELANG,
FLA_INTRACARD_CP) when testing route behavior.fla/ops/<op>/backends/, ensure dependent op tests
still run; scripts/find_dependent_tests.py maps backend changes back to the
decorated op files.fla.utils for hardware/platform decisions instead
of adding new direct torch.cuda checks in public code or tests. If no helper
covers the condition, add a small helper in fla.utils first.27967b9
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.