@@ -35,3 +35,44 @@ steps:
3535
3636If the user did not specify the version tag, stop and ask which tag to sync
3737from.
38+
39+ ## liger-kernels
40+
41+ When the user asks to sync a Liger-Kernel release, carry out the following
42+ steps:
43+
44+ - Fetch the upstream Git repository from https://github.com/linkedin/Liger-Kernel.git
45+ - Check out the tag that the user specified (e.g. ` v0.8.0 ` ).
46+ - Liger-Kernel ops are in the directory ` src/liger_kernel/ops ` of the upstream
47+ repo. There is no ` cute ` / ` quack ` dependency — only the Triton ops are
48+ mirrored.
49+ - For each file already present in ` liger-kernels/torch-ext/liger_kernels/ ` ,
50+ except ` __init__.py ` and ` layers.py ` (which are local additions, not
51+ upstream), copy the matching file from ` src/liger_kernel/ops/ ` upstream,
52+ overwriting the local copy. Do not introduce new files that were not
53+ previously synced — the local tree intentionally tracks a subset of upstream
54+ ops.
55+ - Some helpers used by the ops live in the upstream top-level module
56+ ` src/liger_kernel/utils.py ` (e.g. ` is_npu_available ` ) rather than in
57+ ` src/liger_kernel/ops/utils.py ` . If a synced op imports such a helper, fold
58+ the helper into ` liger-kernels/torch-ext/liger_kernels/utils.py ` instead of
59+ adding a separate file.
60+ - Now make all imports of Liger-Kernel in
61+ ` liger-kernels/torch-ext/liger_kernels ` relative imports. In particular:
62+ - ` from liger_kernel.ops.<name> import ... ` → ` from .<name> import ... `
63+ - ` from liger_kernel.ops.utils import ... ` → ` from .utils import ... `
64+ - ` from liger_kernel.utils import ... ` → ` from .utils import ... ` (after
65+ folding the helper into the local ` utils.py ` ).
66+ - Do not modify ` liger-kernels/torch-ext/liger_kernels/__init__.py ` or
67+ ` layers.py ` — these are local ` torch.nn.Module ` wrappers that are not
68+ derived from upstream.
69+ - Check whether any Torch custom ops are defined in the synced files (look
70+ for ` torch.library.custom_op ` , ` torch.library.define ` , etc.). If any are
71+ found, update them to use ` add_op_namespace_prefix ` for the op name,
72+ importing it from ` ._ops ` (see
73+ ` flash-attn3/torch-ext/flash_attn3/flash_attn_interface.py ` for an
74+ example). Upstream Liger-Kernel does not currently define any such ops, so
75+ this step is usually a no-op.
76+
77+ If the user did not specify the version tag, stop and ask which tag to sync
78+ from.
0 commit comments