Standalone tree split from LLMRL/projects/kda. Includes Triton dt_bias backward fix, train_k3 --preset 0.5b, SFT, Docker runtime, and tests.
35 lines
658 B
Python
35 lines
658 B
Python
"""Identity dispatch: keep the NVIDIA Triton implementation in this tree."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from collections.abc import Callable
|
|
from typing import TypeVar
|
|
|
|
F = TypeVar("F", bound=Callable)
|
|
|
|
|
|
def dispatch(operation: str):
|
|
def decorator(func: F) -> F:
|
|
return func
|
|
|
|
return decorator
|
|
|
|
|
|
class BaseBackend:
|
|
backend_type = "triton"
|
|
|
|
def is_available(self) -> bool:
|
|
return True
|
|
|
|
def is_enabled(self) -> bool:
|
|
return True
|
|
|
|
|
|
class BackendRegistry:
|
|
@classmethod
|
|
def ensure_initialized(cls, operation: str) -> None:
|
|
return None
|
|
|
|
|
|
__all__ = ["BackendRegistry", "BaseBackend", "dispatch"]
|