Skip to content

armgit / laya

Public Imported from GitHub
0

Non-autoregressive System 1 decision engine. Typed choice, score and yes/no decisions over any text in a single forward pass, in 100+ languages, with a router that picks the right checkpoint per request.

docs(tl_kernels): tighten the route sentence, and let the row check accept a direct bucket_rows call

Aashishc3b0d3126133
diff --git a/laya/tl_kernels.py b/laya/tl_kernels.py
index 617cfc2e..15382eff 100644
--- a/laya/tl_kernels.py
+++ b/laya/tl_kernels.py
@@ -6,8 +6,8 @@ caller, `laya.fast.FastLaya._forward_unlocked`, pads the batch dim to the next p
(`laya.backends.base.bucket_rows`, so a single question stays one row) and the sequence dim to a
16-token bucket up to `DYNAMIC_MAX_L` and a 64-token bucket beyond -- the policy
`laya.backends.base.bucket_tokens` implements, which `_forward_unlocked` repeats against its own
-`FastLaya.DYNAMIC_MAX_L`/`LONG_BUCKET` instead of calling it. `laya.backends.base.pad_batch` is the
-compile route's copy of the same policy, and that route never reaches these kernels. M is the flattened
+`FastLaya.DYNAMIC_MAX_L`/`LONG_BUCKET` instead of calling it. `laya.backends.base.pad_batch` applies
+that policy for the compile route, which never reaches these kernels. M is the flattened
`rows * tokens`, so the multiple-of-16 comes from the token dim, not the row dim; out-of-bounds
rows are predicated by TileLang's `T.ceildiv(M, bm)`, so the kernels themselves place no
constraint on M. Use compile_cpu for an explicit fp32 CPU specialization; the GPU defaults are unchanged.
diff --git a/tests/test_confidence.py b/tests/test_confidence.py
index 6ea751f9..204ca3ec 100644
--- a/tests/test_confidence.py
+++ b/tests/test_confidence.py
@@ -2157,8 +2157,9 @@ def test_the_fast_path_still_inlines_the_token_bucket_the_docstring_says_it_repe
assert "bucket_tokens(" not in body, (
"`_forward_unlocked` calls `bucket_tokens` directly now; then there is one policy rather "
"than two copies, and both the docstring and this check need re-reading")
- assert "_bucket_n(" in body, (
- "the row pad no longer comes from `laya.backends.base.bucket_rows` through `_bucket_n`")
+ assert "_bucket_n(" in body or "bucket_rows(" in body, (
+ "the row pad no longer comes from `laya.backends.base.bucket_rows`, through `_bucket_n` or "
+ "directly, so the docstring's attribution needs re-reading")
def test_the_two_bucket_policies_the_docstring_describes_are_still_the_same_numbers():