tico 0.1.0.dev251027__py3-none-any.whl → 0.1.0.dev251029__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.
Potentially problematic release.
This version of tico might be problematic. Click here for more details.
- tico/__init__.py +1 -1
- {tico-0.1.0.dev251027.dist-info → tico-0.1.0.dev251029.dist-info}/METADATA +44 -1
- {tico-0.1.0.dev251027.dist-info → tico-0.1.0.dev251029.dist-info}/RECORD +7 -7
- {tico-0.1.0.dev251027.dist-info → tico-0.1.0.dev251029.dist-info}/LICENSE +0 -0
- {tico-0.1.0.dev251027.dist-info → tico-0.1.0.dev251029.dist-info}/WHEEL +0 -0
- {tico-0.1.0.dev251027.dist-info → tico-0.1.0.dev251029.dist-info}/entry_points.txt +0 -0
- {tico-0.1.0.dev251027.dist-info → tico-0.1.0.dev251029.dist-info}/top_level.txt +0 -0
tico/__init__.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: tico
|
|
3
|
-
Version: 0.1.0.
|
|
3
|
+
Version: 0.1.0.dev251029
|
|
4
4
|
Summary: Convert exported Torch module to circle
|
|
5
5
|
Home-page: UNKNOWN
|
|
6
6
|
License: UNKNOWN
|
|
@@ -30,6 +30,7 @@ designed for optimized on-device neural network inference.
|
|
|
30
30
|
- [From torch module](#from-torch-module)
|
|
31
31
|
- [From .pt2](#from-pt2)
|
|
32
32
|
- [Running circle models directly in Python](#running-circle-models-directly-in-python)
|
|
33
|
+
- [Quantization](#quantization)
|
|
33
34
|
|
|
34
35
|
### For Developers
|
|
35
36
|
|
|
@@ -188,6 +189,48 @@ circle_model(*example_inputs)
|
|
|
188
189
|
# numpy.ndarray([2., 2., 2., 2.], dtype=float32)
|
|
189
190
|
```
|
|
190
191
|
|
|
192
|
+
### Quantization
|
|
193
|
+
|
|
194
|
+
The `tico.quantization` module provides a unified and modular interface for quantizing
|
|
195
|
+
large language models (LLMs) and other neural networks.
|
|
196
|
+
|
|
197
|
+
It introduces a simple two-step workflow — **prepare** and **convert** — that
|
|
198
|
+
abstracts the details of different quantization algorithms.
|
|
199
|
+
|
|
200
|
+
#### Basic Usage
|
|
201
|
+
|
|
202
|
+
```python
|
|
203
|
+
from tico.quantization import prepare, convert
|
|
204
|
+
from tico.quantization.config.gptq import GPTQConfig
|
|
205
|
+
import torch
|
|
206
|
+
import torch.nn as nn
|
|
207
|
+
|
|
208
|
+
class LinearModel(nn.Module):
|
|
209
|
+
def __init__(self):
|
|
210
|
+
super().__init__()
|
|
211
|
+
self.linear = nn.Linear(8, 8)
|
|
212
|
+
|
|
213
|
+
def forward(self, x):
|
|
214
|
+
return self.linear(x)
|
|
215
|
+
|
|
216
|
+
model = LinearModel().eval()
|
|
217
|
+
|
|
218
|
+
# 1. Prepare for quantization
|
|
219
|
+
quant_config = GPTQConfig()
|
|
220
|
+
prepared_model = prepare(model, quant_config)
|
|
221
|
+
|
|
222
|
+
# 2. Calibration
|
|
223
|
+
for d in dataset:
|
|
224
|
+
prepared_model(d)
|
|
225
|
+
|
|
226
|
+
# 3. Apply GPTQ
|
|
227
|
+
quantized_model = convert(prepared_model, quant_config)
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
For detailed documentation, design notes, and contributing guidelines,
|
|
231
|
+
see [tico/quantization/README.md](./tico/quantization/README.md).
|
|
232
|
+
|
|
233
|
+
|
|
191
234
|
## For Developers
|
|
192
235
|
|
|
193
236
|
### Testing & Code Formatting
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
tico/__init__.py,sha256=
|
|
1
|
+
tico/__init__.py,sha256=vbSvQfCSAZ7-nHpw217iR32PZLzqlJ-reIS6dP3CcNQ,1883
|
|
2
2
|
tico/pt2_to_circle.py,sha256=gu3MD4Iqc0zMZcCZ2IT8oGbyj21CTSbT3Rgd9s2B_9A,2767
|
|
3
3
|
tico/config/__init__.py,sha256=xZzCXjZ84qE-CsBi-dfaL05bqpQ3stKKfTXhnrJRyVs,142
|
|
4
4
|
tico/config/base.py,sha256=q5xMqGxTUZs4mFqt5c7i_y9U00fYgdMGl9nUqIVMlCo,1248
|
|
@@ -263,9 +263,9 @@ tico/utils/mx/__init__.py,sha256=IO6FP_xYbGy0dW0HL26GXD3ouxARaxCK7bz9dn4blPQ,26
|
|
|
263
263
|
tico/utils/mx/elemwise_ops.py,sha256=V6glyAHsVR1joqpsgnNytatCD_ew92xNWZ19UFDoMTA,10281
|
|
264
264
|
tico/utils/mx/formats.py,sha256=uzNWyu-1onUlwQfX5cZ6fZSUfHMRqorper7_T1k3jfk,3404
|
|
265
265
|
tico/utils/mx/mx_ops.py,sha256=RcfUTYVi-wilGB2sC35OeARdwDqnixv7dG5iyZ-fQT8,8555
|
|
266
|
-
tico-0.1.0.
|
|
267
|
-
tico-0.1.0.
|
|
268
|
-
tico-0.1.0.
|
|
269
|
-
tico-0.1.0.
|
|
270
|
-
tico-0.1.0.
|
|
271
|
-
tico-0.1.0.
|
|
266
|
+
tico-0.1.0.dev251029.dist-info/LICENSE,sha256=kp4JLII7bzRhPb0CPD5XTDZMh22BQ7h3k3B7t8TiSbw,12644
|
|
267
|
+
tico-0.1.0.dev251029.dist-info/METADATA,sha256=3lWXngZVcC-Seo-HihoTqJxADNSblbYAXCW_8FlJB8k,9548
|
|
268
|
+
tico-0.1.0.dev251029.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
269
|
+
tico-0.1.0.dev251029.dist-info/entry_points.txt,sha256=kBKYSS_IYrSXmUYevmmepqIVPScq5vF8ulQRu3I_Zf0,59
|
|
270
|
+
tico-0.1.0.dev251029.dist-info/top_level.txt,sha256=oqs7UPoNSKZEwqsX8B-KAWdQwfAa7i60pbxW_Jk7P3w,5
|
|
271
|
+
tico-0.1.0.dev251029.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|