tileops 0.0.1.dev2__tar.gz → 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (543) hide show
  1. tileops-0.1.0/CONTRIBUTING.md +50 -0
  2. tileops-0.1.0/LICENSE +21 -0
  3. tileops-0.1.0/MANIFEST.in +19 -0
  4. tileops-0.1.0/PKG-INFO +195 -0
  5. tileops-0.1.0/README.md +165 -0
  6. tileops-0.1.0/THIRD_PARTY_NOTICES +28 -0
  7. tileops-0.1.0/pyproject.toml +203 -0
  8. tileops-0.1.0/src/tileops/__init__.py +113 -0
  9. tileops-0.1.0/src/tileops/_csrc.py +44 -0
  10. tileops-0.1.0/src/tileops/_kernels/__init__.py +241 -0
  11. tileops-0.1.0/src/tileops/_kernels/attention/__init__.py +148 -0
  12. tileops-0.1.0/src/tileops/_kernels/attention/call_spec.py +1071 -0
  13. tileops-0.1.0/src/tileops/_kernels/attention/dsa/__init__.py +23 -0
  14. tileops-0.1.0/src/tileops/_kernels/attention/dsa/decode.py +1117 -0
  15. tileops-0.1.0/src/tileops/_kernels/attention/dsa/decode_ws.py +519 -0
  16. tileops-0.1.0/src/tileops/_kernels/attention/dsa/paged.py +614 -0
  17. tileops-0.1.0/src/tileops/_kernels/attention/dsa/paged_mma.py +200 -0
  18. tileops-0.1.0/src/tileops/_kernels/attention/fp8_fa3_layouts.py +56 -0
  19. tileops-0.1.0/src/tileops/_kernels/attention/fp8_lightning_indexer.py +894 -0
  20. tileops-0.1.0/src/tileops/_kernels/attention/gqa/__init__.py +93 -0
  21. tileops-0.1.0/src/tileops/_kernels/attention/gqa/bwd.py +784 -0
  22. tileops-0.1.0/src/tileops/_kernels/attention/gqa/bwd_ws.py +874 -0
  23. tileops-0.1.0/src/tileops/_kernels/attention/gqa/decode.py +942 -0
  24. tileops-0.1.0/src/tileops/_kernels/attention/gqa/decode_bs1.py +653 -0
  25. tileops-0.1.0/src/tileops/_kernels/attention/gqa/decode_bs1_common.py +309 -0
  26. tileops-0.1.0/src/tileops/_kernels/attention/gqa/decode_fp8.py +401 -0
  27. tileops-0.1.0/src/tileops/_kernels/attention/gqa/decode_ws.py +358 -0
  28. tileops-0.1.0/src/tileops/_kernels/attention/gqa/dense.py +2971 -0
  29. tileops-0.1.0/src/tileops/_kernels/attention/gqa/dense_fp8.py +1172 -0
  30. tileops-0.1.0/src/tileops/_kernels/attention/gqa/dense_prefill.py +184 -0
  31. tileops-0.1.0/src/tileops/_kernels/attention/gqa/paged.py +1359 -0
  32. tileops-0.1.0/src/tileops/_kernels/attention/gqa/paged_decode.py +773 -0
  33. tileops-0.1.0/src/tileops/_kernels/attention/gqa/paged_decode_bs1.py +303 -0
  34. tileops-0.1.0/src/tileops/_kernels/attention/gqa/paged_fp8_decode.py +535 -0
  35. tileops-0.1.0/src/tileops/_kernels/attention/gqa/paged_fp8_ws.py +1269 -0
  36. tileops-0.1.0/src/tileops/_kernels/attention/gqa/paged_rope_prepare.py +181 -0
  37. tileops-0.1.0/src/tileops/_kernels/attention/gqa/paged_ws.py +1234 -0
  38. tileops-0.1.0/src/tileops/_kernels/attention/gqa/prefill_varlen.py +475 -0
  39. tileops-0.1.0/src/tileops/_kernels/attention/gqa/prefill_varlen_ws.py +810 -0
  40. tileops-0.1.0/src/tileops/_kernels/attention/gqa/sliding_window_varlen.py +402 -0
  41. tileops-0.1.0/src/tileops/_kernels/attention/gqa/varlen_fp8.py +1530 -0
  42. tileops-0.1.0/src/tileops/_kernels/attention/merge_states.py +173 -0
  43. tileops-0.1.0/src/tileops/_kernels/attention/mha/__init__.py +9 -0
  44. tileops-0.1.0/src/tileops/_kernels/attention/mha/decode_paged_ws.py +606 -0
  45. tileops-0.1.0/src/tileops/_kernels/attention/mla/__init__.py +33 -0
  46. tileops-0.1.0/src/tileops/_kernels/attention/mla/bwd.py +387 -0
  47. tileops-0.1.0/src/tileops/_kernels/attention/mla/bwd_ws.py +841 -0
  48. tileops-0.1.0/src/tileops/_kernels/attention/mla/decode.py +1175 -0
  49. tileops-0.1.0/src/tileops/_kernels/attention/mla/paged.py +401 -0
  50. tileops-0.1.0/src/tileops/_kernels/attention/mla/prefill_varlen.py +496 -0
  51. tileops-0.1.0/src/tileops/_kernels/attention/mla/prefill_varlen_ws.py +591 -0
  52. tileops-0.1.0/src/tileops/_kernels/attention/mla/seesaw.py +726 -0
  53. tileops-0.1.0/src/tileops/_kernels/attention/mla_cache_write.py +372 -0
  54. tileops-0.1.0/src/tileops/_kernels/attention/nsa/__init__.py +21 -0
  55. tileops-0.1.0/src/tileops/_kernels/attention/nsa/compressed_varlen.py +621 -0
  56. tileops-0.1.0/src/tileops/_kernels/attention/nsa/topk_varlen.py +705 -0
  57. tileops-0.1.0/src/tileops/_kernels/attention/nsa/varlen.py +468 -0
  58. tileops-0.1.0/src/tileops/_kernels/attention/online_softmax.py +274 -0
  59. tileops-0.1.0/src/tileops/_kernels/attention/paged_cache_gather.py +213 -0
  60. tileops-0.1.0/src/tileops/_kernels/attention/paged_cache_write.py +226 -0
  61. tileops-0.1.0/src/tileops/_kernels/attention/topk_select.py +525 -0
  62. tileops-0.1.0/src/tileops/_kernels/attention/varlen.py +185 -0
  63. tileops-0.1.0/src/tileops/_kernels/attention/varlen_rope.py +269 -0
  64. tileops-0.1.0/src/tileops/_kernels/autotune.py +352 -0
  65. tileops-0.1.0/src/tileops/_kernels/buffer_utils.py +47 -0
  66. tileops-0.1.0/src/tileops/_kernels/call_spec.py +152 -0
  67. tileops-0.1.0/src/tileops/_kernels/constants.py +101 -0
  68. tileops-0.1.0/src/tileops/_kernels/convolution/__init__.py +47 -0
  69. tileops-0.1.0/src/tileops/_kernels/convolution/_common.py +119 -0
  70. tileops-0.1.0/src/tileops/_kernels/convolution/call_spec.py +235 -0
  71. tileops-0.1.0/src/tileops/_kernels/convolution/conv1d.py +1140 -0
  72. tileops-0.1.0/src/tileops/_kernels/convolution/conv2d.py +1409 -0
  73. tileops-0.1.0/src/tileops/_kernels/convolution/conv3d.py +1131 -0
  74. tileops-0.1.0/src/tileops/_kernels/elementwise/__init__.py +213 -0
  75. tileops-0.1.0/src/tileops/_kernels/elementwise/_base.py +855 -0
  76. tileops-0.1.0/src/tileops/_kernels/elementwise/_broadcast.py +151 -0
  77. tileops-0.1.0/src/tileops/_kernels/elementwise/_builders.py +988 -0
  78. tileops-0.1.0/src/tileops/_kernels/elementwise/_division.py +96 -0
  79. tileops-0.1.0/src/tileops/_kernels/elementwise/_dtype.py +63 -0
  80. tileops-0.1.0/src/tileops/_kernels/elementwise/_erf.py +110 -0
  81. tileops-0.1.0/src/tileops/_kernels/elementwise/_nan.py +76 -0
  82. tileops-0.1.0/src/tileops/_kernels/elementwise/_op_body.py +76 -0
  83. tileops-0.1.0/src/tileops/_kernels/elementwise/_policy.py +189 -0
  84. tileops-0.1.0/src/tileops/_kernels/elementwise/activations.py +460 -0
  85. tileops-0.1.0/src/tileops/_kernels/elementwise/alibi.py +125 -0
  86. tileops-0.1.0/src/tileops/_kernels/elementwise/arithmetic.py +637 -0
  87. tileops-0.1.0/src/tileops/_kernels/elementwise/bitwise.py +106 -0
  88. tileops-0.1.0/src/tileops/_kernels/elementwise/call_spec.py +698 -0
  89. tileops-0.1.0/src/tileops/_kernels/elementwise/clamp.py +172 -0
  90. tileops-0.1.0/src/tileops/_kernels/elementwise/comparison.py +226 -0
  91. tileops-0.1.0/src/tileops/_kernels/elementwise/dropout.py +165 -0
  92. tileops-0.1.0/src/tileops/_kernels/elementwise/logical.py +89 -0
  93. tileops-0.1.0/src/tileops/_kernels/elementwise/masked_fill.py +181 -0
  94. tileops-0.1.0/src/tileops/_kernels/elementwise/math_unary.py +359 -0
  95. tileops-0.1.0/src/tileops/_kernels/elementwise/nan_to_num.py +81 -0
  96. tileops-0.1.0/src/tileops/_kernels/elementwise/prelu.py +85 -0
  97. tileops-0.1.0/src/tileops/_kernels/elementwise/sinusoidal.py +135 -0
  98. tileops-0.1.0/src/tileops/_kernels/elementwise/where.py +71 -0
  99. tileops-0.1.0/src/tileops/_kernels/fft.py +1904 -0
  100. tileops-0.1.0/src/tileops/_kernels/gemm/__init__.py +99 -0
  101. tileops-0.1.0/src/tileops/_kernels/gemm/bmm.py +1345 -0
  102. tileops-0.1.0/src/tileops/_kernels/gemm/call_spec.py +440 -0
  103. tileops-0.1.0/src/tileops/_kernels/gemm/dense.py +3943 -0
  104. tileops-0.1.0/src/tileops/_kernels/gemm/fp8_1d2d.py +1735 -0
  105. tileops-0.1.0/src/tileops/_kernels/gemm/fp8_swap_ab.py +168 -0
  106. tileops-0.1.0/src/tileops/_kernels/gemm/grouped/__init__.py +13 -0
  107. tileops-0.1.0/src/tileops/_kernels/gemm/grouped/call_spec.py +98 -0
  108. tileops-0.1.0/src/tileops/_kernels/gemm/grouped/general.py +325 -0
  109. tileops-0.1.0/src/tileops/_kernels/gemm/grouped/persistent.py +98 -0
  110. tileops-0.1.0/src/tileops/_kernels/gemm/heuristics.py +818 -0
  111. tileops-0.1.0/src/tileops/_kernels/gemm/int8_w8a8.py +1036 -0
  112. tileops-0.1.0/src/tileops/_kernels/gemm/persistent/__init__.py +16 -0
  113. tileops-0.1.0/src/tileops/_kernels/gemm/persistent/heuristics.py +863 -0
  114. tileops-0.1.0/src/tileops/_kernels/gemm/persistent/template.py +1415 -0
  115. tileops-0.1.0/src/tileops/_kernels/gemm/w4a16.py +1283 -0
  116. tileops-0.1.0/src/tileops/_kernels/gemm/w4a16_repack.py +131 -0
  117. tileops-0.1.0/src/tileops/_kernels/gemm/w4a8_decode.py +1091 -0
  118. tileops-0.1.0/src/tileops/_kernels/gemm/w4a8_prefill.py +991 -0
  119. tileops-0.1.0/src/tileops/_kernels/gemm/w4a8_repack.py +160 -0
  120. tileops-0.1.0/src/tileops/_kernels/grouped_tiling.py +191 -0
  121. tileops-0.1.0/src/tileops/_kernels/kernel_base.py +825 -0
  122. tileops-0.1.0/src/tileops/_kernels/linear_attention/__init__.py +95 -0
  123. tileops-0.1.0/src/tileops/_kernels/linear_attention/call_spec.py +541 -0
  124. tileops-0.1.0/src/tileops/_kernels/linear_attention/chunk_plan.py +68 -0
  125. tileops-0.1.0/src/tileops/_kernels/linear_attention/chunk_prefill.py +305 -0
  126. tileops-0.1.0/src/tileops/_kernels/linear_attention/delta_decode.py +244 -0
  127. tileops-0.1.0/src/tileops/_kernels/linear_attention/deltanet/__init__.py +21 -0
  128. tileops-0.1.0/src/tileops/_kernels/linear_attention/deltanet/autotune.py +356 -0
  129. tileops-0.1.0/src/tileops/_kernels/linear_attention/deltanet/chunk_bwd.py +558 -0
  130. tileops-0.1.0/src/tileops/_kernels/linear_attention/deltanet/chunk_fwd.py +692 -0
  131. tileops-0.1.0/src/tileops/_kernels/linear_attention/deltanet/chunk_prefill.py +43 -0
  132. tileops-0.1.0/src/tileops/_kernels/linear_attention/deltanet/compute_w_u_bwd.py +188 -0
  133. tileops-0.1.0/src/tileops/_kernels/linear_attention/deltanet/dense_decode.py +150 -0
  134. tileops-0.1.0/src/tileops/_kernels/linear_attention/deltanet/dense_prefill.py +437 -0
  135. tileops-0.1.0/src/tileops/_kernels/linear_attention/deltanet/fused_prepare_compute_w_u.py +205 -0
  136. tileops-0.1.0/src/tileops/_kernels/linear_attention/deltanet/partition_scan.py +139 -0
  137. tileops-0.1.0/src/tileops/_kernels/linear_attention/deltanet/prefill_forward.py +499 -0
  138. tileops-0.1.0/src/tileops/_kernels/linear_attention/deltanet/prefill_prepare.py +272 -0
  139. tileops-0.1.0/src/tileops/_kernels/linear_attention/deltanet/recurrent.py +751 -0
  140. tileops-0.1.0/src/tileops/_kernels/linear_attention/gdn/__init__.py +11 -0
  141. tileops-0.1.0/src/tileops/_kernels/linear_attention/gdn/chunk_prefill.py +37 -0
  142. tileops-0.1.0/src/tileops/_kernels/linear_attention/gdn/decode.py +171 -0
  143. tileops-0.1.0/src/tileops/_kernels/linear_attention/gdn/prefill.py +638 -0
  144. tileops-0.1.0/src/tileops/_kernels/linear_attention/gdn/prefill_common.py +175 -0
  145. tileops-0.1.0/src/tileops/_kernels/linear_attention/gdn/prefill_forward.py +716 -0
  146. tileops-0.1.0/src/tileops/_kernels/linear_attention/gdn/prefill_fused.py +667 -0
  147. tileops-0.1.0/src/tileops/_kernels/linear_attention/gdn/prefill_prepare.py +1677 -0
  148. tileops-0.1.0/src/tileops/_kernels/linear_attention/gla/__init__.py +22 -0
  149. tileops-0.1.0/src/tileops/_kernels/linear_attention/gla/call_spec.py +99 -0
  150. tileops-0.1.0/src/tileops/_kernels/linear_attention/gla/chunk_bwd.py +636 -0
  151. tileops-0.1.0/src/tileops/_kernels/linear_attention/gla/chunk_fwd.py +896 -0
  152. tileops-0.1.0/src/tileops/_kernels/linear_attention/gla/dense_decode.py +233 -0
  153. tileops-0.1.0/src/tileops/_kernels/linear_attention/gla/dense_prefill_partitioned.py +557 -0
  154. tileops-0.1.0/src/tileops/_kernels/linear_attention/gla/dense_prefill_subchunk.py +349 -0
  155. tileops-0.1.0/src/tileops/_kernels/linear_attention/gla/recurrent.py +494 -0
  156. tileops-0.1.0/src/tileops/_kernels/linear_attention/gla/varlen_prefill.py +657 -0
  157. tileops-0.1.0/src/tileops/_kernels/linear_attention/gla/varlen_prefill_partitioned.py +706 -0
  158. tileops-0.1.0/src/tileops/_kernels/linear_attention/kda/__init__.py +17 -0
  159. tileops-0.1.0/src/tileops/_kernels/linear_attention/kda/chunk_programs.py +1120 -0
  160. tileops-0.1.0/src/tileops/_kernels/linear_attention/kda/decode.py +161 -0
  161. tileops-0.1.0/src/tileops/_kernels/linear_attention/kda/decode_program.py +154 -0
  162. tileops-0.1.0/src/tileops/_kernels/linear_attention/kda/fused_program.py +627 -0
  163. tileops-0.1.0/src/tileops/_kernels/linear_attention/kda/gate.py +85 -0
  164. tileops-0.1.0/src/tileops/_kernels/linear_attention/kda/inverse.py +93 -0
  165. tileops-0.1.0/src/tileops/_kernels/linear_attention/kda/prefill.py +157 -0
  166. tileops-0.1.0/src/tileops/_kernels/linear_attention/kda/prefill_fused.py +176 -0
  167. tileops-0.1.0/src/tileops/_kernels/linear_attention/kda/prepare_split.py +1215 -0
  168. tileops-0.1.0/src/tileops/_kernels/linear_attention/v_tile.py +43 -0
  169. tileops-0.1.0/src/tileops/_kernels/mamba/__init__.py +59 -0
  170. tileops-0.1.0/src/tileops/_kernels/mamba/call_spec.py +443 -0
  171. tileops-0.1.0/src/tileops/_kernels/mamba/causal_conv1d.py +536 -0
  172. tileops-0.1.0/src/tileops/_kernels/mamba/selective_scan.py +629 -0
  173. tileops-0.1.0/src/tileops/_kernels/mamba/ssd_chunk_coupling.py +241 -0
  174. tileops-0.1.0/src/tileops/_kernels/mamba/ssd_chunk_cumsum.py +303 -0
  175. tileops-0.1.0/src/tileops/_kernels/mamba/ssd_chunk_scan.py +611 -0
  176. tileops-0.1.0/src/tileops/_kernels/mamba/ssd_chunk_state.py +350 -0
  177. tileops-0.1.0/src/tileops/_kernels/mamba/ssd_recurrent.py +287 -0
  178. tileops-0.1.0/src/tileops/_kernels/mamba/ssd_state_passing.py +396 -0
  179. tileops-0.1.0/src/tileops/_kernels/moe/__init__.py +72 -0
  180. tileops-0.1.0/src/tileops/_kernels/moe/call_spec.py +534 -0
  181. tileops-0.1.0/src/tileops/_kernels/moe/fused_topk.py +660 -0
  182. tileops-0.1.0/src/tileops/_kernels/moe/indexed_expert_gemm.py +566 -0
  183. tileops-0.1.0/src/tileops/_kernels/moe/moe_grouped_gemm.py +436 -0
  184. tileops-0.1.0/src/tileops/_kernels/moe/moe_grouped_gemm_fp8.py +860 -0
  185. tileops-0.1.0/src/tileops/_kernels/moe/moe_grouped_gemm_fp8_mma.py +110 -0
  186. tileops-0.1.0/src/tileops/_kernels/moe/permute_align.py +475 -0
  187. tileops-0.1.0/src/tileops/_kernels/moe/permute_contiguous.py +461 -0
  188. tileops-0.1.0/src/tileops/_kernels/moe/shared_expert_mlp.py +335 -0
  189. tileops-0.1.0/src/tileops/_kernels/moe/unpermute.py +244 -0
  190. tileops-0.1.0/src/tileops/_kernels/norm/__init__.py +66 -0
  191. tileops-0.1.0/src/tileops/_kernels/norm/_config.py +351 -0
  192. tileops-0.1.0/src/tileops/_kernels/norm/ada_layer_norm.py +318 -0
  193. tileops-0.1.0/src/tileops/_kernels/norm/batch_norm.py +2257 -0
  194. tileops-0.1.0/src/tileops/_kernels/norm/call_spec.py +518 -0
  195. tileops-0.1.0/src/tileops/_kernels/norm/fused_add_norm.py +872 -0
  196. tileops-0.1.0/src/tileops/_kernels/norm/fused_add_rms_norm_quant.py +663 -0
  197. tileops-0.1.0/src/tileops/_kernels/norm/fused_qk_norm_rope.py +281 -0
  198. tileops-0.1.0/src/tileops/_kernels/norm/group_norm.py +685 -0
  199. tileops-0.1.0/src/tileops/_kernels/norm/group_norm_split.py +327 -0
  200. tileops-0.1.0/src/tileops/_kernels/norm/instance_norm.py +619 -0
  201. tileops-0.1.0/src/tileops/_kernels/norm/layer_norm.py +299 -0
  202. tileops-0.1.0/src/tileops/_kernels/norm/layer_norm_warp_row.py +205 -0
  203. tileops-0.1.0/src/tileops/_kernels/norm/rms_norm.py +601 -0
  204. tileops-0.1.0/src/tileops/_kernels/norm/rms_norm_on_chip.py +262 -0
  205. tileops-0.1.0/src/tileops/_kernels/norm/rms_norm_streaming.py +152 -0
  206. tileops-0.1.0/src/tileops/_kernels/pool/__init__.py +76 -0
  207. tileops-0.1.0/src/tileops/_kernels/pool/adaptive_avg_pool2d.py +82 -0
  208. tileops-0.1.0/src/tileops/_kernels/pool/adaptive_max_pool2d.py +387 -0
  209. tileops-0.1.0/src/tileops/_kernels/pool/avg_pool1d.py +290 -0
  210. tileops-0.1.0/src/tileops/_kernels/pool/avg_pool1d_register.py +167 -0
  211. tileops-0.1.0/src/tileops/_kernels/pool/avg_pool2d.py +160 -0
  212. tileops-0.1.0/src/tileops/_kernels/pool/avg_pool2d_register.py +208 -0
  213. tileops-0.1.0/src/tileops/_kernels/pool/avg_pool3d.py +388 -0
  214. tileops-0.1.0/src/tileops/_kernels/pool/call_spec.py +452 -0
  215. tileops-0.1.0/src/tileops/_kernels/pool/common.py +291 -0
  216. tileops-0.1.0/src/tileops/_kernels/pool/max_pool1d.py +733 -0
  217. tileops-0.1.0/src/tileops/_kernels/pool/max_pool2d.py +416 -0
  218. tileops-0.1.0/src/tileops/_kernels/pool/max_pool2d_register.py +321 -0
  219. tileops-0.1.0/src/tileops/_kernels/pool/max_pool3d.py +411 -0
  220. tileops-0.1.0/src/tileops/_kernels/pool/mean_pooling.py +316 -0
  221. tileops-0.1.0/src/tileops/_kernels/quantization/__init__.py +75 -0
  222. tileops-0.1.0/src/tileops/_kernels/quantization/call_spec.py +217 -0
  223. tileops-0.1.0/src/tileops/_kernels/quantization/fp8_quant.py +215 -0
  224. tileops-0.1.0/src/tileops/_kernels/quantization/fp8_quant_per_block.py +292 -0
  225. tileops-0.1.0/src/tileops/_kernels/quantization/int4_quant_per_group.py +282 -0
  226. tileops-0.1.0/src/tileops/_kernels/quantization/int8_codes.py +52 -0
  227. tileops-0.1.0/src/tileops/_kernels/quantization/int8_dequant.py +674 -0
  228. tileops-0.1.0/src/tileops/_kernels/quantization/int8_quant_per_block.py +448 -0
  229. tileops-0.1.0/src/tileops/_kernels/quantization/int8_quant_per_channel.py +616 -0
  230. tileops-0.1.0/src/tileops/_kernels/quantization/int8_quant_per_tensor.py +383 -0
  231. tileops-0.1.0/src/tileops/_kernels/reduction/__init__.py +79 -0
  232. tileops-0.1.0/src/tileops/_kernels/reduction/_primitives.py +1229 -0
  233. tileops-0.1.0/src/tileops/_kernels/reduction/_split_softmax.py +233 -0
  234. tileops-0.1.0/src/tileops/_kernels/reduction/argreduce.py +796 -0
  235. tileops-0.1.0/src/tileops/_kernels/reduction/call_spec.py +399 -0
  236. tileops-0.1.0/src/tileops/_kernels/reduction/cumulative.py +741 -0
  237. tileops-0.1.0/src/tileops/_kernels/reduction/logical_reduce.py +710 -0
  238. tileops-0.1.0/src/tileops/_kernels/reduction/logsumexp.py +688 -0
  239. tileops-0.1.0/src/tileops/_kernels/reduction/reduce.py +1181 -0
  240. tileops-0.1.0/src/tileops/_kernels/reduction/softmax.py +808 -0
  241. tileops-0.1.0/src/tileops/_kernels/reduction/softmax_on_chip.py +555 -0
  242. tileops-0.1.0/src/tileops/_kernels/reduction/softmax_warp_rows.py +164 -0
  243. tileops-0.1.0/src/tileops/_kernels/reduction/vector_norm.py +313 -0
  244. tileops-0.1.0/src/tileops/_kernels/rope.py +866 -0
  245. tileops-0.1.0/src/tileops/_kernels/sampling/__init__.py +35 -0
  246. tileops-0.1.0/src/tileops/_kernels/sampling/call_spec.py +164 -0
  247. tileops-0.1.0/src/tileops/_kernels/sampling/chain_speculative_sampling.py +518 -0
  248. tileops-0.1.0/src/tileops/_kernels/sampling/min_p_mask.py +261 -0
  249. tileops-0.1.0/src/tileops/_kernels/sampling/philox.py +43 -0
  250. tileops-0.1.0/src/tileops/_kernels/sampling/radix_select.py +127 -0
  251. tileops-0.1.0/src/tileops/_kernels/sampling/row_tiles.py +113 -0
  252. tileops-0.1.0/src/tileops/_kernels/sampling/sampling_from_probs.py +393 -0
  253. tileops-0.1.0/src/tileops/_kernels/sampling/top_k_mask.py +435 -0
  254. tileops-0.1.0/src/tileops/_kernels/sampling/top_k_top_p_mask.py +687 -0
  255. tileops-0.1.0/src/tileops/_kernels/sampling/top_p_mask.py +439 -0
  256. tileops-0.1.0/src/tileops/_kernels/sequence_modeling/__init__.py +35 -0
  257. tileops-0.1.0/src/tileops/_kernels/sequence_modeling/engram/__init__.py +21 -0
  258. tileops-0.1.0/src/tileops/_kernels/sequence_modeling/engram/call_spec.py +168 -0
  259. tileops-0.1.0/src/tileops/_kernels/sequence_modeling/engram/decode.py +436 -0
  260. tileops-0.1.0/src/tileops/_kernels/sequence_modeling/engram/gate_conv_bwd.py +481 -0
  261. tileops-0.1.0/src/tileops/_kernels/sequence_modeling/engram/gate_conv_fwd.py +276 -0
  262. tileops-0.1.0/src/tileops/_kernels/sequence_modeling/mhc/__init__.py +17 -0
  263. tileops-0.1.0/src/tileops/_kernels/sequence_modeling/mhc/call_spec.py +102 -0
  264. tileops-0.1.0/src/tileops/_kernels/sequence_modeling/mhc/post.py +107 -0
  265. tileops-0.1.0/src/tileops/_kernels/sequence_modeling/mhc/pre.py +280 -0
  266. tileops-0.1.0/src/tileops/_kernels/streaming_load.py +13 -0
  267. tileops-0.1.0/src/tileops/_kernels/tiling.py +27 -0
  268. tileops-0.1.0/src/tileops/_kernels/transform/__init__.py +25 -0
  269. tileops-0.1.0/src/tileops/_kernels/transform/call_spec.py +160 -0
  270. tileops-0.1.0/src/tileops/_kernels/transform/hadamard_register.py +723 -0
  271. tileops-0.1.0/src/tileops/_kernels/transform/hadamard_shared.py +423 -0
  272. tileops-0.1.0/src/tileops/_ops/__init__.py +1 -0
  273. tileops-0.1.0/src/tileops/_ops/_naming.py +81 -0
  274. tileops-0.1.0/src/tileops/_ops/_params_codegen.py +31 -0
  275. tileops-0.1.0/src/tileops/_ops/_signature_codegen.py +1973 -0
  276. tileops-0.1.0/src/tileops/_ops/attention/__init__.py +49 -0
  277. tileops-0.1.0/src/tileops/_ops/attention/dsa.py +217 -0
  278. tileops-0.1.0/src/tileops/_ops/attention/fp8_lightning_indexer.py +116 -0
  279. tileops-0.1.0/src/tileops/_ops/attention/gqa/__init__.py +12 -0
  280. tileops-0.1.0/src/tileops/_ops/attention/gqa/bwd.py +144 -0
  281. tileops-0.1.0/src/tileops/_ops/attention/gqa/dense.py +323 -0
  282. tileops-0.1.0/src/tileops/_ops/attention/gqa/paged.py +239 -0
  283. tileops-0.1.0/src/tileops/_ops/attention/gqa/parameters.py +24 -0
  284. tileops-0.1.0/src/tileops/_ops/attention/gqa/varlen.py +203 -0
  285. tileops-0.1.0/src/tileops/_ops/attention/merge_states.py +68 -0
  286. tileops-0.1.0/src/tileops/_ops/attention/mha.py +119 -0
  287. tileops-0.1.0/src/tileops/_ops/attention/mla.py +484 -0
  288. tileops-0.1.0/src/tileops/_ops/attention/mla_cache_write.py +123 -0
  289. tileops-0.1.0/src/tileops/_ops/attention/nsa.py +331 -0
  290. tileops-0.1.0/src/tileops/_ops/attention/paged_cache_gather.py +111 -0
  291. tileops-0.1.0/src/tileops/_ops/attention/paged_cache_write.py +103 -0
  292. tileops-0.1.0/src/tileops/_ops/attention/topk_select.py +92 -0
  293. tileops-0.1.0/src/tileops/_ops/compile_boundary.py +50 -0
  294. tileops-0.1.0/src/tileops/_ops/convolution.py +367 -0
  295. tileops-0.1.0/src/tileops/_ops/elementwise/__init__.py +163 -0
  296. tileops-0.1.0/src/tileops/_ops/elementwise/_base.py +229 -0
  297. tileops-0.1.0/src/tileops/_ops/elementwise/activations.py +314 -0
  298. tileops-0.1.0/src/tileops/_ops/elementwise/alibi.py +76 -0
  299. tileops-0.1.0/src/tileops/_ops/elementwise/arithmetic.py +326 -0
  300. tileops-0.1.0/src/tileops/_ops/elementwise/bitwise.py +45 -0
  301. tileops-0.1.0/src/tileops/_ops/elementwise/clamp.py +120 -0
  302. tileops-0.1.0/src/tileops/_ops/elementwise/comparison.py +122 -0
  303. tileops-0.1.0/src/tileops/_ops/elementwise/dropout.py +110 -0
  304. tileops-0.1.0/src/tileops/_ops/elementwise/logical.py +54 -0
  305. tileops-0.1.0/src/tileops/_ops/elementwise/masked_fill.py +131 -0
  306. tileops-0.1.0/src/tileops/_ops/elementwise/math_unary.py +189 -0
  307. tileops-0.1.0/src/tileops/_ops/elementwise/nan_to_num.py +55 -0
  308. tileops-0.1.0/src/tileops/_ops/elementwise/prelu.py +64 -0
  309. tileops-0.1.0/src/tileops/_ops/elementwise/sinusoidal.py +77 -0
  310. tileops-0.1.0/src/tileops/_ops/elementwise/where.py +65 -0
  311. tileops-0.1.0/src/tileops/_ops/fft.py +72 -0
  312. tileops-0.1.0/src/tileops/_ops/gemm/__init__.py +20 -0
  313. tileops-0.1.0/src/tileops/_ops/gemm/bmm.py +233 -0
  314. tileops-0.1.0/src/tileops/_ops/gemm/gemm.py +575 -0
  315. tileops-0.1.0/src/tileops/_ops/gemm/grouped_gemm.py +123 -0
  316. tileops-0.1.0/src/tileops/_ops/linear_attention/__init__.py +24 -0
  317. tileops-0.1.0/src/tileops/_ops/linear_attention/deltanet/__init__.py +19 -0
  318. tileops-0.1.0/src/tileops/_ops/linear_attention/deltanet/chunk.py +180 -0
  319. tileops-0.1.0/src/tileops/_ops/linear_attention/deltanet/fwd.py +129 -0
  320. tileops-0.1.0/src/tileops/_ops/linear_attention/deltanet/recurrent.py +88 -0
  321. tileops-0.1.0/src/tileops/_ops/linear_attention/gdn.py +187 -0
  322. tileops-0.1.0/src/tileops/_ops/linear_attention/gla/__init__.py +19 -0
  323. tileops-0.1.0/src/tileops/_ops/linear_attention/gla/chunk.py +193 -0
  324. tileops-0.1.0/src/tileops/_ops/linear_attention/gla/fwd.py +122 -0
  325. tileops-0.1.0/src/tileops/_ops/linear_attention/gla/recurrent.py +88 -0
  326. tileops-0.1.0/src/tileops/_ops/linear_attention/kda.py +197 -0
  327. tileops-0.1.0/src/tileops/_ops/mamba/__init__.py +22 -0
  328. tileops-0.1.0/src/tileops/_ops/mamba/causal_conv1d.py +183 -0
  329. tileops-0.1.0/src/tileops/_ops/mamba/mamba2_fwd.py +153 -0
  330. tileops-0.1.0/src/tileops/_ops/mamba/selective_scan.py +128 -0
  331. tileops-0.1.0/src/tileops/_ops/mamba/ssd_chunk_coupling.py +81 -0
  332. tileops-0.1.0/src/tileops/_ops/mamba/ssd_chunk_cumsum.py +98 -0
  333. tileops-0.1.0/src/tileops/_ops/mamba/ssd_chunk_scan.py +99 -0
  334. tileops-0.1.0/src/tileops/_ops/mamba/ssd_chunk_state.py +109 -0
  335. tileops-0.1.0/src/tileops/_ops/mamba/ssd_recurrent.py +92 -0
  336. tileops-0.1.0/src/tileops/_ops/mamba/ssd_state_passing.py +88 -0
  337. tileops-0.1.0/src/tileops/_ops/moe/__init__.py +51 -0
  338. tileops-0.1.0/src/tileops/_ops/moe/abc.py +185 -0
  339. tileops-0.1.0/src/tileops/_ops/moe/contracts.py +137 -0
  340. tileops-0.1.0/src/tileops/_ops/moe/fused_moe.py +234 -0
  341. tileops-0.1.0/src/tileops/_ops/moe/fused_moe_shared_expert.py +165 -0
  342. tileops-0.1.0/src/tileops/_ops/moe/fused_topk.py +125 -0
  343. tileops-0.1.0/src/tileops/_ops/moe/moe_grouped_gemm_fp8.py +132 -0
  344. tileops-0.1.0/src/tileops/_ops/moe/permute_align.py +89 -0
  345. tileops-0.1.0/src/tileops/_ops/moe/prepare_finalize/__init__.py +5 -0
  346. tileops-0.1.0/src/tileops/_ops/moe/prepare_finalize/no_dp_ep.py +47 -0
  347. tileops-0.1.0/src/tileops/_ops/moe/routed_expert/__init__.py +9 -0
  348. tileops-0.1.0/src/tileops/_ops/moe/routed_expert/fused_routed_expert.py +161 -0
  349. tileops-0.1.0/src/tileops/_ops/moe/routed_expert/indexed_routed_expert.py +135 -0
  350. tileops-0.1.0/src/tileops/_ops/moe/shared_expert_mlp.py +75 -0
  351. tileops-0.1.0/src/tileops/_ops/moe/staged.py +434 -0
  352. tileops-0.1.0/src/tileops/_ops/norm/__init__.py +26 -0
  353. tileops-0.1.0/src/tileops/_ops/norm/ada_layer_norm.py +80 -0
  354. tileops-0.1.0/src/tileops/_ops/norm/ada_layer_norm_zero.py +85 -0
  355. tileops-0.1.0/src/tileops/_ops/norm/affine.py +21 -0
  356. tileops-0.1.0/src/tileops/_ops/norm/batch_norm.py +279 -0
  357. tileops-0.1.0/src/tileops/_ops/norm/fused_add_layer_norm.py +96 -0
  358. tileops-0.1.0/src/tileops/_ops/norm/fused_add_rms_norm.py +91 -0
  359. tileops-0.1.0/src/tileops/_ops/norm/fused_add_rms_norm_per_token_quant.py +130 -0
  360. tileops-0.1.0/src/tileops/_ops/norm/fused_qk_norm_rope.py +121 -0
  361. tileops-0.1.0/src/tileops/_ops/norm/group_norm.py +110 -0
  362. tileops-0.1.0/src/tileops/_ops/norm/instance_norm.py +173 -0
  363. tileops-0.1.0/src/tileops/_ops/norm/layer_norm.py +84 -0
  364. tileops-0.1.0/src/tileops/_ops/norm/rms_norm.py +93 -0
  365. tileops-0.1.0/src/tileops/_ops/op_base.py +1725 -0
  366. tileops-0.1.0/src/tileops/_ops/pool/__init__.py +31 -0
  367. tileops-0.1.0/src/tileops/_ops/pool/adaptive_pool.py +161 -0
  368. tileops-0.1.0/src/tileops/_ops/pool/avg_pool.py +182 -0
  369. tileops-0.1.0/src/tileops/_ops/pool/max_pool.py +373 -0
  370. tileops-0.1.0/src/tileops/_ops/pool/mean_pooling.py +147 -0
  371. tileops-0.1.0/src/tileops/_ops/pool/parameters.py +6 -0
  372. tileops-0.1.0/src/tileops/_ops/quantization/__init__.py +27 -0
  373. tileops-0.1.0/src/tileops/_ops/quantization/fp8_quant.py +70 -0
  374. tileops-0.1.0/src/tileops/_ops/quantization/fp8_quant_per_block.py +74 -0
  375. tileops-0.1.0/src/tileops/_ops/quantization/int4_quant_per_group.py +79 -0
  376. tileops-0.1.0/src/tileops/_ops/quantization/int8_dequant.py +188 -0
  377. tileops-0.1.0/src/tileops/_ops/quantization/int8_quant_per_block.py +77 -0
  378. tileops-0.1.0/src/tileops/_ops/quantization/int8_quant_per_channel.py +72 -0
  379. tileops-0.1.0/src/tileops/_ops/quantization/int8_quant_per_tensor.py +69 -0
  380. tileops-0.1.0/src/tileops/_ops/quantization/smooth_quant.py +73 -0
  381. tileops-0.1.0/src/tileops/_ops/reduction/__init__.py +46 -0
  382. tileops-0.1.0/src/tileops/_ops/reduction/argreduce.py +75 -0
  383. tileops-0.1.0/src/tileops/_ops/reduction/cumulative.py +137 -0
  384. tileops-0.1.0/src/tileops/_ops/reduction/logical_reduce.py +111 -0
  385. tileops-0.1.0/src/tileops/_ops/reduction/reduce.py +370 -0
  386. tileops-0.1.0/src/tileops/_ops/reduction/softmax.py +185 -0
  387. tileops-0.1.0/src/tileops/_ops/reduction/vector_norm.py +79 -0
  388. tileops-0.1.0/src/tileops/_ops/rope.py +729 -0
  389. tileops-0.1.0/src/tileops/_ops/sampling/__init__.py +15 -0
  390. tileops-0.1.0/src/tileops/_ops/sampling/chain_speculative_sampling.py +100 -0
  391. tileops-0.1.0/src/tileops/_ops/sampling/min_p_mask.py +66 -0
  392. tileops-0.1.0/src/tileops/_ops/sampling/sampling_from_probs.py +75 -0
  393. tileops-0.1.0/src/tileops/_ops/sampling/top_k_mask.py +68 -0
  394. tileops-0.1.0/src/tileops/_ops/sampling/top_k_top_p_mask.py +77 -0
  395. tileops-0.1.0/src/tileops/_ops/sampling/top_p_mask.py +67 -0
  396. tileops-0.1.0/src/tileops/_ops/sequence_modeling/__init__.py +11 -0
  397. tileops-0.1.0/src/tileops/_ops/sequence_modeling/engram.py +188 -0
  398. tileops-0.1.0/src/tileops/_ops/sequence_modeling/engram_decode.py +103 -0
  399. tileops-0.1.0/src/tileops/_ops/sequence_modeling/mhc.py +158 -0
  400. tileops-0.1.0/src/tileops/_ops/transform/__init__.py +5 -0
  401. tileops-0.1.0/src/tileops/_ops/transform/hadamard_transform.py +96 -0
  402. tileops-0.1.0/src/tileops/_perf/__init__.py +17 -0
  403. tileops-0.1.0/src/tileops/_perf/formulas.py +1071 -0
  404. tileops-0.1.0/src/tileops/_perf/profile.py +162 -0
  405. tileops-0.1.0/src/tileops/_perf/profiles/__init__.py +1 -0
  406. tileops-0.1.0/src/tileops/_perf/profiles/h200.yaml +59 -0
  407. tileops-0.1.0/src/tileops/_utils/__init__.py +25 -0
  408. tileops-0.1.0/src/tileops/_utils/device.py +53 -0
  409. tileops-0.1.0/src/tileops/_utils/utils.py +122 -0
  410. tileops-0.1.0/src/tileops/attention.py +51 -0
  411. tileops-0.1.0/src/tileops/authoring/__init__.py +15 -0
  412. tileops-0.1.0/src/tileops/backend/__init__.py +106 -0
  413. tileops-0.1.0/src/tileops/backend/_dispatch.py +208 -0
  414. tileops-0.1.0/src/tileops/backend/_errors.py +21 -0
  415. tileops-0.1.0/src/tileops/backend/_protocol.py +78 -0
  416. tileops-0.1.0/src/tileops/backend/_registry.py +276 -0
  417. tileops-0.1.0/src/tileops/convolution.py +9 -0
  418. tileops-0.1.0/src/tileops/csrc/approx_math.h +21 -0
  419. tileops-0.1.0/src/tileops/csrc/bulk_prefetch.h +17 -0
  420. tileops-0.1.0/src/tileops/csrc/bulk_zero.h +35 -0
  421. tileops-0.1.0/src/tileops/csrc/cluster_partials.h +46 -0
  422. tileops-0.1.0/src/tileops/csrc/dense_wgmma_helper.h +191 -0
  423. tileops-0.1.0/src/tileops/csrc/dq_landing.h +45 -0
  424. tileops-0.1.0/src/tileops/csrc/fp8_1d2d_helper.h +321 -0
  425. tileops-0.1.0/src/tileops/csrc/fp8_gqa_helper.h +765 -0
  426. tileops-0.1.0/src/tileops/csrc/fp8_paged_helper.h +82 -0
  427. tileops-0.1.0/src/tileops/csrc/gdn_inverse_helper.h +467 -0
  428. tileops-0.1.0/src/tileops/csrc/gdn_scan_helper.h +211 -0
  429. tileops-0.1.0/src/tileops/csrc/kda_prefill_helper.h +10 -0
  430. tileops-0.1.0/src/tileops/csrc/lightning_indexer_helper.h +131 -0
  431. tileops-0.1.0/src/tileops/csrc/mla_bwd_wgmma.h +150 -0
  432. tileops-0.1.0/src/tileops/csrc/moe_grouped_gemm_fp8_helper.h +190 -0
  433. tileops-0.1.0/src/tileops/csrc/row_gather.h +81 -0
  434. tileops-0.1.0/src/tileops/csrc/streaming_load.h +117 -0
  435. tileops-0.1.0/src/tileops/csrc/tile_claim.h +22 -0
  436. tileops-0.1.0/src/tileops/csrc/top_k_mask_helper.h +30 -0
  437. tileops-0.1.0/src/tileops/csrc/trace_helper.h +18 -0
  438. tileops-0.1.0/src/tileops/csrc/value_wait_anchor.h +24 -0
  439. tileops-0.1.0/src/tileops/csrc/w4a16_decode_helper.h +75 -0
  440. tileops-0.1.0/src/tileops/csrc/w4a8_decode_helper.h +381 -0
  441. tileops-0.1.0/src/tileops/csrc/w4a8_prefill_helper.h +344 -0
  442. tileops-0.1.0/src/tileops/csrc/warp_uniform.h +36 -0
  443. tileops-0.1.0/src/tileops/csrc/wgmma_rows.h +92 -0
  444. tileops-0.1.0/src/tileops/elementwise.py +145 -0
  445. tileops-0.1.0/src/tileops/fft.py +7 -0
  446. tileops-0.1.0/src/tileops/gemm.py +23 -0
  447. tileops-0.1.0/src/tileops/linear_attention.py +27 -0
  448. tileops-0.1.0/src/tileops/mamba.py +27 -0
  449. tileops-0.1.0/src/tileops/manifest/__init__.py +208 -0
  450. tileops-0.1.0/src/tileops/manifest/_dtype_rules.py +37 -0
  451. tileops-0.1.0/src/tileops/manifest/_expr.py +709 -0
  452. tileops-0.1.0/src/tileops/manifest/_kinds.py +389 -0
  453. tileops-0.1.0/src/tileops/manifest/_plan.py +911 -0
  454. tileops-0.1.0/src/tileops/manifest/_registry.py +17 -0
  455. tileops-0.1.0/src/tileops/manifest/_signature.py +783 -0
  456. tileops-0.1.0/src/tileops/manifest/_values.py +166 -0
  457. tileops-0.1.0/src/tileops/manifest/_workload.py +732 -0
  458. tileops-0.1.0/src/tileops/manifest/primitives.py +778 -0
  459. tileops-0.1.0/src/tileops/manifest/spec/attention.yaml +920 -0
  460. tileops-0.1.0/src/tileops/manifest/spec/attention_indexing.yaml +73 -0
  461. tileops-0.1.0/src/tileops/manifest/spec/convolution.yaml +178 -0
  462. tileops-0.1.0/src/tileops/manifest/spec/elementwise_binary.yaml +622 -0
  463. tileops-0.1.0/src/tileops/manifest/spec/elementwise_fused_gated.yaml +59 -0
  464. tileops-0.1.0/src/tileops/manifest/spec/elementwise_generative.yaml +68 -0
  465. tileops-0.1.0/src/tileops/manifest/spec/elementwise_multi_input.yaml +55 -0
  466. tileops-0.1.0/src/tileops/manifest/spec/elementwise_unary_activation.yaml +377 -0
  467. tileops-0.1.0/src/tileops/manifest/spec/elementwise_unary_math.yaml +512 -0
  468. tileops-0.1.0/src/tileops/manifest/spec/fft.yaml +42 -0
  469. tileops-0.1.0/src/tileops/manifest/spec/gemm.yaml +454 -0
  470. tileops-0.1.0/src/tileops/manifest/spec/gemm_bmm.yaml +77 -0
  471. tileops-0.1.0/src/tileops/manifest/spec/linear_attention.yaml +696 -0
  472. tileops-0.1.0/src/tileops/manifest/spec/mamba.yaml +389 -0
  473. tileops-0.1.0/src/tileops/manifest/spec/moe.yaml +659 -0
  474. tileops-0.1.0/src/tileops/manifest/spec/norm.yaml +385 -0
  475. tileops-0.1.0/src/tileops/manifest/spec/pool.yaml +553 -0
  476. tileops-0.1.0/src/tileops/manifest/spec/quantization.yaml +260 -0
  477. tileops-0.1.0/src/tileops/manifest/spec/reduction.yaml +447 -0
  478. tileops-0.1.0/src/tileops/manifest/spec/reduction_scan.yaml +59 -0
  479. tileops-0.1.0/src/tileops/manifest/spec/rope.yaml +197 -0
  480. tileops-0.1.0/src/tileops/manifest/spec/sampling.yaml +193 -0
  481. tileops-0.1.0/src/tileops/manifest/spec/sequence_modeling.yaml +181 -0
  482. tileops-0.1.0/src/tileops/manifest/spec/transform.yaml +38 -0
  483. tileops-0.1.0/src/tileops/manifest/spec/types.yaml +15 -0
  484. tileops-0.1.0/src/tileops/moe.py +38 -0
  485. tileops-0.1.0/src/tileops/norm.py +31 -0
  486. tileops-0.1.0/src/tileops/pool.py +33 -0
  487. tileops-0.1.0/src/tileops/quantization.py +27 -0
  488. tileops-0.1.0/src/tileops/reduction.py +45 -0
  489. tileops-0.1.0/src/tileops/rope.py +17 -0
  490. tileops-0.1.0/src/tileops/sampling.py +19 -0
  491. tileops-0.1.0/src/tileops/sequence_modeling.py +17 -0
  492. tileops-0.1.0/src/tileops/trace/__init__.py +33 -0
  493. tileops-0.1.0/src/tileops/trace/_api.py +472 -0
  494. tileops-0.1.0/src/tileops/trace/_decode.py +285 -0
  495. tileops-0.1.0/src/tileops/trace/_markers.py +113 -0
  496. tileops-0.1.0/src/tileops/trace/_passes.py +346 -0
  497. tileops-0.1.0/src/tileops/trace/_record.py +136 -0
  498. tileops-0.1.0/src/tileops/trace/_state.py +198 -0
  499. tileops-0.1.0/src/tileops/trace/_ui.py +441 -0
  500. tileops-0.1.0/src/tileops/transform.py +11 -0
  501. tileops-0.1.0/src/tileops.egg-info/PKG-INFO +195 -0
  502. tileops-0.1.0/src/tileops.egg-info/SOURCES.txt +507 -0
  503. tileops-0.1.0/src/tileops.egg-info/requires.txt +3 -0
  504. tileops-0.1.0/src/tileops.egg-info/scm_file_list.json +928 -0
  505. tileops-0.1.0/src/tileops.egg-info/scm_version.json +8 -0
  506. tileops-0.1.0/src/tileops.egg-info/top_level.txt +1 -0
  507. tileops-0.0.1.dev2/LICENSE +0 -21
  508. tileops-0.0.1.dev2/PKG-INFO +0 -147
  509. tileops-0.0.1.dev2/README.md +0 -119
  510. tileops-0.0.1.dev2/pyproject.toml +0 -84
  511. tileops-0.0.1.dev2/setup.py +0 -44
  512. tileops-0.0.1.dev2/tests/test_bitnet.py +0 -34
  513. tileops-0.0.1.dev2/tests/test_blocksparse_attention.py +0 -62
  514. tileops-0.0.1.dev2/tests/test_gqa.py +0 -57
  515. tileops-0.0.1.dev2/tests/test_gqa_decode.py +0 -42
  516. tileops-0.0.1.dev2/tests/test_linear_attn_fused_chunk.py +0 -20
  517. tileops-0.0.1.dev2/tests/test_linear_attn_fused_recurrent.py +0 -20
  518. tileops-0.0.1.dev2/tests/test_mamba_chunk_scan.py +0 -68
  519. tileops-0.0.1.dev2/tests/test_mamba_chunk_state.py +0 -61
  520. tileops-0.0.1.dev2/tests/test_mha.py +0 -22
  521. tileops-0.0.1.dev2/tests/test_mha_decode.py +0 -21
  522. tileops-0.0.1.dev2/tests/test_mla.py +0 -36
  523. tileops-0.0.1.dev2/tests/test_sparse_mla.py +0 -57
  524. tileops-0.0.1.dev2/tileops.egg-info/PKG-INFO +0 -147
  525. tileops-0.0.1.dev2/tileops.egg-info/SOURCES.txt +0 -35
  526. tileops-0.0.1.dev2/tileops.egg-info/requires.txt +0 -18
  527. tileops-0.0.1.dev2/tileops.egg-info/top_level.txt +0 -4
  528. tileops-0.0.1.dev2/top/__init__.py +0 -16
  529. tileops-0.0.1.dev2/top/kernel/__init__.py +0 -15
  530. tileops-0.0.1.dev2/top/kernel/bitnet.py +0 -490
  531. tileops-0.0.1.dev2/top/kernel/blocksparse_attention.py +0 -605
  532. tileops-0.0.1.dev2/top/kernel/gqa.py +0 -1079
  533. tileops-0.0.1.dev2/top/kernel/linear_attention/linear_attn.py +0 -490
  534. tileops-0.0.1.dev2/top/kernel/mamba_chunk_scan.py +0 -335
  535. tileops-0.0.1.dev2/top/kernel/mamba_chunk_state.py +0 -269
  536. tileops-0.0.1.dev2/top/kernel/mha.py +0 -920
  537. tileops-0.0.1.dev2/top/kernel/mla.py +0 -311
  538. tileops-0.0.1.dev2/top/kernel/sparse_mla.py +0 -502
  539. tileops-0.0.1.dev2/top/utils/__init__.py +0 -1
  540. tileops-0.0.1.dev2/top/utils/utils.py +0 -55
  541. {tileops-0.0.1.dev2 → tileops-0.1.0}/setup.cfg +0 -0
  542. /tileops-0.0.1.dev2/top/kernel/linear_attention/__init__.py → /tileops-0.1.0/src/tileops/py.typed +0 -0
  543. {tileops-0.0.1.dev2 → tileops-0.1.0/src}/tileops.egg-info/dependency_links.txt +0 -0
