[Kernel] Enable TritonW4A16LinearKernel as CUDA fallback for non-Marlin-aligned W4A16 shapes (#43731)
Signed-off-by: Luciano Martins <lucianommartins@users.noreply.github.com> Co-authored-by: Luciano Martins <lucianommartins@users.noreply.github.com>
This commit is contained in:
co-authored by
Luciano Martins
parent
158289e0fc
commit
2272062471
@@ -336,6 +336,7 @@ _POSSIBLE_KERNELS: dict[PlatformEnum, list[type[MPLinearKernel]]] = {
|
||||
MarlinLinearKernel,
|
||||
ConchLinearKernel,
|
||||
ExllamaLinearKernel,
|
||||
TritonW4A16LinearKernel,
|
||||
],
|
||||
PlatformEnum.ROCM: [
|
||||
TritonW4A16LinearKernel,
|
||||
|
||||
@@ -288,8 +288,8 @@ class TritonW4A16LinearKernel(MPLinearKernel):
|
||||
|
||||
@classmethod
|
||||
def can_implement(cls, c: MPLinearLayerConfig) -> tuple[bool, str | None]:
|
||||
if not current_platform.is_rocm():
|
||||
return False, "TritonW4A16LinearKernel only targets ROCm"
|
||||
if not (current_platform.is_rocm() or current_platform.is_cuda()):
|
||||
return False, "TritonW4A16LinearKernel requires CUDA or ROCm"
|
||||
|
||||
if c.weight_type not in cls.SUPPORTED_QUANT_TYPES:
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user