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.

Merge pull request #901 from RagingSilence/perf-geglu-stages

Nandakishor705071955ac7
diff --cc laya/tl_kernels.py
index 5121fbf8,8affc84a..59656d99
--- a/laya/tl_kernels.py
+++ b/laya/tl_kernels.py
@@@ -62,12 -56,9 +62,12 @@@ def gemm_kernel(N, K, bias=False, act="
@tilelang.jit(pass_configs=FAST)
- def gemm_geglu_kernel(F, K, bm=64, bn=64, bk=64, stages=3, threads=128, dtype="bfloat16", *, cpu=False):
-def gemm_geglu_kernel(F, K, bm=64, bn=64, bk=64, stages=2, threads=128, dtype="bfloat16"):
++def gemm_geglu_kernel(F, K, bm=64, bn=64, bk=64, stages=2, threads=128, dtype="bfloat16", *, cpu=False):
"""ModernBERT GLU MLP up-projection, fused: C[M,F] = gelu(A @ Wi[:F]^T) * (A @ Wi[F:]^T)."""
- DT = _dt(dtype)
+ DT = _dt(dtype, cpu)
+ alloc = T.alloc_local if cpu else T.alloc_fragment
+ shared = T.alloc_local if cpu else T.alloc_shared
+ loop = T.grid if cpu else T.Parallel
M = T.dynamic("M")
@T.prim_func