@@ -0,0 +1,50 @@
1
+ # Contributing to TileOPs
2
+
3
+ ## Setup
4
+
5
+ Activate a virtual environment, then:
6
+
7
+ ```bash
8
+ pip install -e . --group dev -c constraints.txt
9
+ pre-commit install
10
+ ```
11
+
12
+ [docs/development.md](docs/development.md) covers building, testing and the dev image.
13
+
14
+ ## Design first
15
+
16
+ [`docs/design/`](docs/design/) and [`src/tileops/manifest/`](src/tileops/manifest/) are the spec.
17
+ Code conforms to them; a change that does not fit the spec changes the spec with it.
18
+ Read the document for the area before changing it, and review against the same one.
19
+
20
+ | Changing | Read |
21
+ | ---------------- | --------------------------------------------------------------------------------------------------------------------------------- |
22
+ | an op or kernel | [ops-design.md](docs/design/ops-design.md), [op-slot-rules.md](docs/design/op-slot-rules.md), [code-style.md](docs/code-style.md) |
23
+ | a manifest entry | [manifest.md](docs/design/manifest.md) |
24
+ | a test | [testing.md](docs/design/testing.md), [layer-boundaries.md](docs/design/layer-boundaries.md) |
25
+ | a benchmark | [testing.md § Benchmarks](docs/design/testing.md#benchmarks) |
26
+
27
+ A rule that can be checked mechanically is a hook, not a line in a document. Run
28
+ `pre-commit run --all-files` before pushing; CI runs the same set, and what it says is the rule.
29
+ A justified exception carries `# lint: <rule> allow: <reason>`, with the rule its finding names,
30
+ on the line the finding points at (a constant's or a manifest row's first line); it exempts that
31
+ line from that hook only, and a marker without a reason exempts nothing. A file the `file-set`
32
+ hook rejects carries `lint: file-set allow: <reason>` in a comment, outside any Markdown code
33
+ fence.
34
+
35
+ ## Naming
36
+
37
+ [`scripts/ci/types.sh`](scripts/ci/types.sh) is the single source of truth for
38
+ types, branch names and labels — CI sources it. Conventional Commits (`feat(scope): …`) is not used.
39
+
40
+ | | Form |
41
+ | ----------------- | ------------------------------------------------------------------- |
42
+ | commit / PR title | `[Type] description`, or `[Type][foundry][Scope] description` |
43
+ | branch | `<type>/<area>/<slug>`, all lowercase — `perf/norm/rms-norm-sol` |
44
+ | issue title | `[TYPE][COMPONENT] short description in lowercase`, ≤ 80 characters |
45
+
46
+ ## Pull requests
47
+
48
+ [.github/PULL_REQUEST_TEMPLATE.md](.github/PULL_REQUEST_TEMPLATE.md) is the body shape: what
49
+ changed and how to verify it. A PR touching `tests/` reports its test node delta, and one touching
50
+ a kernel or op reports benchmark numbers against a baseline that is not TileOPs.
tileops-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Tile-AI.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE
@@ -0,0 +1,19 @@
1
+ # setuptools-scm includes every git-tracked file in the sdist by default;
2
+ # prune development-only trees so the sdist ships only what a build needs.
3
+ prune tests
4
+ prune benchmarks
5
+ prune docs
6
+ prune assets
7
+ prune workloads
8
+ prune .github
9
+ prune scripts
10
+
11
+ # Same rule, for root files rather than trees.
12
+ exclude .clang-format
13
+ exclude .gitignore
14
+ exclude .pre-commit-config.yaml
15
+ exclude conftest.py
16
+ exclude constraints.txt
17
+ exclude constraints-runner-lock.txt
18
+ exclude .gitattributes
19
+ exclude CHANGELOG.md
tileops-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,195 @@
1
+ Metadata-Version: 2.4
2
+ Name: tileops
3
+ Version: 0.1.0
4
+ Summary: TileOPs kernels for efficient LLM inference.
5
+ Author: Tile-AI
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/tile-ai/TileOPs
8
+ Project-URL: Repository, https://github.com/tile-ai/TileOPs
9
+ Project-URL: Documentation, https://tile-ai.github.io/TileOPs.github.io/
10
+ Project-URL: Issues, https://github.com/tile-ai/TileOPs/issues
11
+ Keywords: llm,inference,gpu,kernel,tiling
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: GPU :: NVIDIA CUDA :: 13
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: Operating System :: POSIX :: Linux
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
+ Requires-Python: >=3.12
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ License-File: THIRD_PARTY_NOTICES
26
+ Requires-Dist: torch<2.14.0,>=2.13.0
27
+ Requires-Dist: tilelang==0.1.12
28
+ Requires-Dist: pyyaml<7,>=6.0.1
29
+ Dynamic: license-file
30
+
31
+ <p align="center">
32
+ <img src="https://raw.githubusercontent.com/tile-ai/TileOPs/main/assets/readme-banner.png" alt="TileOPs × TileFoundry — From Kernels to a Library: By Agents, for Agents" width="100%">
33
+ </p>
34
+
35
+ <h3 align="center">Spec-driven LLM operators across backends — by agents, for agents</h3>
36
+
37
+ <p align="center">
38
+ <i>TileOPs defines what each operator must do.<br>
39
+ Coding agents and TileFoundry, an AI compiler built for agents, iterate to grow the library.</i>
40
+ </p>
41
+
42
+ <p align="center">
43
+ <a href="https://pypi.org/project/tileops/"><img src="https://img.shields.io/pypi/v/tileops?color=1E90FF" alt="PyPI version"></a>
44
+ <a href="https://tile-ai.github.io/TileOPs.github.io/user-guide/manifest/"><img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Ftile-ai%2FTileOPs%2Fstats%2Fmanifest-implemented.json" alt="Spec coverage"></a>
45
+ <a href="https://tile-ai.github.io/TileOPs.github.io/benchmarks/"><img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Ftile-ai%2FTileOPs%2Fstats%2Fmanifest-benchmark.json&label=bench" alt="Bench coverage"></a>
46
+ <a href="https://tile-ai.github.io/TileOPs.github.io/benchmarks/"><img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Ftile-ai%2FTileOPs-nightly%2Fsnapshots%2Fnightly-vs-baseline.json&label=vs%20best" alt="Rows ahead of or level with the fastest baseline, from the latest nightly"></a>
47
+ <a href="https://github.com/tile-ai/TileFoundry"><img src="https://img.shields.io/github/issues-search/tile-ai/TileOPs?query=is%3Apr%20is%3Amerged%20label%3Afoundry&label=Forged%20by%20TileFoundry&color=0891b2&logo=github" alt="Kernels forged by TileFoundry"></a>
48
+ </p>
49
+
50
+ <p align="center">
51
+ <a href="#quick-start"><b>Quick Start</b></a> ·
52
+ <a href="https://tile-ai.github.io/TileOPs.github.io/benchmarks/"><b>Benchmarks</b></a> ·
53
+ <a href="https://tile-ai.github.io/TileOPs.github.io/"><b>Docs</b></a> ·
54
+ <a href="https://github.com/tile-ai/TileFoundry"><b>TileFoundry</b></a>
55
+ </p>
56
+
57
+ ______________________________________________________________________
58
+
59
+ ## Agent and compiler, working together
60
+
61
+ | **TileOPs**<br>agents answer to specs | **[TileFoundry](https://github.com/tile-ai/TileFoundry)**<br>the compiler answers to agents |
62
+ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
63
+ | Each op starts with a YAML spec. Tests and benchmarks use the reference implementation, workloads and roofline formula declared in the spec to check correctness and measure performance. | A tile-based AI compiler that coding agents use to generate high-performance programs across hardware platforms. |
64
+
65
+ TileOPs shows how a coding agent and TileFoundry can work together in a loop to build an
66
+ operator library. Tests and benchmarks driven by each op's spec report failures and the gap
67
+ to the roofline bound. The agent and compiler iterate on that feedback. Kernels that pass the
68
+ checks become part of the library, where later work can build on them. This approach supports
69
+ a growing, maintainable library rather than a few one-off kernels.
70
+
71
+ ```text
72
+ spec ──▶ coding agent ◀──▶ TileFoundry ──▶ kernel
73
+ ▲ (AI compiler) │
74
+ │ ▼
75
+ └─ failures, roofline gap ◀── tests + benchmarks
76
+ │ pass
77
+ ▼
78
+ TileOPs library
79
+ ```
80
+
81
+ PRs whose kernels were generated with TileFoundry carry the `foundry` label. The badge above
82
+ counts merged PRs with this label. These PRs go through the same CI as every other PR.
83
+
84
+ ## Quick Start
85
+
86
+ ```python
87
+ import torch
88
+ from tileops.gemm import GEMMFwdOp
89
+
90
+ gemm = GEMMFwdOp() # shapes and dtype are inferred at call time
91
+
92
+ a = torch.randn(1024, 512, device="cuda", dtype=torch.float16)
93
+ b = torch.randn(1024, 512, device="cuda", dtype=torch.float16)
94
+
95
+ d = gemm(a, b) # equals a @ b.T
96
+ ```
97
+
98
+ Operators autotune after `op.request_tune()`. CUDA Graph support on H200 is validated,
99
+ after warmup, for the calls in the [graph test group](https://github.com/tile-ai/TileOPs/blob/main/docs/development.md#cuda-graph-validation).
100
+ Every op whose manifest entry has a call-time tensor input and no composition supports
101
+ `torch.compile(fullgraph=True)`.
102
+
103
+ ## How the library grows
104
+
105
+ An implementation can be regenerated from its spec, but a spec cannot be recovered from an
106
+ implementation. Agents work on the whole library, not only its kernels, so it needs to stay
107
+ consistent as it grows.
108
+
109
+ - **Maintainable.** Each op starts with a self-contained YAML spec, which is the sole input
110
+ to code generation. Checks enforce the boundary between the Python op and the
111
+ TileLang kernel.
112
+ - **Verifiable.** The spec declares correctness and performance criteria before code is
113
+ written. CI checks the spec, generated code, tests and benchmarks.
114
+ - **Tunable.** The roofline model reports each kernel's gap to its bound, and nightly
115
+ [benchmarks](https://tile-ai.github.io/TileOPs.github.io/benchmarks/) compare each kernel with
116
+ the fastest other implementation on the same GPU.
117
+
118
+ <details>
119
+ <summary><b>Inside an op spec</b></summary>
120
+
121
+ Each op has an entry in
122
+ [`src/tileops/manifest/spec/`](https://github.com/tile-ai/TileOPs/tree/main/src/tileops/manifest/spec/),
123
+ with one file per family. Abridged from `gemm.yaml`:
124
+
125
+ ```yaml
126
+ GEMMFwdOp:
127
+ ref_api: nvmath.linalg.advanced.Matmul.execute
128
+ family: gemm
129
+ signature:
130
+ forall: {M: Dim, N: Dim, K: Dim, T: "DType[float16 | bfloat16]"}
131
+ params: {trans_a: {type: bool, default: false}, trans_b: {type: bool, default: true}}
132
+ inputs: {a: {dtype: T, shape: "Mat[trans_a, M, K]"}, b: {dtype: T, shape: "Mat[trans_b, K, N]"}}
133
+ outputs: {d: {dtype: T, shape: "[M, N]"}}
134
+ workloads: [{M: 1024, N: 1024, K: 1024, trans_a: false, trans_b: false, dtype_cases: [{T: float16}, {T: bfloat16}], label: square-1k}]
135
+ roofline: {flops: "2 * M * N * K"}
136
+ ```
137
+
138
+ `Mat[t, R, C]` is a type the entry declares: the shape `[R, C]`, or `[C, R]` when `t` is true.
139
+
140
+ | Field | Role |
141
+ | ----------- | --------------------------------------------------------------------------------- |
142
+ | `ref_api` | The API whose semantics the operator follows, when applicable. |
143
+ | `signature` | Tensor types over named indices. Each call is checked against it before dispatch. |
144
+ | `workloads` | The concrete calls used by contract tests and nightly benchmarks. |
145
+ | `roofline` | The performance model. `eval_roofline()` evaluates it for each checked call. |
146
+
147
+ A validator checks each entry against its implementation in CI.
148
+ [layer-boundaries.md](https://github.com/tile-ai/TileOPs/blob/main/docs/design/layer-boundaries.md)
149
+ states what each layer of an op owns.
150
+
151
+ </details>
152
+
153
+ ## Installation
154
+
155
+ ```bash
156
+ pip install tileops
157
+ ```
158
+
159
+ pip resolves PyTorch 2.13, [TileLang](https://github.com/tile-ai/tilelang) 0.1.12 and PyYAML
160
+ from PyPI. The machine provides the rest:
161
+
162
+ - Linux and an NVIDIA GPU with compute capability 9.0 (SM90), with its driver
163
+ - CUDA Toolkit 13.2, with `nvcc` on `PATH`: TileLang compiles kernels at run time
164
+
165
+ The release is verified on H200 with Python 3.12 and 3.13.
166
+
167
+ Some kernels also have SM80, SM86 or SM89 paths. They are tested on those devices when run
168
+ there, and are outside the release verification.
169
+
170
+ To develop TileOPs, install it from source:
171
+
172
+ ```bash
173
+ git clone https://github.com/tile-ai/TileOPs
174
+ cd TileOPs
175
+ pip install -e . --group dev -c constraints.txt # constraints.txt pins what CI validates
176
+ pre-commit install
177
+
178
+ python -m pytest -q tests -m smoke # verify; requires a CUDA GPU
179
+ ```
180
+
181
+ A prebuilt Docker image includes the full stack and provides the CI environment. See
182
+ [development.md](https://github.com/tile-ai/TileOPs/blob/main/docs/development.md#dev-docker-image)
183
+ for details, test tiers, benchmarks and build troubleshooting.
184
+
185
+ ## Documentation
186
+
187
+ - [Docs site](https://tile-ai.github.io/TileOPs.github.io/): API reference, user guides and nightly benchmarks.
188
+ - [Development guide](https://tile-ai.github.io/TileOPs.github.io/user-guide/development/): environment, tests and pull requests.
189
+ - [CONTRIBUTING.md](https://github.com/tile-ai/TileOPs/blob/main/CONTRIBUTING.md): naming, PR structure and review criteria.
190
+ - [Design docs](https://github.com/tile-ai/TileOPs/tree/main/docs/design): architecture, manifest, roofline and layer boundaries.
191
+ - [API stability](https://github.com/tile-ai/TileOPs/blob/main/docs/stability.md): public modules, compatibility promise, support scope and writing an op outside TileOPs.
192
+
193
+ ## License
194
+
195
+ TileOPs is released under the [MIT License](https://github.com/tile-ai/TileOPs/blob/main/LICENSE).
@@ -0,0 +1,165 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/tile-ai/TileOPs/main/assets/readme-banner.png" alt="TileOPs × TileFoundry — From Kernels to a Library: By Agents, for Agents" width="100%">
3
+ </p>
4
+
5
+ <h3 align="center">Spec-driven LLM operators across backends — by agents, for agents</h3>
6
+
7
+ <p align="center">
8
+ <i>TileOPs defines what each operator must do.<br>
9
+ Coding agents and TileFoundry, an AI compiler built for agents, iterate to grow the library.</i>
10
+ </p>
11
+
12
+ <p align="center">
13
+ <a href="https://pypi.org/project/tileops/"><img src="https://img.shields.io/pypi/v/tileops?color=1E90FF" alt="PyPI version"></a>
14
+ <a href="https://tile-ai.github.io/TileOPs.github.io/user-guide/manifest/"><img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Ftile-ai%2FTileOPs%2Fstats%2Fmanifest-implemented.json" alt="Spec coverage"></a>
15
+ <a href="https://tile-ai.github.io/TileOPs.github.io/benchmarks/"><img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Ftile-ai%2FTileOPs%2Fstats%2Fmanifest-benchmark.json&label=bench" alt="Bench coverage"></a>
16
+ <a href="https://tile-ai.github.io/TileOPs.github.io/benchmarks/"><img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Ftile-ai%2FTileOPs-nightly%2Fsnapshots%2Fnightly-vs-baseline.json&label=vs%20best" alt="Rows ahead of or level with the fastest baseline, from the latest nightly"></a>
17
+ <a href="https://github.com/tile-ai/TileFoundry"><img src="https://img.shields.io/github/issues-search/tile-ai/TileOPs?query=is%3Apr%20is%3Amerged%20label%3Afoundry&label=Forged%20by%20TileFoundry&color=0891b2&logo=github" alt="Kernels forged by TileFoundry"></a>
18
+ </p>
19
+
20
+ <p align="center">
21
+ <a href="#quick-start"><b>Quick Start</b></a> ·
22
+ <a href="https://tile-ai.github.io/TileOPs.github.io/benchmarks/"><b>Benchmarks</b></a> ·
23
+ <a href="https://tile-ai.github.io/TileOPs.github.io/"><b>Docs</b></a> ·
24
+ <a href="https://github.com/tile-ai/TileFoundry"><b>TileFoundry</b></a>
25
+ </p>
26
+
27
+ ______________________________________________________________________
28
+
29
+ ## Agent and compiler, working together
30
+
31
+ | **TileOPs**<br>agents answer to specs | **[TileFoundry](https://github.com/tile-ai/TileFoundry)**<br>the compiler answers to agents |
32
+ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
33
+ | Each op starts with a YAML spec. Tests and benchmarks use the reference implementation, workloads and roofline formula declared in the spec to check correctness and measure performance. | A tile-based AI compiler that coding agents use to generate high-performance programs across hardware platforms. |
34
+
35
+ TileOPs shows how a coding agent and TileFoundry can work together in a loop to build an
36
+ operator library. Tests and benchmarks driven by each op's spec report failures and the gap
37
+ to the roofline bound. The agent and compiler iterate on that feedback. Kernels that pass the
38
+ checks become part of the library, where later work can build on them. This approach supports
39
+ a growing, maintainable library rather than a few one-off kernels.
40
+
41
+ ```text
42
+ spec ──▶ coding agent ◀──▶ TileFoundry ──▶ kernel
43
+ ▲ (AI compiler) │
44
+ │ ▼
45
+ └─ failures, roofline gap ◀── tests + benchmarks
46
+ │ pass
47
+ ▼
48
+ TileOPs library
49
+ ```
50
+
51
+ PRs whose kernels were generated with TileFoundry carry the `foundry` label. The badge above
52
+ counts merged PRs with this label. These PRs go through the same CI as every other PR.
53
+
54
+ ## Quick Start
55
+
56
+ ```python
57
+ import torch
58
+ from tileops.gemm import GEMMFwdOp
59
+
60
+ gemm = GEMMFwdOp() # shapes and dtype are inferred at call time
61
+
62
+ a = torch.randn(1024, 512, device="cuda", dtype=torch.float16)
63
+ b = torch.randn(1024, 512, device="cuda", dtype=torch.float16)
64
+
65
+ d = gemm(a, b) # equals a @ b.T
66
+ ```
67
+
68
+ Operators autotune after `op.request_tune()`. CUDA Graph support on H200 is validated,
69
+ after warmup, for the calls in the [graph test group](https://github.com/tile-ai/TileOPs/blob/main/docs/development.md#cuda-graph-validation).
70
+ Every op whose manifest entry has a call-time tensor input and no composition supports
71
+ `torch.compile(fullgraph=True)`.
72
+
73
+ ## How the library grows
74
+
75
+ An implementation can be regenerated from its spec, but a spec cannot be recovered from an
76
+ implementation. Agents work on the whole library, not only its kernels, so it needs to stay
77
+ consistent as it grows.
78
+
79
+ - **Maintainable.** Each op starts with a self-contained YAML spec, which is the sole input
80
+ to code generation. Checks enforce the boundary between the Python op and the
81
+ TileLang kernel.
82
+ - **Verifiable.** The spec declares correctness and performance criteria before code is
83
+ written. CI checks the spec, generated code, tests and benchmarks.
84
+ - **Tunable.** The roofline model reports each kernel's gap to its bound, and nightly
85
+ [benchmarks](https://tile-ai.github.io/TileOPs.github.io/benchmarks/) compare each kernel with
86
+ the fastest other implementation on the same GPU.
87
+
88
+ <details>
89
+ <summary><b>Inside an op spec</b></summary>
90
+
91
+ Each op has an entry in
92
+ [`src/tileops/manifest/spec/`](https://github.com/tile-ai/TileOPs/tree/main/src/tileops/manifest/spec/),
93
+ with one file per family. Abridged from `gemm.yaml`:
94
+
95
+ ```yaml
96
+ GEMMFwdOp:
97
+ ref_api: nvmath.linalg.advanced.Matmul.execute
98
+ family: gemm
99
+ signature:
100
+ forall: {M: Dim, N: Dim, K: Dim, T: "DType[float16 | bfloat16]"}
101
+ params: {trans_a: {type: bool, default: false}, trans_b: {type: bool, default: true}}
102
+ inputs: {a: {dtype: T, shape: "Mat[trans_a, M, K]"}, b: {dtype: T, shape: "Mat[trans_b, K, N]"}}
103
+ outputs: {d: {dtype: T, shape: "[M, N]"}}
104
+ workloads: [{M: 1024, N: 1024, K: 1024, trans_a: false, trans_b: false, dtype_cases: [{T: float16}, {T: bfloat16}], label: square-1k}]
105
+ roofline: {flops: "2 * M * N * K"}
106
+ ```
107
+
108
+ `Mat[t, R, C]` is a type the entry declares: the shape `[R, C]`, or `[C, R]` when `t` is true.
109
+
110
+ | Field | Role |
111
+ | ----------- | --------------------------------------------------------------------------------- |
112
+ | `ref_api` | The API whose semantics the operator follows, when applicable. |
113
+ | `signature` | Tensor types over named indices. Each call is checked against it before dispatch. |
114
+ | `workloads` | The concrete calls used by contract tests and nightly benchmarks. |
115
+ | `roofline` | The performance model. `eval_roofline()` evaluates it for each checked call. |
116
+
117
+ A validator checks each entry against its implementation in CI.
118
+ [layer-boundaries.md](https://github.com/tile-ai/TileOPs/blob/main/docs/design/layer-boundaries.md)
119
+ states what each layer of an op owns.
120
+
121
+ </details>
122
+
123
+ ## Installation
124
+
125
+ ```bash
126
+ pip install tileops
127
+ ```
128
+
129
+ pip resolves PyTorch 2.13, [TileLang](https://github.com/tile-ai/tilelang) 0.1.12 and PyYAML
130
+ from PyPI. The machine provides the rest:
131
+
132
+ - Linux and an NVIDIA GPU with compute capability 9.0 (SM90), with its driver
133
+ - CUDA Toolkit 13.2, with `nvcc` on `PATH`: TileLang compiles kernels at run time
134
+
135
+ The release is verified on H200 with Python 3.12 and 3.13.
136
+
137
+ Some kernels also have SM80, SM86 or SM89 paths. They are tested on those devices when run
138
+ there, and are outside the release verification.
139
+
140
+ To develop TileOPs, install it from source:
141
+
142
+ ```bash
143
+ git clone https://github.com/tile-ai/TileOPs
144
+ cd TileOPs
145
+ pip install -e . --group dev -c constraints.txt # constraints.txt pins what CI validates
146
+ pre-commit install
147
+
148
+ python -m pytest -q tests -m smoke # verify; requires a CUDA GPU
149
+ ```
150
+
151
+ A prebuilt Docker image includes the full stack and provides the CI environment. See
152
+ [development.md](https://github.com/tile-ai/TileOPs/blob/main/docs/development.md#dev-docker-image)
153
+ for details, test tiers, benchmarks and build troubleshooting.
154
+
155
+ ## Documentation
156
+
157
+ - [Docs site](https://tile-ai.github.io/TileOPs.github.io/): API reference, user guides and nightly benchmarks.
158
+ - [Development guide](https://tile-ai.github.io/TileOPs.github.io/user-guide/development/): environment, tests and pull requests.
159
+ - [CONTRIBUTING.md](https://github.com/tile-ai/TileOPs/blob/main/CONTRIBUTING.md): naming, PR structure and review criteria.
160
+ - [Design docs](https://github.com/tile-ai/TileOPs/tree/main/docs/design): architecture, manifest, roofline and layer boundaries.
161
+ - [API stability](https://github.com/tile-ai/TileOPs/blob/main/docs/stability.md): public modules, compatibility promise, support scope and writing an op outside TileOPs.
162
+
163
+ ## License
164
+
165
+ TileOPs is released under the [MIT License](https://github.com/tile-ai/TileOPs/blob/main/LICENSE).
@@ -0,0 +1,28 @@
1
+ TileOPs includes code adapted from the following project, distributed under its license.
2
+
3
+ ------------------------------------------------------------------------------
4
+ Gated DeltaNet prefill kernels
5
+ Files: src/tileops/_kernels/linear_attention/gdn/prefill_forward.py
6
+ src/tileops/_kernels/linear_attention/gdn/prefill_prepare.py
7
+
8
+ MIT License
9
+
10
+ Copyright (c) 2026 The Qwen team, Alibaba Group.
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.