diff --git a/README.md b/README.md index 42b9f5a0..4da2bc38 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,7 @@ pip install -e ".[dev]" --extra-index-url https://triton-ascend.osinfra.cn/pypi/ - `cuda-tile`: Required when enabling the optional cuTile backend on CUDA. Use this when your environment already provides CUDA Toolkit 13.1 or newer, or an existing tileiras compiler installation. - `cuda-tile[tileiras]`: Required when enabling the optional cuTile backend with the tileiras compiler installed directly into your Python environment. - `nvidia-cutlass-dsl >= 4.6.0`: Required when enabling the optional CuTe DSL backend on CUDA (the CUDA-only Python DSL shipped with NVIDIA CUTLASS, `import cutlass.cute`). Targets Hopper (SM90) and Blackwell (SM100/SM110). +- `liger-cute-kernels`: Native CUTLASS + NVSHMEM kernels for Hopper and Blackwell, installed at the exact matching Liger version by the `lck` extra. > **Note:** > Our kernels inherit the full spectrum of hardware compatibility offered by [Triton](https://github.com/triton-lang/triton). @@ -162,6 +163,12 @@ To install the stable version: $ pip install liger-kernel ``` +To also install the matching native Liger communication kernels: + +```bash +$ pip install "liger-kernel[lck]" +``` + To install the nightly version: ```bash @@ -197,6 +204,9 @@ pip install -e ".[cutile-tileiras]" # Setup CuTe DSL (NVIDIA CUTLASS Python DSL) Dependencies pip install -e ".[cutedsl]" +# Setup native Liger communication kernels +pip install -e ".[lck]" + ``` ### Enable cuTile Backend diff --git a/pyproject.toml b/pyproject.toml index 8f5f11eb..d189d231 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "liger_kernel" -version = "0.8.2" +version = "0.8.3" description = "Efficient Triton kernels for LLM Training" urls = { "Homepage" = "https://github.com/linkedin/Liger-Kernel" } readme = { file = "README.md", content-type = "text/markdown" } diff --git a/setup.py b/setup.py index 213cf030..35f4f028 100644 --- a/setup.py +++ b/setup.py @@ -1,13 +1,24 @@ # setup.py +import re import subprocess +from pathlib import Path from typing import Literal from setuptools import find_packages from setuptools import setup +def get_project_version() -> str: + """Read the public package version shared with liger-cute-kernels.""" + pyproject = Path(__file__).resolve().parent / "pyproject.toml" + match = re.search(r'(?m)^version\s*=\s*"([^"]+)"\s*$', pyproject.read_text()) + if match is None: + raise RuntimeError(f"could not read the project version from {pyproject}") + return match.group(1) + + def get_default_dependencies(): """Determine the appropriate dependencies based on detected hardware.""" platform = get_platform() @@ -49,6 +60,9 @@ def get_optional_dependencies(): # per-call cost dominates: RMSNorm forward measured 53us -> 15us on B200. "apache-tvm-ffi>=0.1.0", ] + lck_deps = [ + f"liger-cute-kernels=={get_project_version()}", + ] dev_deps = [ "transformers>=4.52.0", "matplotlib>=3.7.2", @@ -68,6 +82,7 @@ def get_optional_dependencies(): "cutile": cutile_deps, "cutile-tileiras": cutile_tileiras_deps, "cutedsl": cutedsl_deps, + "lck": lck_deps, "dev": dev_deps, }