tico 0.1.0.dev250824__py3-none-any.whl → 0.1.0.dev250826__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.
- tico/__init__.py +1 -1
- tico/experimental/quantization/ptq/examples/__init__.py +1 -0
- tico/experimental/quantization/ptq/examples/quantize_linear.py +106 -0
- tico/experimental/quantization/ptq/wrappers/nn/__init__.py +6 -0
- tico/experimental/quantization/ptq/wrappers/nn/quant_layernorm.py +184 -0
- tico/experimental/quantization/ptq/wrappers/nn/quant_silu.py +61 -0
- tico/experimental/quantization/ptq/wrappers/ptq_wrapper.py +18 -1
- tico/experimental/quantization/ptq/wrappers/quant_module_base.py +17 -3
- tico/experimental/quantization/ptq/wrappers/registry.py +3 -0
- {tico-0.1.0.dev250824.dist-info → tico-0.1.0.dev250826.dist-info}/METADATA +1 -1
- {tico-0.1.0.dev250824.dist-info → tico-0.1.0.dev250826.dist-info}/RECORD +15 -11
- {tico-0.1.0.dev250824.dist-info → tico-0.1.0.dev250826.dist-info}/LICENSE +0 -0
- {tico-0.1.0.dev250824.dist-info → tico-0.1.0.dev250826.dist-info}/WHEEL +0 -0
- {tico-0.1.0.dev250824.dist-info → tico-0.1.0.dev250826.dist-info}/entry_points.txt +0 -0
- {tico-0.1.0.dev250824.dist-info → tico-0.1.0.dev250826.dist-info}/top_level.txt +0 -0
tico/__init__.py
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
# DO NOT REMOVE THIS FILE
|
@@ -0,0 +1,106 @@
|
|
1
|
+
# Copyright (c) 2025 Samsung Electronics Co., Ltd. All Rights Reserved
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
# =============================================================================
|
16
|
+
# POST-TRAINING QUANTIZATION EXAMPLE — Simple Linear Model
|
17
|
+
# -----------------------------------------------------------------------------
|
18
|
+
# This demo shows a minimal PTQ flow for a toy model:
|
19
|
+
# 1. Define a simple model with a single Linear layer.
|
20
|
+
# 2. Replace the FP32 Linear with a QuantLinear wrapper.
|
21
|
+
# 3. Run a short calibration pass to collect activation statistics.
|
22
|
+
# 4. Freeze scales / zero-points and switch to INT-simulation mode.
|
23
|
+
# 5. Compare INT vs FP32 outputs with a mean-absolute-diff check.
|
24
|
+
# 6. Export the quantized model to a Circle format.
|
25
|
+
# =============================================================================
|
26
|
+
|
27
|
+
import pathlib
|
28
|
+
|
29
|
+
import torch
|
30
|
+
import torch.nn as nn
|
31
|
+
|
32
|
+
from tico.experimental.quantization.evaluation.metric import compute_peir
|
33
|
+
from tico.experimental.quantization.evaluation.utils import plot_two_outputs
|
34
|
+
|
35
|
+
from tico.experimental.quantization.ptq.mode import Mode
|
36
|
+
from tico.experimental.quantization.ptq.wrappers.nn.quant_linear import QuantLinear
|
37
|
+
from tico.utils.utils import SuppressWarning
|
38
|
+
|
39
|
+
# -------------------------------------------------------------------------
|
40
|
+
# 0. Define a toy model (1 Linear layer only)
|
41
|
+
# -------------------------------------------------------------------------
|
42
|
+
class TinyLinearModel(nn.Module):
|
43
|
+
"""A minimal model: single Linear layer."""
|
44
|
+
|
45
|
+
def __init__(self, in_features=16, out_features=8):
|
46
|
+
super().__init__()
|
47
|
+
self.fc = nn.Linear(in_features, out_features, bias=False)
|
48
|
+
|
49
|
+
def forward(self, x):
|
50
|
+
return self.fc(x)
|
51
|
+
|
52
|
+
|
53
|
+
# Instantiate FP32 model
|
54
|
+
model = TinyLinearModel()
|
55
|
+
model.eval()
|
56
|
+
|
57
|
+
# Keep FP32 reference for diff check
|
58
|
+
fp32_layer = model.fc
|
59
|
+
|
60
|
+
# -------------------------------------------------------------------------
|
61
|
+
# 1. Replace the Linear with QuantLinear wrapper
|
62
|
+
# -------------------------------------------------------------------------
|
63
|
+
model.fc = QuantLinear(fp32_layer) # type: ignore[assignment]
|
64
|
+
# model.fc = PTQWrapper(fp32_layer) (Wrapping helper class)
|
65
|
+
qlayer = model.fc # alias for brevity
|
66
|
+
|
67
|
+
# -------------------------------------------------------------------------
|
68
|
+
# 2. Single-pass calibration (collect activation ranges)
|
69
|
+
# -------------------------------------------------------------------------
|
70
|
+
assert isinstance(qlayer, QuantLinear)
|
71
|
+
with torch.no_grad():
|
72
|
+
qlayer.enable_calibration()
|
73
|
+
for _ in range(16): # small toy batch
|
74
|
+
x = torch.randn(4, 16) # (batch=4, features=16)
|
75
|
+
_ = model(x)
|
76
|
+
qlayer.freeze_qparams() # lock scales & zero-points
|
77
|
+
|
78
|
+
assert qlayer._mode is Mode.QUANT, "Quantization mode should be active now."
|
79
|
+
|
80
|
+
# -------------------------------------------------------------------------
|
81
|
+
# 3. Quick INT-sim vs FP32 sanity check
|
82
|
+
# -------------------------------------------------------------------------
|
83
|
+
x = torch.randn(2, 16)
|
84
|
+
with torch.no_grad():
|
85
|
+
int8_out = model(x)
|
86
|
+
fp32_out = fp32_layer(x)
|
87
|
+
|
88
|
+
print("┌───────────── Quantization Error Summary ─────────────")
|
89
|
+
print(f"│ Mean |diff|: {(int8_out - fp32_out).abs().mean().item():.6f}")
|
90
|
+
print(f"│ PEIR : {compute_peir(fp32_out, int8_out) * 100:.6f} %")
|
91
|
+
print("└──────────────────────────────────────────────────────")
|
92
|
+
print(plot_two_outputs(fp32_out, int8_out))
|
93
|
+
|
94
|
+
# -------------------------------------------------------------------------
|
95
|
+
# 4. Export the calibrated model to Circle
|
96
|
+
# -------------------------------------------------------------------------
|
97
|
+
import tico
|
98
|
+
|
99
|
+
save_path = pathlib.Path("tiny_linear.q.circle")
|
100
|
+
example_input = torch.randn(1, 16)
|
101
|
+
|
102
|
+
with SuppressWarning(UserWarning, ".*"):
|
103
|
+
cm = tico.convert(model, (example_input,)) # forward(x) only
|
104
|
+
cm.save(save_path)
|
105
|
+
|
106
|
+
print(f"Quantized Circle model saved to {save_path.resolve()}")
|
@@ -1,5 +1,11 @@
|
|
1
|
+
from tico.experimental.quantization.ptq.wrappers.nn.quant_layernorm import (
|
2
|
+
QuantLayerNorm,
|
3
|
+
)
|
1
4
|
from tico.experimental.quantization.ptq.wrappers.nn.quant_linear import QuantLinear
|
5
|
+
from tico.experimental.quantization.ptq.wrappers.nn.quant_silu import QuantSiLU
|
2
6
|
|
3
7
|
__all__ = [
|
8
|
+
"QuantLayerNorm",
|
4
9
|
"QuantLinear",
|
10
|
+
"QuantSiLU",
|
5
11
|
]
|
@@ -0,0 +1,184 @@
|
|
1
|
+
# Copyright (c) 2025 Samsung Electronics Co., Ltd. All Rights Reserved
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
from typing import Iterable, Optional, Tuple
|
16
|
+
|
17
|
+
import torch
|
18
|
+
import torch.nn as nn
|
19
|
+
|
20
|
+
from tico.experimental.quantization.ptq.mode import Mode
|
21
|
+
from tico.experimental.quantization.ptq.quant_config import QuantConfig
|
22
|
+
from tico.experimental.quantization.ptq.wrappers.quant_module_base import (
|
23
|
+
QuantModuleBase,
|
24
|
+
)
|
25
|
+
from tico.experimental.quantization.ptq.wrappers.registry import register
|
26
|
+
|
27
|
+
|
28
|
+
@register(nn.LayerNorm)
|
29
|
+
class QuantLayerNorm(QuantModuleBase):
|
30
|
+
"""
|
31
|
+
QuantLayerNorm — drop-in replacement for nn.LayerNorm that quantizes
|
32
|
+
the elementary steps:
|
33
|
+
1) μ = mean(x, dims) (mean)
|
34
|
+
2) c = x - μ (sub)
|
35
|
+
3) s = c * c (square)
|
36
|
+
4) v = mean(s, dims) (variance)
|
37
|
+
5) e = v + eps (add-eps)
|
38
|
+
6) r = rsqrt(e) (rsqrt)
|
39
|
+
7) n = c * r (normalize)
|
40
|
+
8) y = (n * γ) + β (affine), with:
|
41
|
+
• affine_mul : n * γ
|
42
|
+
• affine_add : (n * γ) + β
|
43
|
+
"""
|
44
|
+
|
45
|
+
def __init__(
|
46
|
+
self,
|
47
|
+
fp: nn.LayerNorm,
|
48
|
+
*,
|
49
|
+
qcfg: Optional[QuantConfig] = None,
|
50
|
+
fp_name: Optional[str] = None
|
51
|
+
):
|
52
|
+
super().__init__(qcfg, fp_name=fp_name)
|
53
|
+
self.module = fp
|
54
|
+
self.eps = torch.tensor(self.module.eps)
|
55
|
+
# Number of trailing dims participating in normalization
|
56
|
+
# (PyTorch stores normalized_shape as a tuple even if an int was passed)
|
57
|
+
self._norm_ndim: int = len(fp.normalized_shape) # safe for int→tuple
|
58
|
+
|
59
|
+
# Activation / intermediate observers
|
60
|
+
self.act_in_obs = self._make_obs("act_in")
|
61
|
+
self.mean_obs = self._make_obs("mean")
|
62
|
+
self.centered_obs = self._make_obs("centered")
|
63
|
+
self.square_obs = self._make_obs("square")
|
64
|
+
self.var_obs = self._make_obs("var")
|
65
|
+
self.eps_obs = self._make_obs("eps")
|
66
|
+
self.add_eps_obs = self._make_obs("add_eps")
|
67
|
+
self.inv_std_obs = self._make_obs("inv_std")
|
68
|
+
self.norm_obs = self._make_obs("norm")
|
69
|
+
self.act_out_obs = self._make_obs("act_out")
|
70
|
+
|
71
|
+
# Optional affine parameter observers (γ, β)
|
72
|
+
self.weight_obs = None
|
73
|
+
self.bias_obs = None
|
74
|
+
self.affine_mul_obs = None
|
75
|
+
self.affine_add_obs = None
|
76
|
+
if self.module.elementwise_affine:
|
77
|
+
if self.module.weight is not None:
|
78
|
+
self.weight_obs = self._make_obs("weight")
|
79
|
+
if self.module.bias is not None:
|
80
|
+
self.bias_obs = self._make_obs("bias")
|
81
|
+
# Per-op observers for (n * w) and (+ b)
|
82
|
+
self.affine_mul_obs = self._make_obs("affine_mul")
|
83
|
+
self.affine_add_obs = self._make_obs("affine_add")
|
84
|
+
|
85
|
+
def enable_calibration(self) -> None:
|
86
|
+
"""
|
87
|
+
Switch to CALIB mode and collect *fixed* ranges for affine params
|
88
|
+
immediately, since they do not change across inputs.
|
89
|
+
"""
|
90
|
+
super().enable_calibration()
|
91
|
+
if self.module.elementwise_affine:
|
92
|
+
if self.weight_obs is not None and self.module.weight is not None:
|
93
|
+
self.weight_obs.collect(self.module.weight)
|
94
|
+
if self.bias_obs is not None and self.module.bias is not None:
|
95
|
+
self.bias_obs.collect(self.module.bias)
|
96
|
+
|
97
|
+
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
98
|
+
# Determine reduction dims (last self._norm_ndim axes)
|
99
|
+
# Example: if x.ndim=4 and norm_ndim=2 → dims=(2,3)
|
100
|
+
dims = tuple(range(x.dim() - self._norm_ndim, x.dim()))
|
101
|
+
|
102
|
+
# 0) input
|
103
|
+
x_q = self._fq(x, self.act_in_obs)
|
104
|
+
|
105
|
+
# 1) mean
|
106
|
+
mu = x_q.mean(dim=dims, keepdim=True)
|
107
|
+
mu_q = self._fq(mu, self.mean_obs)
|
108
|
+
|
109
|
+
# 2) center
|
110
|
+
c = x_q - mu_q
|
111
|
+
c_q = self._fq(c, self.centered_obs)
|
112
|
+
|
113
|
+
# 3) square (elementwise mul)
|
114
|
+
s = c_q * c_q
|
115
|
+
s_q = self._fq(s, self.square_obs)
|
116
|
+
|
117
|
+
# 4) variance (via squared mean)
|
118
|
+
v = s_q.mean(dim=dims, keepdim=True)
|
119
|
+
v_q = self._fq(v, self.var_obs)
|
120
|
+
|
121
|
+
# 5) add eps
|
122
|
+
eps_q = self._fq(self.eps, self.eps_obs)
|
123
|
+
e = v_q + eps_q
|
124
|
+
e_q = self._fq(e, self.add_eps_obs)
|
125
|
+
|
126
|
+
# 6) inverse std
|
127
|
+
r = torch.rsqrt(e_q)
|
128
|
+
r_q = self._fq(r, self.inv_std_obs)
|
129
|
+
|
130
|
+
# 7) normalize
|
131
|
+
n = c_q * r_q
|
132
|
+
n_q = self._fq(n, self.norm_obs)
|
133
|
+
|
134
|
+
# 8) optional affine
|
135
|
+
if self.module.elementwise_affine:
|
136
|
+
w = self.module.weight
|
137
|
+
b = self.module.bias
|
138
|
+
if self._mode is Mode.QUANT:
|
139
|
+
if self.weight_obs is not None and w is not None:
|
140
|
+
w = self.weight_obs.fake_quant(w) # type: ignore[assignment]
|
141
|
+
if self.bias_obs is not None and b is not None:
|
142
|
+
b = self.bias_obs.fake_quant(b) # type: ignore[assignment]
|
143
|
+
y = n_q
|
144
|
+
# 8a) n * w (fake-quant the result of the mul)
|
145
|
+
if w is not None:
|
146
|
+
y = y * w
|
147
|
+
if self.affine_mul_obs is not None:
|
148
|
+
y = self._fq(y, self.affine_mul_obs)
|
149
|
+
|
150
|
+
# 8b) (+ b) (fake-quant the result of the add)
|
151
|
+
if b is not None:
|
152
|
+
y = y + b
|
153
|
+
if self.affine_add_obs is not None:
|
154
|
+
y = self._fq(y, self.affine_add_obs)
|
155
|
+
else:
|
156
|
+
y = n_q
|
157
|
+
|
158
|
+
# 9) output activation
|
159
|
+
return self._fq(y, self.act_out_obs)
|
160
|
+
|
161
|
+
def _all_observers(self) -> Iterable:
|
162
|
+
obs: Tuple = (
|
163
|
+
self.act_in_obs,
|
164
|
+
self.mean_obs,
|
165
|
+
self.centered_obs,
|
166
|
+
self.square_obs,
|
167
|
+
self.var_obs,
|
168
|
+
self.eps_obs,
|
169
|
+
self.add_eps_obs,
|
170
|
+
self.inv_std_obs,
|
171
|
+
self.norm_obs,
|
172
|
+
self.act_out_obs,
|
173
|
+
)
|
174
|
+
# Insert affine param observers if present
|
175
|
+
if self.module.elementwise_affine:
|
176
|
+
if self.weight_obs is not None:
|
177
|
+
obs = (self.weight_obs,) + obs
|
178
|
+
if self.bias_obs is not None:
|
179
|
+
obs = obs + (self.bias_obs,)
|
180
|
+
if self.affine_mul_obs is not None:
|
181
|
+
obs = obs + (self.affine_mul_obs,)
|
182
|
+
if self.affine_add_obs is not None:
|
183
|
+
obs = obs + (self.affine_add_obs,)
|
184
|
+
return obs
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# Copyright (c) 2025 Samsung Electronics Co., Ltd. All Rights Reserved
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
from typing import Optional
|
16
|
+
|
17
|
+
import torch
|
18
|
+
import torch.nn as nn
|
19
|
+
|
20
|
+
from tico.experimental.quantization.ptq.quant_config import QuantConfig
|
21
|
+
from tico.experimental.quantization.ptq.wrappers.quant_module_base import (
|
22
|
+
QuantModuleBase,
|
23
|
+
)
|
24
|
+
from tico.experimental.quantization.ptq.wrappers.registry import register
|
25
|
+
|
26
|
+
|
27
|
+
@register(nn.SiLU)
|
28
|
+
class QuantSiLU(QuantModuleBase):
|
29
|
+
"""
|
30
|
+
QuantSiLU — drop-in replacement for nn.SiLU that quantizes
|
31
|
+
both intermediate tensors:
|
32
|
+
• s = sigmoid(x) (logistic)
|
33
|
+
• y = x * s (mul)
|
34
|
+
"""
|
35
|
+
|
36
|
+
def __init__(
|
37
|
+
self,
|
38
|
+
fp: nn.SiLU,
|
39
|
+
*,
|
40
|
+
qcfg: Optional[QuantConfig] = None,
|
41
|
+
fp_name: Optional[str] = None
|
42
|
+
):
|
43
|
+
super().__init__(qcfg, fp_name=fp_name)
|
44
|
+
self.act_in_obs = self._make_obs("act_in")
|
45
|
+
self.sig_obs = self._make_obs("sigmoid")
|
46
|
+
self.mul_obs = self._make_obs("mul")
|
47
|
+
self.module = fp
|
48
|
+
|
49
|
+
def forward(self, x: torch.Tensor):
|
50
|
+
x_q = self._fq(x, self.act_in_obs)
|
51
|
+
|
52
|
+
s = torch.sigmoid(x_q)
|
53
|
+
s = self._fq(s, self.sig_obs)
|
54
|
+
|
55
|
+
y = x * s
|
56
|
+
y = self._fq(y, self.mul_obs)
|
57
|
+
|
58
|
+
return y
|
59
|
+
|
60
|
+
def _all_observers(self):
|
61
|
+
return (self.act_in_obs, self.sig_obs, self.mul_obs)
|
@@ -48,7 +48,24 @@ class PTQWrapper(QuantModuleBase):
|
|
48
48
|
return self.wrapped(*args, **kwargs)
|
49
49
|
|
50
50
|
def _all_observers(self):
|
51
|
-
|
51
|
+
"""
|
52
|
+
PTQWrapper itself owns NO observers (transparent node).
|
53
|
+
Returning an empty iterator prevents double-processing when parents
|
54
|
+
traverse the tree and then recurse into `self.wrapped`.
|
55
|
+
"""
|
56
|
+
return () # no local observers
|
57
|
+
|
58
|
+
def named_observers(self):
|
59
|
+
"""
|
60
|
+
Proxy to the wrapped module so debugging tools can still enumerate observers.
|
61
|
+
"""
|
62
|
+
yield from self.wrapped.named_observers()
|
63
|
+
|
64
|
+
def get_observer(self, name: str):
|
65
|
+
"""
|
66
|
+
Proxy to the wrapped module for direct lookup by name.
|
67
|
+
"""
|
68
|
+
return self.wrapped.get_observer(name)
|
52
69
|
|
53
70
|
def extra_repr(self) -> str:
|
54
71
|
return self.wrapped.extra_repr()
|
@@ -46,10 +46,24 @@ class QuantModuleBase(nn.Module, ABC):
|
|
46
46
|
self.fp_name = fp_name
|
47
47
|
|
48
48
|
def _child_quant_modules(self):
|
49
|
-
"""
|
50
|
-
|
49
|
+
"""
|
50
|
+
Yield immediate QuantModuleBase *descendants*, skipping over pure containers
|
51
|
+
(e.g., ModuleList/Sequential/ModuleDict). Once a QuantModuleBase is found,
|
52
|
+
do NOT descend into it here—let recursion happen level by level.
|
53
|
+
"""
|
54
|
+
seen = set()
|
55
|
+
stack = list(self.children()) # start from direct children
|
56
|
+
|
57
|
+
while stack:
|
58
|
+
m = stack.pop()
|
51
59
|
if isinstance(m, QuantModuleBase):
|
52
|
-
|
60
|
+
if id(m) not in seen:
|
61
|
+
seen.add(id(m))
|
62
|
+
yield m
|
63
|
+
# IMPORTANT: do not recurse into `m` here; its own call will handle its subtree
|
64
|
+
elif isinstance(m, (nn.ModuleList, nn.ModuleDict, nn.Sequential)):
|
65
|
+
# `m` is a container or a non-quant leaf: keep descending until we hit quant modules
|
66
|
+
stack.extend(list(m.children()))
|
53
67
|
|
54
68
|
def enable_calibration(self) -> None:
|
55
69
|
self._mode = Mode.CALIB
|
@@ -24,7 +24,10 @@ from tico.experimental.quantization.ptq.wrappers.quant_module_base import (
|
|
24
24
|
_WRAPPERS: Dict[Type[nn.Module], Type[QuantModuleBase]] = {}
|
25
25
|
_IMPORT_ONCE = False
|
26
26
|
_CORE_MODULES = (
|
27
|
+
"tico.experimental.quantization.ptq.wrappers.quant_elementwise",
|
28
|
+
"tico.experimental.quantization.ptq.wrappers.nn.quant_layernorm",
|
27
29
|
"tico.experimental.quantization.ptq.wrappers.nn.quant_linear",
|
30
|
+
"tico.experimental.quantization.ptq.wrappers.nn.quant_silu",
|
28
31
|
# add future core wrappers here
|
29
32
|
)
|
30
33
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
tico/__init__.py,sha256=
|
1
|
+
tico/__init__.py,sha256=M4dQ4CTD_7xsO5DjUx76t4A5o1Q_2NqGlMe0fjkGDxQ,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
|
@@ -61,6 +61,8 @@ tico/experimental/quantization/ptq/dtypes.py,sha256=xfCBtq6mQmUYRwsoFgII6gvRl1ra
|
|
61
61
|
tico/experimental/quantization/ptq/mode.py,sha256=lT-T8vIv8YWcwrjT7xXVhOw1g7aoAdh_3PWB-ptPKaI,1052
|
62
62
|
tico/experimental/quantization/ptq/qscheme.py,sha256=uwhv7bCxOOXB3I-IKlRyr_u4eXOq48uIqGy4TLDqGxY,1301
|
63
63
|
tico/experimental/quantization/ptq/quant_config.py,sha256=nm7570Y1X2mOT_8s27ilWid04otor6cVTi9GwgAEaKc,4300
|
64
|
+
tico/experimental/quantization/ptq/examples/__init__.py,sha256=IO6FP_xYbGy0dW0HL26GXD3ouxARaxCK7bz9dn4blPQ,26
|
65
|
+
tico/experimental/quantization/ptq/examples/quantize_linear.py,sha256=8zq-ZJDYgam0xQ-PbC6Xb1I7W1mv0Wi-b--IP2wwXtw,4539
|
64
66
|
tico/experimental/quantization/ptq/observers/__init__.py,sha256=WF2MvL9M_jl-B1FqcY9zic34NOCRp17HkRYv-TMxMr4,613
|
65
67
|
tico/experimental/quantization/ptq/observers/affine_base.py,sha256=e2Eba64nrxKQyE4F_WJ7WTSsk3xe6bkdGUKaoLFWGFw,4638
|
66
68
|
tico/experimental/quantization/ptq/observers/base.py,sha256=Wons1MzpqK1mfcy-ppl-B2Dum0edXg2dWW2Lw3V18tw,3280
|
@@ -71,12 +73,14 @@ tico/experimental/quantization/ptq/observers/mx.py,sha256=aP4qmBgeiRIYZJksShN5gs
|
|
71
73
|
tico/experimental/quantization/ptq/utils/__init__.py,sha256=PL9IZgiWoMtsXVljeOy7KymmLVP238SXEFRLXYK72WQ,126
|
72
74
|
tico/experimental/quantization/ptq/utils/reduce_utils.py,sha256=3kWawLB91EcvvHlCrNqqfZF7tpgr22htBSA049mKw_4,973
|
73
75
|
tico/experimental/quantization/ptq/wrappers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
74
|
-
tico/experimental/quantization/ptq/wrappers/ptq_wrapper.py,sha256=
|
76
|
+
tico/experimental/quantization/ptq/wrappers/ptq_wrapper.py,sha256=F9sK_DiRaXiGNHULcwIbs5EUtHz6ZJ7N4r5CWTTfhsM,2442
|
75
77
|
tico/experimental/quantization/ptq/wrappers/quant_elementwise.py,sha256=LhEoobfvto6zKrBOKL4gmxfFFc31jHzyQV_zfps-iQM,3604
|
76
|
-
tico/experimental/quantization/ptq/wrappers/quant_module_base.py,sha256=
|
77
|
-
tico/experimental/quantization/ptq/wrappers/registry.py,sha256=
|
78
|
-
tico/experimental/quantization/ptq/wrappers/nn/__init__.py,sha256=
|
78
|
+
tico/experimental/quantization/ptq/wrappers/quant_module_base.py,sha256=vkcDos_knGSS29rIZuEIWkAJLHrENbGz8nCH2-iara8,5969
|
79
|
+
tico/experimental/quantization/ptq/wrappers/registry.py,sha256=562nKSlp9qF-w4-aQeJbx2V_wMGE2FRrjIKUfRwC4Mg,4571
|
80
|
+
tico/experimental/quantization/ptq/wrappers/nn/__init__.py,sha256=I9uTt5HfcRoMEDYHpAeATMv2TbCQiX0ZbfUFMzSJ4Qw,336
|
81
|
+
tico/experimental/quantization/ptq/wrappers/nn/quant_layernorm.py,sha256=G5Sgt-tXnzh0Rxyk-2honmZIfEQOZlRfOsoDBdSGmA4,6887
|
79
82
|
tico/experimental/quantization/ptq/wrappers/nn/quant_linear.py,sha256=xW-VEPB7RJoslS3xLVCdhIuMjppknvpkZleRGK4JFVQ,2240
|
83
|
+
tico/experimental/quantization/ptq/wrappers/nn/quant_silu.py,sha256=XnJDggkWUTfXC1-BLeAbcCUtp687XLIkIIbuQlqycDw,1864
|
80
84
|
tico/interpreter/__init__.py,sha256=IO6FP_xYbGy0dW0HL26GXD3ouxARaxCK7bz9dn4blPQ,26
|
81
85
|
tico/interpreter/infer.py,sha256=1ZFe3DVMR2mlwBosoedqoL0-CGN_01CKLgMgxuw62KA,4861
|
82
86
|
tico/interpreter/interpreter.py,sha256=tGbluCbrehTCqBu8mtGDNzby_ieJ2ry8_RH_eC0CQxk,3828
|
@@ -231,9 +235,9 @@ tico/utils/mx/__init__.py,sha256=IO6FP_xYbGy0dW0HL26GXD3ouxARaxCK7bz9dn4blPQ,26
|
|
231
235
|
tico/utils/mx/elemwise_ops.py,sha256=V6glyAHsVR1joqpsgnNytatCD_ew92xNWZ19UFDoMTA,10281
|
232
236
|
tico/utils/mx/formats.py,sha256=uzNWyu-1onUlwQfX5cZ6fZSUfHMRqorper7_T1k3jfk,3404
|
233
237
|
tico/utils/mx/mx_ops.py,sha256=RcfUTYVi-wilGB2sC35OeARdwDqnixv7dG5iyZ-fQT8,8555
|
234
|
-
tico-0.1.0.
|
235
|
-
tico-0.1.0.
|
236
|
-
tico-0.1.0.
|
237
|
-
tico-0.1.0.
|
238
|
-
tico-0.1.0.
|
239
|
-
tico-0.1.0.
|
238
|
+
tico-0.1.0.dev250826.dist-info/LICENSE,sha256=kp4JLII7bzRhPb0CPD5XTDZMh22BQ7h3k3B7t8TiSbw,12644
|
239
|
+
tico-0.1.0.dev250826.dist-info/METADATA,sha256=QhtUiHj_YT4ZxsClOx4OaP24kuaLUsLT83x3yl1gRDY,8450
|
240
|
+
tico-0.1.0.dev250826.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
241
|
+
tico-0.1.0.dev250826.dist-info/entry_points.txt,sha256=kBKYSS_IYrSXmUYevmmepqIVPScq5vF8ulQRu3I_Zf0,59
|
242
|
+
tico-0.1.0.dev250826.dist-info/top_level.txt,sha256=oqs7UPoNSKZEwqsX8B-KAWdQwfAa7i60pbxW_Jk7P3w,5
|
243
|
+
tico-0.1.0.dev250826.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|