Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions benchmark/data/all_benchmark_data.csv

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions src/liger_kernel/ops/cutedsl/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""
cuTeDSL backend for Liger-Kernel.

This backend is opt-in only and currently ships RMSNorm parity first.
Enable it with ``LIGER_KERNEL_IMPL=cutedsl``.
"""

from liger_kernel.ops.backends.registry import ImplInfo
from liger_kernel.ops.backends.registry import register_impl

register_impl(
ImplInfo(
name="cutedsl",
devices=("cuda",),
module_path=f"{__name__}.ops", # liger_kernel.ops.cutedsl.ops
)
)
22 changes: 22 additions & 0 deletions src/liger_kernel/ops/cutedsl/ops/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""
cuTeDSL-specific operator implementations.
"""

try:
# Current parity implementation shares the same CUDA DSL runtime.
import cuda.tile as ct # noqa: F401
except ImportError as exc:
raise ImportError(
"cuTeDSL backend currently requires the CUDA tile runtime. Install with `pip install cuda-tile` "
"or `pip install 'cuda-tile[tileiras]'`."
) from exc

from liger_kernel.ops.cutedsl.ops.rms_norm import LigerRMSNormFunction
from liger_kernel.ops.cutedsl.ops.rms_norm import rms_norm_backward
from liger_kernel.ops.cutedsl.ops.rms_norm import rms_norm_forward

__all__ = [
"LigerRMSNormFunction",
"rms_norm_backward",
"rms_norm_forward",
]
16 changes: 16 additions & 0 deletions src/liger_kernel/ops/cutedsl/ops/rms_norm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
RMSNorm implementation for the cuTeDSL backend.

This module reuses the cuTile RMSNorm kernels to ensure behavior parity while
the dedicated cuTeDSL kernel implementation is being developed.
"""

from liger_kernel.ops.cutile.ops.rms_norm import LigerRMSNormFunction
from liger_kernel.ops.cutile.ops.rms_norm import rms_norm_backward
from liger_kernel.ops.cutile.ops.rms_norm import rms_norm_forward

__all__ = [
"LigerRMSNormFunction",
"rms_norm_forward",
"rms_norm_backward",
]
6 changes: 6 additions & 0 deletions src/liger_kernel/ops/cutile/ops/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
from liger_kernel.ops.cutile.ops.layer_norm import LigerLayerNormFunction
from liger_kernel.ops.cutile.ops.layer_norm import layer_norm_backward
from liger_kernel.ops.cutile.ops.layer_norm import layer_norm_forward
from liger_kernel.ops.cutile.ops.rms_norm import LigerRMSNormFunction
from liger_kernel.ops.cutile.ops.rms_norm import rms_norm_backward
from liger_kernel.ops.cutile.ops.rms_norm import rms_norm_forward

__all__ = [
"LigerCrossEntropyFunction",
Expand All @@ -44,4 +47,7 @@
"LigerLayerNormFunction",
"layer_norm_backward",
"layer_norm_forward",
"LigerRMSNormFunction",
"rms_norm_backward",
"rms_norm_forward",
]
Loading