ai-edge-quantizer-nightly 0.5.0.dev20251227__py3-none-any.whl → 0.5.0.dev20260115__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.
- ai_edge_quantizer/algorithms/uniform_quantize/common_quantize.py +1 -0
- ai_edge_quantizer/algorithms/uniform_quantize/hadamard_rotation.py +1 -1
- ai_edge_quantizer/algorithms/uniform_quantize/uniform_quantize_tensor_test.py +24 -9
- {ai_edge_quantizer_nightly-0.5.0.dev20251227.dist-info → ai_edge_quantizer_nightly-0.5.0.dev20260115.dist-info}/METADATA +1 -1
- {ai_edge_quantizer_nightly-0.5.0.dev20251227.dist-info → ai_edge_quantizer_nightly-0.5.0.dev20260115.dist-info}/RECORD +8 -8
- {ai_edge_quantizer_nightly-0.5.0.dev20251227.dist-info → ai_edge_quantizer_nightly-0.5.0.dev20260115.dist-info}/WHEEL +0 -0
- {ai_edge_quantizer_nightly-0.5.0.dev20251227.dist-info → ai_edge_quantizer_nightly-0.5.0.dev20260115.dist-info}/licenses/LICENSE +0 -0
- {ai_edge_quantizer_nightly-0.5.0.dev20251227.dist-info → ai_edge_quantizer_nightly-0.5.0.dev20260115.dist-info}/top_level.txt +0 -0
|
@@ -87,7 +87,7 @@ def _rotate_with_diagonal_hadamard(
|
|
|
87
87
|
hadamard = _make_hadamard_matrix(hadamard_size)
|
|
88
88
|
reshaped_tensor = tensor_content.reshape(
|
|
89
89
|
diagonal_size * output_size, hadamard_size)
|
|
90
|
-
w_rotated = np.matmul(
|
|
90
|
+
w_rotated = np.matmul(reshaped_tensor, hadamard)
|
|
91
91
|
return w_rotated.reshape(tensor_content.shape), hadamard_size, random_vector
|
|
92
92
|
|
|
93
93
|
|
|
@@ -414,7 +414,10 @@ class TensorUtilsTest(parameterized.TestCase):
|
|
|
414
414
|
list(bias_quant_config.quantized_data.flatten()), # pytype: disable=attribute-error
|
|
415
415
|
)
|
|
416
416
|
|
|
417
|
-
|
|
417
|
+
@parameterized.parameters(True, False)
|
|
418
|
+
def test_quantize_bias_tensor_raises_error_for_large_quantization_error(
|
|
419
|
+
self, check_error
|
|
420
|
+
):
|
|
418
421
|
input_quant_config = qtyping.UniformQuantParams(
|
|
419
422
|
scale=np.array([0.1]),
|
|
420
423
|
zero_point=np.array([10]),
|
|
@@ -431,14 +434,26 @@ class TensorUtilsTest(parameterized.TestCase):
|
|
|
431
434
|
)
|
|
432
435
|
# This will result in quantized bias of 3e9, which is larger than int32 max.
|
|
433
436
|
bias_tensor_data = np.array([3e7])
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
437
|
+
|
|
438
|
+
if check_error:
|
|
439
|
+
with self.assertRaisesRegex(
|
|
440
|
+
ValueError,
|
|
441
|
+
"Quantization error is too large for bias tensor quantization.",
|
|
442
|
+
):
|
|
443
|
+
uniform_quantize_tensor.symmetric_quantize_bias_tensor(
|
|
444
|
+
bias_tensor_data,
|
|
445
|
+
input_quant_config,
|
|
446
|
+
weight_quant_config,
|
|
447
|
+
check_error
|
|
448
|
+
)
|
|
449
|
+
else:
|
|
450
|
+
self.assertIsNotNone(
|
|
451
|
+
uniform_quantize_tensor.symmetric_quantize_bias_tensor(
|
|
452
|
+
bias_tensor_data,
|
|
453
|
+
input_quant_config,
|
|
454
|
+
weight_quant_config,
|
|
455
|
+
check_error,
|
|
456
|
+
)
|
|
442
457
|
)
|
|
443
458
|
|
|
444
459
|
@parameterized.parameters((8, True), (16, False))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ai-edge-quantizer-nightly
|
|
3
|
-
Version: 0.5.0.
|
|
3
|
+
Version: 0.5.0.dev20260115
|
|
4
4
|
Summary: A quantizer for advanced developers to quantize converted AI Edge models.
|
|
5
5
|
Home-page: https://github.com/google-ai-edge/ai-edge-quantizer
|
|
6
6
|
Keywords: On-Device ML,AI,Google,TFLite,Quantization,LLMs,GenAI
|
|
@@ -28,11 +28,11 @@ ai_edge_quantizer/algorithms/nonlinear_quantize/__init__.py,sha256=lpq1g2ayg3lCP
|
|
|
28
28
|
ai_edge_quantizer/algorithms/nonlinear_quantize/float_casting.py,sha256=Bs9CK7wZAw6jNaZ8xEtbwO2vM34VYXNZSMVWvxJo9nw,9297
|
|
29
29
|
ai_edge_quantizer/algorithms/nonlinear_quantize/float_casting_test.py,sha256=EqIHGEZ1LgUrTN7zf880RuAzEv3Qy7kgh5ivObJGHSo,22646
|
|
30
30
|
ai_edge_quantizer/algorithms/uniform_quantize/__init__.py,sha256=lpq1g2ayg3lCPLy79t2VicYcnGKw64FfYIj1V7J-4m8,676
|
|
31
|
-
ai_edge_quantizer/algorithms/uniform_quantize/common_quantize.py,sha256=
|
|
31
|
+
ai_edge_quantizer/algorithms/uniform_quantize/common_quantize.py,sha256=7xLbcm34nRnKLi3Rb_SdGNuXrXwEuC0t6hNAY3d0aSM,42129
|
|
32
32
|
ai_edge_quantizer/algorithms/uniform_quantize/common_quantize_test.py,sha256=GGf_n3wIeg3GB_eGsmyNJ0fTcxgpeMMbugTMRONK6TQ,3553
|
|
33
33
|
ai_edge_quantizer/algorithms/uniform_quantize/dequantized_weight_recovery.py,sha256=VjBDxGxjITHJc7xJABqBbZt6_qhobtZAl2gnVQrYJgc,8652
|
|
34
34
|
ai_edge_quantizer/algorithms/uniform_quantize/dequantized_weight_recovery_test.py,sha256=sT5eX5TLZEHTtPfnSkCPDlS0sQxlTFWbCsbvOuj--yY,8889
|
|
35
|
-
ai_edge_quantizer/algorithms/uniform_quantize/hadamard_rotation.py,sha256=
|
|
35
|
+
ai_edge_quantizer/algorithms/uniform_quantize/hadamard_rotation.py,sha256=rvXBqBk0a3RLq5b3hZlvm3-GygpzCf8dPHa5nOTCg5o,14566
|
|
36
36
|
ai_edge_quantizer/algorithms/uniform_quantize/hadamard_rotation_test.py,sha256=1ejj5WS3GZwFk3qpsPiPS8jcmVS1-e7zRmvj2Nj8fKw,15440
|
|
37
37
|
ai_edge_quantizer/algorithms/uniform_quantize/mse.py,sha256=EP5yPw6khAhTo6VNTPXEE2aGKLfNnqz8COeJnTKaGWs,4641
|
|
38
38
|
ai_edge_quantizer/algorithms/uniform_quantize/mse_test.py,sha256=-E1LIlxadckspltdgBWTiUzsiwbawSubndavHhWLt1g,7145
|
|
@@ -41,7 +41,7 @@ ai_edge_quantizer/algorithms/uniform_quantize/naive_min_max_quantize_test.py,sha
|
|
|
41
41
|
ai_edge_quantizer/algorithms/uniform_quantize/octav.py,sha256=-n-QZyp9y8WCy5FPSpXZXHfOA-p-RLvfSaCzAfhHiHI,7040
|
|
42
42
|
ai_edge_quantizer/algorithms/uniform_quantize/octav_test.py,sha256=6m2U-9JdNei0XzOORg2gt87TJdD0XHZ-z5h9c4g_TB4,9120
|
|
43
43
|
ai_edge_quantizer/algorithms/uniform_quantize/uniform_quantize_tensor.py,sha256=qZxTj3B-tqNTLCViwuJj285YncvwjWeay2QKWd8nr6A,20420
|
|
44
|
-
ai_edge_quantizer/algorithms/uniform_quantize/uniform_quantize_tensor_test.py,sha256=
|
|
44
|
+
ai_edge_quantizer/algorithms/uniform_quantize/uniform_quantize_tensor_test.py,sha256=2BBSNqB37Smo8t9CZJShlT6JZMpuw4RWRvAGHBTr3OA,16417
|
|
45
45
|
ai_edge_quantizer/algorithms/utils/__init__.py,sha256=lpq1g2ayg3lCPLy79t2VicYcnGKw64FfYIj1V7J-4m8,676
|
|
46
46
|
ai_edge_quantizer/algorithms/utils/common_utils.py,sha256=M3VZsdLC4jCPfSI_aGAY4XjiHvoXtR-UyPZdZdz8GD0,38082
|
|
47
47
|
ai_edge_quantizer/algorithms/utils/common_utils_test.py,sha256=zqapGEfYhjQWe9cNGPLmdbwtEUUYQRhlO_kNe0cXX6E,18104
|
|
@@ -74,8 +74,8 @@ ai_edge_quantizer/utils/tfl_interpreter_utils.py,sha256=ptdlC3WVUE9aBznT7kZQ0ZOk
|
|
|
74
74
|
ai_edge_quantizer/utils/tfl_interpreter_utils_test.py,sha256=EPOXbmXqbt3tAewo3BQQjh2mjuxrrFit5tkF0wUVYHU,12471
|
|
75
75
|
ai_edge_quantizer/utils/validation_utils.py,sha256=Mr0D6X-pTDLODFAnCX3IlqdV1OL02tlq0ZjHbqx8nzg,7439
|
|
76
76
|
ai_edge_quantizer/utils/validation_utils_test.py,sha256=T8K5mCWeMcihND2KS_dHvCJUU9lEdG2sD95EgPkaX3w,5584
|
|
77
|
-
ai_edge_quantizer_nightly-0.5.0.
|
|
78
|
-
ai_edge_quantizer_nightly-0.5.0.
|
|
79
|
-
ai_edge_quantizer_nightly-0.5.0.
|
|
80
|
-
ai_edge_quantizer_nightly-0.5.0.
|
|
81
|
-
ai_edge_quantizer_nightly-0.5.0.
|
|
77
|
+
ai_edge_quantizer_nightly-0.5.0.dev20260115.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
78
|
+
ai_edge_quantizer_nightly-0.5.0.dev20260115.dist-info/METADATA,sha256=P11Xt9VE99pVPoVeiHTGFmIaVphOTUpGdJ8rghDCgHc,1729
|
|
79
|
+
ai_edge_quantizer_nightly-0.5.0.dev20260115.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
|
|
80
|
+
ai_edge_quantizer_nightly-0.5.0.dev20260115.dist-info/top_level.txt,sha256=8QTfPnFXNVUhScFLaa-NWZMFWMn72M50DVPubpwWB1g,18
|
|
81
|
+
ai_edge_quantizer_nightly-0.5.0.dev20260115.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|