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.
- tileops-0.1.0/CONTRIBUTING.md +50 -0
- tileops-0.1.0/LICENSE +21 -0
- tileops-0.1.0/MANIFEST.in +19 -0
- tileops-0.1.0/PKG-INFO +195 -0
- tileops-0.1.0/README.md +165 -0
- tileops-0.1.0/THIRD_PARTY_NOTICES +28 -0
- tileops-0.1.0/pyproject.toml +203 -0
- tileops-0.1.0/src/tileops/__init__.py +113 -0
- tileops-0.1.0/src/tileops/_csrc.py +44 -0
- tileops-0.1.0/src/tileops/_kernels/__init__.py +241 -0
- tileops-0.1.0/src/tileops/_kernels/attention/__init__.py +148 -0
- tileops-0.1.0/src/tileops/_kernels/attention/call_spec.py +1071 -0
- tileops-0.1.0/src/tileops/_kernels/attention/dsa/__init__.py +23 -0
- tileops-0.1.0/src/tileops/_kernels/attention/dsa/decode.py +1117 -0
- tileops-0.1.0/src/tileops/_kernels/attention/dsa/decode_ws.py +519 -0
- tileops-0.1.0/src/tileops/_kernels/attention/dsa/paged.py +614 -0
- tileops-0.1.0/src/tileops/_kernels/attention/dsa/paged_mma.py +200 -0
- tileops-0.1.0/src/tileops/_kernels/attention/fp8_fa3_layouts.py +56 -0
- tileops-0.1.0/src/tileops/_kernels/attention/fp8_lightning_indexer.py +894 -0
- tileops-0.1.0/src/tileops/_kernels/attention/gqa/__init__.py +93 -0
- tileops-0.1.0/src/tileops/_kernels/attention/gqa/bwd.py +784 -0
- tileops-0.1.0/src/tileops/_kernels/attention/gqa/bwd_ws.py +874 -0
- tileops-0.1.0/src/tileops/_kernels/attention/gqa/decode.py +942 -0
- tileops-0.1.0/src/tileops/_kernels/attention/gqa/decode_bs1.py +653 -0
- tileops-0.1.0/src/tileops/_kernels/attention/gqa/decode_bs1_common.py +309 -0
- tileops-0.1.0/src/tileops/_kernels/attention/gqa/decode_fp8.py +401 -0
- tileops-0.1.0/src/tileops/_kernels/attention/gqa/decode_ws.py +358 -0
- tileops-0.1.0/src/tileops/_kernels/attention/gqa/dense.py +2971 -0
- tileops-0.1.0/src/tileops/_kernels/attention/gqa/dense_fp8.py +1172 -0
- tileops-0.1.0/src/tileops/_kernels/attention/gqa/dense_prefill.py +184 -0
- tileops-0.1.0/src/tileops/_kernels/attention/gqa/paged.py +1359 -0
- tileops-0.1.0/src/tileops/_kernels/attention/gqa/paged_decode.py +773 -0
- tileops-0.1.0/src/tileops/_kernels/attention/gqa/paged_decode_bs1.py +303 -0
- tileops-0.1.0/src/tileops/_kernels/attention/gqa/paged_fp8_decode.py +535 -0
- tileops-0.1.0/src/tileops/_kernels/attention/gqa/paged_fp8_ws.py +1269 -0
- tileops-0.1.0/src/tileops/_kernels/attention/gqa/paged_rope_prepare.py +181 -0
- tileops-0.1.0/src/tileops/_kernels/attention/gqa/paged_ws.py +1234 -0
- tileops-0.1.0/src/tileops/_kernels/attention/gqa/prefill_varlen.py +475 -0
- tileops-0.1.0/src/tileops/_kernels/attention/gqa/prefill_varlen_ws.py +810 -0
- tileops-0.1.0/src/tileops/_kernels/attention/gqa/sliding_window_varlen.py +402 -0
- tileops-0.1.0/src/tileops/_kernels/attention/gqa/varlen_fp8.py +1530 -0
- tileops-0.1.0/src/tileops/_kernels/attention/merge_states.py +173 -0
- tileops-0.1.0/src/tileops/_kernels/attention/mha/__init__.py +9 -0
- tileops-0.1.0/src/tileops/_kernels/attention/mha/decode_paged_ws.py +606 -0
- tileops-0.1.0/src/tileops/_kernels/attention/mla/__init__.py +33 -0
- tileops-0.1.0/src/tileops/_kernels/attention/mla/bwd.py +387 -0
- tileops-0.1.0/src/tileops/_kernels/attention/mla/bwd_ws.py +841 -0
- tileops-0.1.0/src/tileops/_kernels/attention/mla/decode.py +1175 -0
- tileops-0.1.0/src/tileops/_kernels/attention/mla/paged.py +401 -0
- tileops-0.1.0/src/tileops/_kernels/attention/mla/prefill_varlen.py +496 -0
- tileops-0.1.0/src/tileops/_kernels/attention/mla/prefill_varlen_ws.py +591 -0
- tileops-0.1.0/src/tileops/_kernels/attention/mla/seesaw.py +726 -0
- tileops-0.1.0/src/tileops/_kernels/attention/mla_cache_write.py +372 -0
- tileops-0.1.0/src/tileops/_kernels/attention/nsa/__init__.py +21 -0
- tileops-0.1.0/src/tileops/_kernels/attention/nsa/compressed_varlen.py +621 -0
- tileops-0.1.0/src/tileops/_kernels/attention/nsa/topk_varlen.py +705 -0
- tileops-0.1.0/src/tileops/_kernels/attention/nsa/varlen.py +468 -0
- tileops-0.1.0/src/tileops/_kernels/attention/online_softmax.py +274 -0
- tileops-0.1.0/src/tileops/_kernels/attention/paged_cache_gather.py +213 -0
- tileops-0.1.0/src/tileops/_kernels/attention/paged_cache_write.py +226 -0
- tileops-0.1.0/src/tileops/_kernels/attention/topk_select.py +525 -0
- tileops-0.1.0/src/tileops/_kernels/attention/varlen.py +185 -0
- tileops-0.1.0/src/tileops/_kernels/attention/varlen_rope.py +269 -0
- tileops-0.1.0/src/tileops/_kernels/autotune.py +352 -0
- tileops-0.1.0/src/tileops/_kernels/buffer_utils.py +47 -0
- tileops-0.1.0/src/tileops/_kernels/call_spec.py +152 -0
- tileops-0.1.0/src/tileops/_kernels/constants.py +101 -0
- tileops-0.1.0/src/tileops/_kernels/convolution/__init__.py +47 -0
- tileops-0.1.0/src/tileops/_kernels/convolution/_common.py +119 -0
- tileops-0.1.0/src/tileops/_kernels/convolution/call_spec.py +235 -0
- tileops-0.1.0/src/tileops/_kernels/convolution/conv1d.py +1140 -0
- tileops-0.1.0/src/tileops/_kernels/convolution/conv2d.py +1409 -0
- tileops-0.1.0/src/tileops/_kernels/convolution/conv3d.py +1131 -0
- tileops-0.1.0/src/tileops/_kernels/elementwise/__init__.py +213 -0
- tileops-0.1.0/src/tileops/_kernels/elementwise/_base.py +855 -0
- tileops-0.1.0/src/tileops/_kernels/elementwise/_broadcast.py +151 -0
- tileops-0.1.0/src/tileops/_kernels/elementwise/_builders.py +988 -0
- tileops-0.1.0/src/tileops/_kernels/elementwise/_division.py +96 -0
- tileops-0.1.0/src/tileops/_kernels/elementwise/_dtype.py +63 -0
- tileops-0.1.0/src/tileops/_kernels/elementwise/_erf.py +110 -0
- tileops-0.1.0/src/tileops/_kernels/elementwise/_nan.py +76 -0
- tileops-0.1.0/src/tileops/_kernels/elementwise/_op_body.py +76 -0
- tileops-0.1.0/src/tileops/_kernels/elementwise/_policy.py +189 -0
- tileops-0.1.0/src/tileops/_kernels/elementwise/activations.py +460 -0
- tileops-0.1.0/src/tileops/_kernels/elementwise/alibi.py +125 -0
- tileops-0.1.0/src/tileops/_kernels/elementwise/arithmetic.py +637 -0
- tileops-0.1.0/src/tileops/_kernels/elementwise/bitwise.py +106 -0
- tileops-0.1.0/src/tileops/_kernels/elementwise/call_spec.py +698 -0
- tileops-0.1.0/src/tileops/_kernels/elementwise/clamp.py +172 -0
- tileops-0.1.0/src/tileops/_kernels/elementwise/comparison.py +226 -0
- tileops-0.1.0/src/tileops/_kernels/elementwise/dropout.py +165 -0
- tileops-0.1.0/src/tileops/_kernels/elementwise/logical.py +89 -0
- tileops-0.1.0/src/tileops/_kernels/elementwise/masked_fill.py +181 -0
- tileops-0.1.0/src/tileops/_kernels/elementwise/math_unary.py +359 -0
- tileops-0.1.0/src/tileops/_kernels/elementwise/nan_to_num.py +81 -0
- tileops-0.1.0/src/tileops/_kernels/elementwise/prelu.py +85 -0
- tileops-0.1.0/src/tileops/_kernels/elementwise/sinusoidal.py +135 -0
- tileops-0.1.0/src/tileops/_kernels/elementwise/where.py +71 -0
- tileops-0.1.0/src/tileops/_kernels/fft.py +1904 -0
- tileops-0.1.0/src/tileops/_kernels/gemm/__init__.py +99 -0
- tileops-0.1.0/src/tileops/_kernels/gemm/bmm.py +1345 -0
- tileops-0.1.0/src/tileops/_kernels/gemm/call_spec.py +440 -0
- tileops-0.1.0/src/tileops/_kernels/gemm/dense.py +3943 -0
- tileops-0.1.0/src/tileops/_kernels/gemm/fp8_1d2d.py +1735 -0
- tileops-0.1.0/src/tileops/_kernels/gemm/fp8_swap_ab.py +168 -0
- tileops-0.1.0/src/tileops/_kernels/gemm/grouped/__init__.py +13 -0
- tileops-0.1.0/src/tileops/_kernels/gemm/grouped/call_spec.py +98 -0
- tileops-0.1.0/src/tileops/_kernels/gemm/grouped/general.py +325 -0
- tileops-0.1.0/src/tileops/_kernels/gemm/grouped/persistent.py +98 -0
- tileops-0.1.0/src/tileops/_kernels/gemm/heuristics.py +818 -0
- tileops-0.1.0/src/tileops/_kernels/gemm/int8_w8a8.py +1036 -0
- tileops-0.1.0/src/tileops/_kernels/gemm/persistent/__init__.py +16 -0
- tileops-0.1.0/src/tileops/_kernels/gemm/persistent/heuristics.py +863 -0
- tileops-0.1.0/src/tileops/_kernels/gemm/persistent/template.py +1415 -0
- tileops-0.1.0/src/tileops/_kernels/gemm/w4a16.py +1283 -0
- tileops-0.1.0/src/tileops/_kernels/gemm/w4a16_repack.py +131 -0
- tileops-0.1.0/src/tileops/_kernels/gemm/w4a8_decode.py +1091 -0
- tileops-0.1.0/src/tileops/_kernels/gemm/w4a8_prefill.py +991 -0
- tileops-0.1.0/src/tileops/_kernels/gemm/w4a8_repack.py +160 -0
- tileops-0.1.0/src/tileops/_kernels/grouped_tiling.py +191 -0
- tileops-0.1.0/src/tileops/_kernels/kernel_base.py +825 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/__init__.py +95 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/call_spec.py +541 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/chunk_plan.py +68 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/chunk_prefill.py +305 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/delta_decode.py +244 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/deltanet/__init__.py +21 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/deltanet/autotune.py +356 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/deltanet/chunk_bwd.py +558 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/deltanet/chunk_fwd.py +692 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/deltanet/chunk_prefill.py +43 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/deltanet/compute_w_u_bwd.py +188 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/deltanet/dense_decode.py +150 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/deltanet/dense_prefill.py +437 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/deltanet/fused_prepare_compute_w_u.py +205 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/deltanet/partition_scan.py +139 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/deltanet/prefill_forward.py +499 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/deltanet/prefill_prepare.py +272 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/deltanet/recurrent.py +751 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/gdn/__init__.py +11 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/gdn/chunk_prefill.py +37 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/gdn/decode.py +171 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/gdn/prefill.py +638 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/gdn/prefill_common.py +175 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/gdn/prefill_forward.py +716 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/gdn/prefill_fused.py +667 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/gdn/prefill_prepare.py +1677 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/gla/__init__.py +22 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/gla/call_spec.py +99 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/gla/chunk_bwd.py +636 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/gla/chunk_fwd.py +896 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/gla/dense_decode.py +233 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/gla/dense_prefill_partitioned.py +557 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/gla/dense_prefill_subchunk.py +349 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/gla/recurrent.py +494 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/gla/varlen_prefill.py +657 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/gla/varlen_prefill_partitioned.py +706 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/kda/__init__.py +17 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/kda/chunk_programs.py +1120 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/kda/decode.py +161 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/kda/decode_program.py +154 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/kda/fused_program.py +627 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/kda/gate.py +85 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/kda/inverse.py +93 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/kda/prefill.py +157 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/kda/prefill_fused.py +176 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/kda/prepare_split.py +1215 -0
- tileops-0.1.0/src/tileops/_kernels/linear_attention/v_tile.py +43 -0
- tileops-0.1.0/src/tileops/_kernels/mamba/__init__.py +59 -0
- tileops-0.1.0/src/tileops/_kernels/mamba/call_spec.py +443 -0
- tileops-0.1.0/src/tileops/_kernels/mamba/causal_conv1d.py +536 -0
- tileops-0.1.0/src/tileops/_kernels/mamba/selective_scan.py +629 -0
- tileops-0.1.0/src/tileops/_kernels/mamba/ssd_chunk_coupling.py +241 -0
- tileops-0.1.0/src/tileops/_kernels/mamba/ssd_chunk_cumsum.py +303 -0
- tileops-0.1.0/src/tileops/_kernels/mamba/ssd_chunk_scan.py +611 -0
- tileops-0.1.0/src/tileops/_kernels/mamba/ssd_chunk_state.py +350 -0
- tileops-0.1.0/src/tileops/_kernels/mamba/ssd_recurrent.py +287 -0
- tileops-0.1.0/src/tileops/_kernels/mamba/ssd_state_passing.py +396 -0
- tileops-0.1.0/src/tileops/_kernels/moe/__init__.py +72 -0
- tileops-0.1.0/src/tileops/_kernels/moe/call_spec.py +534 -0
- tileops-0.1.0/src/tileops/_kernels/moe/fused_topk.py +660 -0
- tileops-0.1.0/src/tileops/_kernels/moe/indexed_expert_gemm.py +566 -0
- tileops-0.1.0/src/tileops/_kernels/moe/moe_grouped_gemm.py +436 -0
- tileops-0.1.0/src/tileops/_kernels/moe/moe_grouped_gemm_fp8.py +860 -0
- tileops-0.1.0/src/tileops/_kernels/moe/moe_grouped_gemm_fp8_mma.py +110 -0
- tileops-0.1.0/src/tileops/_kernels/moe/permute_align.py +475 -0
- tileops-0.1.0/src/tileops/_kernels/moe/permute_contiguous.py +461 -0
- tileops-0.1.0/src/tileops/_kernels/moe/shared_expert_mlp.py +335 -0
- tileops-0.1.0/src/tileops/_kernels/moe/unpermute.py +244 -0
- tileops-0.1.0/src/tileops/_kernels/norm/__init__.py +66 -0
- tileops-0.1.0/src/tileops/_kernels/norm/_config.py +351 -0
- tileops-0.1.0/src/tileops/_kernels/norm/ada_layer_norm.py +318 -0
- tileops-0.1.0/src/tileops/_kernels/norm/batch_norm.py +2257 -0
- tileops-0.1.0/src/tileops/_kernels/norm/call_spec.py +518 -0
- tileops-0.1.0/src/tileops/_kernels/norm/fused_add_norm.py +872 -0
- tileops-0.1.0/src/tileops/_kernels/norm/fused_add_rms_norm_quant.py +663 -0
- tileops-0.1.0/src/tileops/_kernels/norm/fused_qk_norm_rope.py +281 -0
- tileops-0.1.0/src/tileops/_kernels/norm/group_norm.py +685 -0
- tileops-0.1.0/src/tileops/_kernels/norm/group_norm_split.py +327 -0
- tileops-0.1.0/src/tileops/_kernels/norm/instance_norm.py +619 -0
- tileops-0.1.0/src/tileops/_kernels/norm/layer_norm.py +299 -0
- tileops-0.1.0/src/tileops/_kernels/norm/layer_norm_warp_row.py +205 -0
- tileops-0.1.0/src/tileops/_kernels/norm/rms_norm.py +601 -0
- tileops-0.1.0/src/tileops/_kernels/norm/rms_norm_on_chip.py +262 -0
- tileops-0.1.0/src/tileops/_kernels/norm/rms_norm_streaming.py +152 -0
- tileops-0.1.0/src/tileops/_kernels/pool/__init__.py +76 -0
- tileops-0.1.0/src/tileops/_kernels/pool/adaptive_avg_pool2d.py +82 -0
- tileops-0.1.0/src/tileops/_kernels/pool/adaptive_max_pool2d.py +387 -0
- tileops-0.1.0/src/tileops/_kernels/pool/avg_pool1d.py +290 -0
- tileops-0.1.0/src/tileops/_kernels/pool/avg_pool1d_register.py +167 -0
- tileops-0.1.0/src/tileops/_kernels/pool/avg_pool2d.py +160 -0
- tileops-0.1.0/src/tileops/_kernels/pool/avg_pool2d_register.py +208 -0
- tileops-0.1.0/src/tileops/_kernels/pool/avg_pool3d.py +388 -0
- tileops-0.1.0/src/tileops/_kernels/pool/call_spec.py +452 -0
- tileops-0.1.0/src/tileops/_kernels/pool/common.py +291 -0
- tileops-0.1.0/src/tileops/_kernels/pool/max_pool1d.py +733 -0
- tileops-0.1.0/src/tileops/_kernels/pool/max_pool2d.py +416 -0
- tileops-0.1.0/src/tileops/_kernels/pool/max_pool2d_register.py +321 -0
- tileops-0.1.0/src/tileops/_kernels/pool/max_pool3d.py +411 -0
- tileops-0.1.0/src/tileops/_kernels/pool/mean_pooling.py +316 -0
- tileops-0.1.0/src/tileops/_kernels/quantization/__init__.py +75 -0
- tileops-0.1.0/src/tileops/_kernels/quantization/call_spec.py +217 -0
- tileops-0.1.0/src/tileops/_kernels/quantization/fp8_quant.py +215 -0
- tileops-0.1.0/src/tileops/_kernels/quantization/fp8_quant_per_block.py +292 -0
- tileops-0.1.0/src/tileops/_kernels/quantization/int4_quant_per_group.py +282 -0
- tileops-0.1.0/src/tileops/_kernels/quantization/int8_codes.py +52 -0
- tileops-0.1.0/src/tileops/_kernels/quantization/int8_dequant.py +674 -0
- tileops-0.1.0/src/tileops/_kernels/quantization/int8_quant_per_block.py +448 -0
- tileops-0.1.0/src/tileops/_kernels/quantization/int8_quant_per_channel.py +616 -0
- tileops-0.1.0/src/tileops/_kernels/quantization/int8_quant_per_tensor.py +383 -0
- tileops-0.1.0/src/tileops/_kernels/reduction/__init__.py +79 -0
- tileops-0.1.0/src/tileops/_kernels/reduction/_primitives.py +1229 -0
- tileops-0.1.0/src/tileops/_kernels/reduction/_split_softmax.py +233 -0
- tileops-0.1.0/src/tileops/_kernels/reduction/argreduce.py +796 -0
- tileops-0.1.0/src/tileops/_kernels/reduction/call_spec.py +399 -0
- tileops-0.1.0/src/tileops/_kernels/reduction/cumulative.py +741 -0
- tileops-0.1.0/src/tileops/_kernels/reduction/logical_reduce.py +710 -0
- tileops-0.1.0/src/tileops/_kernels/reduction/logsumexp.py +688 -0
- tileops-0.1.0/src/tileops/_kernels/reduction/reduce.py +1181 -0
- tileops-0.1.0/src/tileops/_kernels/reduction/softmax.py +808 -0
- tileops-0.1.0/src/tileops/_kernels/reduction/softmax_on_chip.py +555 -0
- tileops-0.1.0/src/tileops/_kernels/reduction/softmax_warp_rows.py +164 -0
- tileops-0.1.0/src/tileops/_kernels/reduction/vector_norm.py +313 -0
- tileops-0.1.0/src/tileops/_kernels/rope.py +866 -0
- tileops-0.1.0/src/tileops/_kernels/sampling/__init__.py +35 -0
- tileops-0.1.0/src/tileops/_kernels/sampling/call_spec.py +164 -0
- tileops-0.1.0/src/tileops/_kernels/sampling/chain_speculative_sampling.py +518 -0
- tileops-0.1.0/src/tileops/_kernels/sampling/min_p_mask.py +261 -0
- tileops-0.1.0/src/tileops/_kernels/sampling/philox.py +43 -0
- tileops-0.1.0/src/tileops/_kernels/sampling/radix_select.py +127 -0
- tileops-0.1.0/src/tileops/_kernels/sampling/row_tiles.py +113 -0
- tileops-0.1.0/src/tileops/_kernels/sampling/sampling_from_probs.py +393 -0
- tileops-0.1.0/src/tileops/_kernels/sampling/top_k_mask.py +435 -0
- tileops-0.1.0/src/tileops/_kernels/sampling/top_k_top_p_mask.py +687 -0
- tileops-0.1.0/src/tileops/_kernels/sampling/top_p_mask.py +439 -0
- tileops-0.1.0/src/tileops/_kernels/sequence_modeling/__init__.py +35 -0
- tileops-0.1.0/src/tileops/_kernels/sequence_modeling/engram/__init__.py +21 -0
- tileops-0.1.0/src/tileops/_kernels/sequence_modeling/engram/call_spec.py +168 -0
- tileops-0.1.0/src/tileops/_kernels/sequence_modeling/engram/decode.py +436 -0
- tileops-0.1.0/src/tileops/_kernels/sequence_modeling/engram/gate_conv_bwd.py +481 -0
- tileops-0.1.0/src/tileops/_kernels/sequence_modeling/engram/gate_conv_fwd.py +276 -0
- tileops-0.1.0/src/tileops/_kernels/sequence_modeling/mhc/__init__.py +17 -0
- tileops-0.1.0/src/tileops/_kernels/sequence_modeling/mhc/call_spec.py +102 -0
- tileops-0.1.0/src/tileops/_kernels/sequence_modeling/mhc/post.py +107 -0
- tileops-0.1.0/src/tileops/_kernels/sequence_modeling/mhc/pre.py +280 -0
- tileops-0.1.0/src/tileops/_kernels/streaming_load.py +13 -0
- tileops-0.1.0/src/tileops/_kernels/tiling.py +27 -0
- tileops-0.1.0/src/tileops/_kernels/transform/__init__.py +25 -0
- tileops-0.1.0/src/tileops/_kernels/transform/call_spec.py +160 -0
- tileops-0.1.0/src/tileops/_kernels/transform/hadamard_register.py +723 -0
- tileops-0.1.0/src/tileops/_kernels/transform/hadamard_shared.py +423 -0
- tileops-0.1.0/src/tileops/_ops/__init__.py +1 -0
- tileops-0.1.0/src/tileops/_ops/_naming.py +81 -0
- tileops-0.1.0/src/tileops/_ops/_params_codegen.py +31 -0
- tileops-0.1.0/src/tileops/_ops/_signature_codegen.py +1973 -0
- tileops-0.1.0/src/tileops/_ops/attention/__init__.py +49 -0
- tileops-0.1.0/src/tileops/_ops/attention/dsa.py +217 -0
- tileops-0.1.0/src/tileops/_ops/attention/fp8_lightning_indexer.py +116 -0
- tileops-0.1.0/src/tileops/_ops/attention/gqa/__init__.py +12 -0
- tileops-0.1.0/src/tileops/_ops/attention/gqa/bwd.py +144 -0
- tileops-0.1.0/src/tileops/_ops/attention/gqa/dense.py +323 -0
- tileops-0.1.0/src/tileops/_ops/attention/gqa/paged.py +239 -0
- tileops-0.1.0/src/tileops/_ops/attention/gqa/parameters.py +24 -0
- tileops-0.1.0/src/tileops/_ops/attention/gqa/varlen.py +203 -0
- tileops-0.1.0/src/tileops/_ops/attention/merge_states.py +68 -0
- tileops-0.1.0/src/tileops/_ops/attention/mha.py +119 -0
- tileops-0.1.0/src/tileops/_ops/attention/mla.py +484 -0
- tileops-0.1.0/src/tileops/_ops/attention/mla_cache_write.py +123 -0
- tileops-0.1.0/src/tileops/_ops/attention/nsa.py +331 -0
- tileops-0.1.0/src/tileops/_ops/attention/paged_cache_gather.py +111 -0
- tileops-0.1.0/src/tileops/_ops/attention/paged_cache_write.py +103 -0
- tileops-0.1.0/src/tileops/_ops/attention/topk_select.py +92 -0
- tileops-0.1.0/src/tileops/_ops/compile_boundary.py +50 -0
- tileops-0.1.0/src/tileops/_ops/convolution.py +367 -0
- tileops-0.1.0/src/tileops/_ops/elementwise/__init__.py +163 -0
- tileops-0.1.0/src/tileops/_ops/elementwise/_base.py +229 -0
- tileops-0.1.0/src/tileops/_ops/elementwise/activations.py +314 -0
- tileops-0.1.0/src/tileops/_ops/elementwise/alibi.py +76 -0
- tileops-0.1.0/src/tileops/_ops/elementwise/arithmetic.py +326 -0
- tileops-0.1.0/src/tileops/_ops/elementwise/bitwise.py +45 -0
- tileops-0.1.0/src/tileops/_ops/elementwise/clamp.py +120 -0
- tileops-0.1.0/src/tileops/_ops/elementwise/comparison.py +122 -0
- tileops-0.1.0/src/tileops/_ops/elementwise/dropout.py +110 -0
- tileops-0.1.0/src/tileops/_ops/elementwise/logical.py +54 -0
- tileops-0.1.0/src/tileops/_ops/elementwise/masked_fill.py +131 -0
- tileops-0.1.0/src/tileops/_ops/elementwise/math_unary.py +189 -0
- tileops-0.1.0/src/tileops/_ops/elementwise/nan_to_num.py +55 -0
- tileops-0.1.0/src/tileops/_ops/elementwise/prelu.py +64 -0
- tileops-0.1.0/src/tileops/_ops/elementwise/sinusoidal.py +77 -0
- tileops-0.1.0/src/tileops/_ops/elementwise/where.py +65 -0
- tileops-0.1.0/src/tileops/_ops/fft.py +72 -0
- tileops-0.1.0/src/tileops/_ops/gemm/__init__.py +20 -0
- tileops-0.1.0/src/tileops/_ops/gemm/bmm.py +233 -0
- tileops-0.1.0/src/tileops/_ops/gemm/gemm.py +575 -0
- tileops-0.1.0/src/tileops/_ops/gemm/grouped_gemm.py +123 -0
- tileops-0.1.0/src/tileops/_ops/linear_attention/__init__.py +24 -0
- tileops-0.1.0/src/tileops/_ops/linear_attention/deltanet/__init__.py +19 -0
- tileops-0.1.0/src/tileops/_ops/linear_attention/deltanet/chunk.py +180 -0
- tileops-0.1.0/src/tileops/_ops/linear_attention/deltanet/fwd.py +129 -0
- tileops-0.1.0/src/tileops/_ops/linear_attention/deltanet/recurrent.py +88 -0
- tileops-0.1.0/src/tileops/_ops/linear_attention/gdn.py +187 -0
- tileops-0.1.0/src/tileops/_ops/linear_attention/gla/__init__.py +19 -0
- tileops-0.1.0/src/tileops/_ops/linear_attention/gla/chunk.py +193 -0
- tileops-0.1.0/src/tileops/_ops/linear_attention/gla/fwd.py +122 -0
- tileops-0.1.0/src/tileops/_ops/linear_attention/gla/recurrent.py +88 -0
- tileops-0.1.0/src/tileops/_ops/linear_attention/kda.py +197 -0
- tileops-0.1.0/src/tileops/_ops/mamba/__init__.py +22 -0
- tileops-0.1.0/src/tileops/_ops/mamba/causal_conv1d.py +183 -0
- tileops-0.1.0/src/tileops/_ops/mamba/mamba2_fwd.py +153 -0
- tileops-0.1.0/src/tileops/_ops/mamba/selective_scan.py +128 -0
- tileops-0.1.0/src/tileops/_ops/mamba/ssd_chunk_coupling.py +81 -0
- tileops-0.1.0/src/tileops/_ops/mamba/ssd_chunk_cumsum.py +98 -0
- tileops-0.1.0/src/tileops/_ops/mamba/ssd_chunk_scan.py +99 -0
- tileops-0.1.0/src/tileops/_ops/mamba/ssd_chunk_state.py +109 -0
- tileops-0.1.0/src/tileops/_ops/mamba/ssd_recurrent.py +92 -0
- tileops-0.1.0/src/tileops/_ops/mamba/ssd_state_passing.py +88 -0
- tileops-0.1.0/src/tileops/_ops/moe/__init__.py +51 -0
- tileops-0.1.0/src/tileops/_ops/moe/abc.py +185 -0
- tileops-0.1.0/src/tileops/_ops/moe/contracts.py +137 -0
- tileops-0.1.0/src/tileops/_ops/moe/fused_moe.py +234 -0
- tileops-0.1.0/src/tileops/_ops/moe/fused_moe_shared_expert.py +165 -0
- tileops-0.1.0/src/tileops/_ops/moe/fused_topk.py +125 -0
- tileops-0.1.0/src/tileops/_ops/moe/moe_grouped_gemm_fp8.py +132 -0
- tileops-0.1.0/src/tileops/_ops/moe/permute_align.py +89 -0
- tileops-0.1.0/src/tileops/_ops/moe/prepare_finalize/__init__.py +5 -0
- tileops-0.1.0/src/tileops/_ops/moe/prepare_finalize/no_dp_ep.py +47 -0
- tileops-0.1.0/src/tileops/_ops/moe/routed_expert/__init__.py +9 -0
- tileops-0.1.0/src/tileops/_ops/moe/routed_expert/fused_routed_expert.py +161 -0
- tileops-0.1.0/src/tileops/_ops/moe/routed_expert/indexed_routed_expert.py +135 -0
- tileops-0.1.0/src/tileops/_ops/moe/shared_expert_mlp.py +75 -0
- tileops-0.1.0/src/tileops/_ops/moe/staged.py +434 -0
- tileops-0.1.0/src/tileops/_ops/norm/__init__.py +26 -0
- tileops-0.1.0/src/tileops/_ops/norm/ada_layer_norm.py +80 -0
- tileops-0.1.0/src/tileops/_ops/norm/ada_layer_norm_zero.py +85 -0
- tileops-0.1.0/src/tileops/_ops/norm/affine.py +21 -0
- tileops-0.1.0/src/tileops/_ops/norm/batch_norm.py +279 -0
- tileops-0.1.0/src/tileops/_ops/norm/fused_add_layer_norm.py +96 -0
- tileops-0.1.0/src/tileops/_ops/norm/fused_add_rms_norm.py +91 -0
- tileops-0.1.0/src/tileops/_ops/norm/fused_add_rms_norm_per_token_quant.py +130 -0
- tileops-0.1.0/src/tileops/_ops/norm/fused_qk_norm_rope.py +121 -0
- tileops-0.1.0/src/tileops/_ops/norm/group_norm.py +110 -0
- tileops-0.1.0/src/tileops/_ops/norm/instance_norm.py +173 -0
- tileops-0.1.0/src/tileops/_ops/norm/layer_norm.py +84 -0
- tileops-0.1.0/src/tileops/_ops/norm/rms_norm.py +93 -0
- tileops-0.1.0/src/tileops/_ops/op_base.py +1725 -0
- tileops-0.1.0/src/tileops/_ops/pool/__init__.py +31 -0
- tileops-0.1.0/src/tileops/_ops/pool/adaptive_pool.py +161 -0
- tileops-0.1.0/src/tileops/_ops/pool/avg_pool.py +182 -0
- tileops-0.1.0/src/tileops/_ops/pool/max_pool.py +373 -0
- tileops-0.1.0/src/tileops/_ops/pool/mean_pooling.py +147 -0
- tileops-0.1.0/src/tileops/_ops/pool/parameters.py +6 -0
- tileops-0.1.0/src/tileops/_ops/quantization/__init__.py +27 -0
- tileops-0.1.0/src/tileops/_ops/quantization/fp8_quant.py +70 -0
- tileops-0.1.0/src/tileops/_ops/quantization/fp8_quant_per_block.py +74 -0
- tileops-0.1.0/src/tileops/_ops/quantization/int4_quant_per_group.py +79 -0
- tileops-0.1.0/src/tileops/_ops/quantization/int8_dequant.py +188 -0
- tileops-0.1.0/src/tileops/_ops/quantization/int8_quant_per_block.py +77 -0
- tileops-0.1.0/src/tileops/_ops/quantization/int8_quant_per_channel.py +72 -0
- tileops-0.1.0/src/tileops/_ops/quantization/int8_quant_per_tensor.py +69 -0
- tileops-0.1.0/src/tileops/_ops/quantization/smooth_quant.py +73 -0
- tileops-0.1.0/src/tileops/_ops/reduction/__init__.py +46 -0
- tileops-0.1.0/src/tileops/_ops/reduction/argreduce.py +75 -0
- tileops-0.1.0/src/tileops/_ops/reduction/cumulative.py +137 -0
- tileops-0.1.0/src/tileops/_ops/reduction/logical_reduce.py +111 -0
- tileops-0.1.0/src/tileops/_ops/reduction/reduce.py +370 -0
- tileops-0.1.0/src/tileops/_ops/reduction/softmax.py +185 -0
- tileops-0.1.0/src/tileops/_ops/reduction/vector_norm.py +79 -0
- tileops-0.1.0/src/tileops/_ops/rope.py +729 -0
- tileops-0.1.0/src/tileops/_ops/sampling/__init__.py +15 -0
- tileops-0.1.0/src/tileops/_ops/sampling/chain_speculative_sampling.py +100 -0
- tileops-0.1.0/src/tileops/_ops/sampling/min_p_mask.py +66 -0
- tileops-0.1.0/src/tileops/_ops/sampling/sampling_from_probs.py +75 -0
- tileops-0.1.0/src/tileops/_ops/sampling/top_k_mask.py +68 -0
- tileops-0.1.0/src/tileops/_ops/sampling/top_k_top_p_mask.py +77 -0
- tileops-0.1.0/src/tileops/_ops/sampling/top_p_mask.py +67 -0
- tileops-0.1.0/src/tileops/_ops/sequence_modeling/__init__.py +11 -0
- tileops-0.1.0/src/tileops/_ops/sequence_modeling/engram.py +188 -0
- tileops-0.1.0/src/tileops/_ops/sequence_modeling/engram_decode.py +103 -0
- tileops-0.1.0/src/tileops/_ops/sequence_modeling/mhc.py +158 -0
- tileops-0.1.0/src/tileops/_ops/transform/__init__.py +5 -0
- tileops-0.1.0/src/tileops/_ops/transform/hadamard_transform.py +96 -0
- tileops-0.1.0/src/tileops/_perf/__init__.py +17 -0
- tileops-0.1.0/src/tileops/_perf/formulas.py +1071 -0
- tileops-0.1.0/src/tileops/_perf/profile.py +162 -0
- tileops-0.1.0/src/tileops/_perf/profiles/__init__.py +1 -0
- tileops-0.1.0/src/tileops/_perf/profiles/h200.yaml +59 -0
- tileops-0.1.0/src/tileops/_utils/__init__.py +25 -0
- tileops-0.1.0/src/tileops/_utils/device.py +53 -0
- tileops-0.1.0/src/tileops/_utils/utils.py +122 -0
- tileops-0.1.0/src/tileops/attention.py +51 -0
- tileops-0.1.0/src/tileops/authoring/__init__.py +15 -0
- tileops-0.1.0/src/tileops/backend/__init__.py +106 -0
- tileops-0.1.0/src/tileops/backend/_dispatch.py +208 -0
- tileops-0.1.0/src/tileops/backend/_errors.py +21 -0
- tileops-0.1.0/src/tileops/backend/_protocol.py +78 -0
- tileops-0.1.0/src/tileops/backend/_registry.py +276 -0
- tileops-0.1.0/src/tileops/convolution.py +9 -0
- tileops-0.1.0/src/tileops/csrc/approx_math.h +21 -0
- tileops-0.1.0/src/tileops/csrc/bulk_prefetch.h +17 -0
- tileops-0.1.0/src/tileops/csrc/bulk_zero.h +35 -0
- tileops-0.1.0/src/tileops/csrc/cluster_partials.h +46 -0
- tileops-0.1.0/src/tileops/csrc/dense_wgmma_helper.h +191 -0
- tileops-0.1.0/src/tileops/csrc/dq_landing.h +45 -0
- tileops-0.1.0/src/tileops/csrc/fp8_1d2d_helper.h +321 -0
- tileops-0.1.0/src/tileops/csrc/fp8_gqa_helper.h +765 -0
- tileops-0.1.0/src/tileops/csrc/fp8_paged_helper.h +82 -0
- tileops-0.1.0/src/tileops/csrc/gdn_inverse_helper.h +467 -0
- tileops-0.1.0/src/tileops/csrc/gdn_scan_helper.h +211 -0
- tileops-0.1.0/src/tileops/csrc/kda_prefill_helper.h +10 -0
- tileops-0.1.0/src/tileops/csrc/lightning_indexer_helper.h +131 -0
- tileops-0.1.0/src/tileops/csrc/mla_bwd_wgmma.h +150 -0
- tileops-0.1.0/src/tileops/csrc/moe_grouped_gemm_fp8_helper.h +190 -0
- tileops-0.1.0/src/tileops/csrc/row_gather.h +81 -0
- tileops-0.1.0/src/tileops/csrc/streaming_load.h +117 -0
- tileops-0.1.0/src/tileops/csrc/tile_claim.h +22 -0
- tileops-0.1.0/src/tileops/csrc/top_k_mask_helper.h +30 -0
- tileops-0.1.0/src/tileops/csrc/trace_helper.h +18 -0
- tileops-0.1.0/src/tileops/csrc/value_wait_anchor.h +24 -0
- tileops-0.1.0/src/tileops/csrc/w4a16_decode_helper.h +75 -0
- tileops-0.1.0/src/tileops/csrc/w4a8_decode_helper.h +381 -0
- tileops-0.1.0/src/tileops/csrc/w4a8_prefill_helper.h +344 -0
- tileops-0.1.0/src/tileops/csrc/warp_uniform.h +36 -0
- tileops-0.1.0/src/tileops/csrc/wgmma_rows.h +92 -0
- tileops-0.1.0/src/tileops/elementwise.py +145 -0
- tileops-0.1.0/src/tileops/fft.py +7 -0
- tileops-0.1.0/src/tileops/gemm.py +23 -0
- tileops-0.1.0/src/tileops/linear_attention.py +27 -0
- tileops-0.1.0/src/tileops/mamba.py +27 -0
- tileops-0.1.0/src/tileops/manifest/__init__.py +208 -0
- tileops-0.1.0/src/tileops/manifest/_dtype_rules.py +37 -0
- tileops-0.1.0/src/tileops/manifest/_expr.py +709 -0
- tileops-0.1.0/src/tileops/manifest/_kinds.py +389 -0
- tileops-0.1.0/src/tileops/manifest/_plan.py +911 -0
- tileops-0.1.0/src/tileops/manifest/_registry.py +17 -0
- tileops-0.1.0/src/tileops/manifest/_signature.py +783 -0
- tileops-0.1.0/src/tileops/manifest/_values.py +166 -0
- tileops-0.1.0/src/tileops/manifest/_workload.py +732 -0
- tileops-0.1.0/src/tileops/manifest/primitives.py +778 -0
- tileops-0.1.0/src/tileops/manifest/spec/attention.yaml +920 -0
- tileops-0.1.0/src/tileops/manifest/spec/attention_indexing.yaml +73 -0
- tileops-0.1.0/src/tileops/manifest/spec/convolution.yaml +178 -0
- tileops-0.1.0/src/tileops/manifest/spec/elementwise_binary.yaml +622 -0
- tileops-0.1.0/src/tileops/manifest/spec/elementwise_fused_gated.yaml +59 -0
- tileops-0.1.0/src/tileops/manifest/spec/elementwise_generative.yaml +68 -0
- tileops-0.1.0/src/tileops/manifest/spec/elementwise_multi_input.yaml +55 -0
- tileops-0.1.0/src/tileops/manifest/spec/elementwise_unary_activation.yaml +377 -0
- tileops-0.1.0/src/tileops/manifest/spec/elementwise_unary_math.yaml +512 -0
- tileops-0.1.0/src/tileops/manifest/spec/fft.yaml +42 -0
- tileops-0.1.0/src/tileops/manifest/spec/gemm.yaml +454 -0
- tileops-0.1.0/src/tileops/manifest/spec/gemm_bmm.yaml +77 -0
- tileops-0.1.0/src/tileops/manifest/spec/linear_attention.yaml +696 -0
- tileops-0.1.0/src/tileops/manifest/spec/mamba.yaml +389 -0
- tileops-0.1.0/src/tileops/manifest/spec/moe.yaml +659 -0
- tileops-0.1.0/src/tileops/manifest/spec/norm.yaml +385 -0
- tileops-0.1.0/src/tileops/manifest/spec/pool.yaml +553 -0
- tileops-0.1.0/src/tileops/manifest/spec/quantization.yaml +260 -0
- tileops-0.1.0/src/tileops/manifest/spec/reduction.yaml +447 -0
- tileops-0.1.0/src/tileops/manifest/spec/reduction_scan.yaml +59 -0
- tileops-0.1.0/src/tileops/manifest/spec/rope.yaml +197 -0
- tileops-0.1.0/src/tileops/manifest/spec/sampling.yaml +193 -0
- tileops-0.1.0/src/tileops/manifest/spec/sequence_modeling.yaml +181 -0
- tileops-0.1.0/src/tileops/manifest/spec/transform.yaml +38 -0
- tileops-0.1.0/src/tileops/manifest/spec/types.yaml +15 -0
- tileops-0.1.0/src/tileops/moe.py +38 -0
- tileops-0.1.0/src/tileops/norm.py +31 -0
- tileops-0.1.0/src/tileops/pool.py +33 -0
- tileops-0.1.0/src/tileops/quantization.py +27 -0
- tileops-0.1.0/src/tileops/reduction.py +45 -0
- tileops-0.1.0/src/tileops/rope.py +17 -0
- tileops-0.1.0/src/tileops/sampling.py +19 -0
- tileops-0.1.0/src/tileops/sequence_modeling.py +17 -0
- tileops-0.1.0/src/tileops/trace/__init__.py +33 -0
- tileops-0.1.0/src/tileops/trace/_api.py +472 -0
- tileops-0.1.0/src/tileops/trace/_decode.py +285 -0
- tileops-0.1.0/src/tileops/trace/_markers.py +113 -0
- tileops-0.1.0/src/tileops/trace/_passes.py +346 -0
- tileops-0.1.0/src/tileops/trace/_record.py +136 -0
- tileops-0.1.0/src/tileops/trace/_state.py +198 -0
- tileops-0.1.0/src/tileops/trace/_ui.py +441 -0
- tileops-0.1.0/src/tileops/transform.py +11 -0
- tileops-0.1.0/src/tileops.egg-info/PKG-INFO +195 -0
- tileops-0.1.0/src/tileops.egg-info/SOURCES.txt +507 -0
- tileops-0.1.0/src/tileops.egg-info/requires.txt +3 -0
- tileops-0.1.0/src/tileops.egg-info/scm_file_list.json +928 -0
- tileops-0.1.0/src/tileops.egg-info/scm_version.json +8 -0
- tileops-0.1.0/src/tileops.egg-info/top_level.txt +1 -0
- tileops-0.0.1.dev2/LICENSE +0 -21
- tileops-0.0.1.dev2/PKG-INFO +0 -147
- tileops-0.0.1.dev2/README.md +0 -119
- tileops-0.0.1.dev2/pyproject.toml +0 -84
- tileops-0.0.1.dev2/setup.py +0 -44
- tileops-0.0.1.dev2/tests/test_bitnet.py +0 -34
- tileops-0.0.1.dev2/tests/test_blocksparse_attention.py +0 -62
- tileops-0.0.1.dev2/tests/test_gqa.py +0 -57
- tileops-0.0.1.dev2/tests/test_gqa_decode.py +0 -42
- tileops-0.0.1.dev2/tests/test_linear_attn_fused_chunk.py +0 -20
- tileops-0.0.1.dev2/tests/test_linear_attn_fused_recurrent.py +0 -20
- tileops-0.0.1.dev2/tests/test_mamba_chunk_scan.py +0 -68
- tileops-0.0.1.dev2/tests/test_mamba_chunk_state.py +0 -61
- tileops-0.0.1.dev2/tests/test_mha.py +0 -22
- tileops-0.0.1.dev2/tests/test_mha_decode.py +0 -21
- tileops-0.0.1.dev2/tests/test_mla.py +0 -36
- tileops-0.0.1.dev2/tests/test_sparse_mla.py +0 -57
- tileops-0.0.1.dev2/tileops.egg-info/PKG-INFO +0 -147
- tileops-0.0.1.dev2/tileops.egg-info/SOURCES.txt +0 -35
- tileops-0.0.1.dev2/tileops.egg-info/requires.txt +0 -18
- tileops-0.0.1.dev2/tileops.egg-info/top_level.txt +0 -4
- tileops-0.0.1.dev2/top/__init__.py +0 -16
- tileops-0.0.1.dev2/top/kernel/__init__.py +0 -15
- tileops-0.0.1.dev2/top/kernel/bitnet.py +0 -490
- tileops-0.0.1.dev2/top/kernel/blocksparse_attention.py +0 -605
- tileops-0.0.1.dev2/top/kernel/gqa.py +0 -1079
- tileops-0.0.1.dev2/top/kernel/linear_attention/linear_attn.py +0 -490
- tileops-0.0.1.dev2/top/kernel/mamba_chunk_scan.py +0 -335
- tileops-0.0.1.dev2/top/kernel/mamba_chunk_state.py +0 -269
- tileops-0.0.1.dev2/top/kernel/mha.py +0 -920
- tileops-0.0.1.dev2/top/kernel/mla.py +0 -311
- tileops-0.0.1.dev2/top/kernel/sparse_mla.py +0 -502
- tileops-0.0.1.dev2/top/utils/__init__.py +0 -1
- tileops-0.0.1.dev2/top/utils/utils.py +0 -55
- {tileops-0.0.1.dev2 → tileops-0.1.0}/setup.cfg +0 -0
- /tileops-0.0.1.dev2/top/kernel/linear_attention/__init__.py → /tileops-0.1.0/src/tileops/py.typed +0 -0
- {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).
|
tileops-0.1.0/README.md
ADDED
|
@@ -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.
|