Skip to content
Draft
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
8 changes: 7 additions & 1 deletion src/liger_kernel/ops/rope.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ def _triton_rope(
sin,
sin_row_stride,
sl,
bs: tl.constexpr,
# `bs` is unused by the kernel body and is deliberately NOT a tl.constexpr.
# Marking it constexpr forces Triton/Dynamo to specialize on the batch size,
# which fails when torch.compile makes the batch dimension dynamic: the value
# arrives as a SymInt and Dynamo trips an internal assertion while tracing
# LigerRopeFunction ("assert subgraph_vt.is_tensor() or isinstance(
# subgraph_vt, SymNodeVariable)" in _dynamo/variables/higher_order_ops.py).
bs,
cos_bs: tl.constexpr,
n_qh: tl.constexpr,
n_kh: tl.constexpr,
Expand Down
Loading