tileops 0.0.1.dev0__py3-none-any.whl

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.
@@ -0,0 +1,82 @@
1
+ Metadata-Version: 2.4
2
+ Name: tileops
3
+ Version: 0.0.1.dev0
4
+ Summary: TileOPs kernels for efficient inference
5
+ Author: Tile-AI
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/tile-ai/tileops
8
+ Project-URL: Bug Tracker, https://github.com/tile-ai/tileops/issues
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Programming Language :: Python :: 3
11
+ Requires-Python: >=3.8
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: torch
15
+ Requires-Dist: tilelang
16
+ Dynamic: license-file
17
+
18
+ # TileOPs (TOP)
19
+
20
+ **TileOPs (TOP)** is a high-performance machine learning operator collections built to run on the [TileLang](https://github.com/tile-ai/tilelang) backend. It offers efficient, modular, and composable implementations optimized for AI workloads.
21
+
22
+ ---
23
+
24
+
25
+ ## 📦 Installation
26
+
27
+ ### Requirements
28
+
29
+ - Python 3.8+
30
+ - PyTorch >= 2.1
31
+ - [TileLang](https://github.com/tilelang/tilelang)
32
+ - Triton (optional, for selected fast kernels)
33
+
34
+ ### Install (editable mode for development)
35
+
36
+ ```bash
37
+ git clone https://github.com/tile-ai/TileOPs
38
+ cd TileOPs
39
+ git submodule update --init --recursive
40
+ pip install -e .
41
+ ```
42
+
43
+ ## 🚀 Quick Usage
44
+
45
+ ```python
46
+ import torch
47
+ import top
48
+ from top import MLAKernel
49
+
50
+ device = "cuda"
51
+ dtype = torch.float16
52
+
53
+ batch = 128
54
+ heads = 64
55
+ kv_heads = 1
56
+ kv_ctx = 8192
57
+ dim = 512
58
+ pe_dim = 64
59
+
60
+ # Query input: [batch, heads, dim]
61
+ q = torch.randn(batch, heads, dim, device=device, dtype=dtype)
62
+
63
+ # Query positional encoding: [batch, heads, pe_dim]
64
+ q_pe = torch.randn(batch, heads, pe_dim, device=device, dtype=dtype)
65
+
66
+ # KV cache input: [batch, kv_ctx, kv_heads, dim]
67
+ kv = torch.randn(batch, kv_ctx, kv_heads, dim, device=device, dtype=dtype)
68
+
69
+ # KV positional encoding: [batch, kv_ctx, kv_heads, pe_dim]
70
+ k_pe = torch.randn(batch, kv_ctx, kv_heads, pe_dim, device=device, dtype=dtype)
71
+
72
+ # Use MLA kernel
73
+ block_N = 64
74
+ block_H = 64
75
+ num_split = 1
76
+
77
+ mla = MLAKernel(batch, heads, kv_heads, kv_ctx, dim, pe_dim, block_N, block_H, num_split)
78
+
79
+ out = mla(q, q_pe, kv, k_pe)
80
+ ```
81
+
82
+ ## Acknowledgments
@@ -0,0 +1,6 @@
1
+ tileops-0.0.1.dev0.dist-info/licenses/LICENSE,sha256=hr_8lcbfSW8PTqqDHjB_EfPueXTmbaAz7nDy2F97vl0,1126
2
+ top/__init__.py,sha256=HZiXk6QxdAcFqHnRvXeVE797P22yDK7MlLDvkk4V5F0,847
3
+ tileops-0.0.1.dev0.dist-info/METADATA,sha256=Cwnh1OJkSy9JsrwE_cSXM7ASakyt2VWB2l7sLh69rGA,2008
4
+ tileops-0.0.1.dev0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
5
+ tileops-0.0.1.dev0.dist-info/top_level.txt,sha256=994pR8ZMtkNeFfsr7zWdHtX2NWsq67eyBTXjdykE5ts,4
6
+ tileops-0.0.1.dev0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -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 @@
1
+ top
top/__init__.py ADDED
@@ -0,0 +1,18 @@
1
+ # Copyright (c) Tile-AI.
2
+ # Licensed under the MIT License.
3
+
4
+ from .kernel.mha import MHAKernel, MHADecodeKernel
5
+ from .kernel.mla import MLAKernel
6
+ from .kernel.gqa import GQAKernel, GQADecodeKernel
7
+ from .kernel.mamba_chunk_scan import MambaChunkScanKernel
8
+ from .kernel.mamba_chunk_state import MambaChunkStateKernel
9
+ from .kernel.blocksparse_attention import BlockSparseAttentionKernel
10
+ from .kernel.linear_attention.linear_attn import LinearAttentionFusedChunkKernel, LinearAttentionFusedRecurrentKernel
11
+ from .kernel.bitnet import Bitnet_158_int8xint2_kernel
12
+
13
+ __all__ = [
14
+ "MHAKernel", "MHADecodeKernel", "MLAKernel", "GQAKernel", "GQADecodeKernel",
15
+ "MambaChunkScanKernel", "MambaChunkStateKernel", "BlockSparseAttentionKernel",
16
+ "LinearAttentionFusedChunkKernel", "LinearAttentionFusedRecurrentKernel",
17
+ "Bitnet_158_int8xint2_kernel"
18
+ ]