JSTprove 1.2.0__py3-none-macosx_11_0_arm64.whl → 1.4.0__py3-none-macosx_11_0_arm64.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.
- {jstprove-1.2.0.dist-info → jstprove-1.4.0.dist-info}/METADATA +1 -1
- {jstprove-1.2.0.dist-info → jstprove-1.4.0.dist-info}/RECORD +32 -26
- python/core/binaries/onnx_generic_circuit_1-4-0 +0 -0
- python/core/circuits/base.py +29 -12
- python/core/circuits/errors.py +1 -2
- python/core/model_processing/converters/base.py +3 -3
- python/core/model_processing/onnx_custom_ops/__init__.py +5 -4
- python/core/model_processing/onnx_quantizer/exceptions.py +2 -2
- python/core/model_processing/onnx_quantizer/layers/base.py +79 -2
- python/core/model_processing/onnx_quantizer/layers/clip.py +92 -0
- python/core/model_processing/onnx_quantizer/layers/max.py +49 -0
- python/core/model_processing/onnx_quantizer/layers/maxpool.py +79 -4
- python/core/model_processing/onnx_quantizer/layers/min.py +54 -0
- python/core/model_processing/onnx_quantizer/onnx_op_quantizer.py +6 -0
- python/core/model_templates/circuit_template.py +48 -38
- python/core/utils/errors.py +1 -1
- python/core/utils/scratch_tests.py +29 -23
- python/tests/circuit_e2e_tests/circuit_model_developer_test.py +18 -14
- python/tests/circuit_e2e_tests/helper_fns_for_tests.py +11 -13
- python/tests/circuit_parent_classes/test_ort_custom_layers.py +35 -53
- python/tests/onnx_quantizer_tests/layers/base.py +1 -3
- python/tests/onnx_quantizer_tests/layers/clip_config.py +127 -0
- python/tests/onnx_quantizer_tests/layers/max_config.py +100 -0
- python/tests/onnx_quantizer_tests/layers/maxpool_config.py +106 -0
- python/tests/onnx_quantizer_tests/layers/min_config.py +94 -0
- python/tests/onnx_quantizer_tests/layers_tests/test_integration.py +6 -5
- python/tests/onnx_quantizer_tests/layers_tests/test_quantize.py +6 -1
- python/tests/onnx_quantizer_tests/test_registered_quantizers.py +17 -8
- python/core/binaries/onnx_generic_circuit_1-2-0 +0 -0
- {jstprove-1.2.0.dist-info → jstprove-1.4.0.dist-info}/WHEEL +0 -0
- {jstprove-1.2.0.dist-info → jstprove-1.4.0.dist-info}/entry_points.txt +0 -0
- {jstprove-1.2.0.dist-info → jstprove-1.4.0.dist-info}/licenses/LICENSE +0 -0
- {jstprove-1.2.0.dist-info → jstprove-1.4.0.dist-info}/top_level.txt +0 -0
|
@@ -49,11 +49,10 @@ def validate_quantized_node(node_result: onnx.NodeProto, op_type: str) -> None:
|
|
|
49
49
|
assert node_result.output, f"Missing outputs for {op_type}"
|
|
50
50
|
|
|
51
51
|
try:
|
|
52
|
-
# Create a minimal
|
|
52
|
+
# Create a minimal graph with dummy IOs to satisfy ONNX requirements
|
|
53
53
|
temp_graph = onnx.GraphProto()
|
|
54
54
|
temp_graph.name = "temp_graph"
|
|
55
55
|
|
|
56
|
-
# Add dummy inputs/outputs to satisfy graph requirements
|
|
57
56
|
for inp in node_result.input:
|
|
58
57
|
if not any(vi.name == inp for vi in temp_graph.input):
|
|
59
58
|
temp_graph.input.append(
|
|
@@ -63,6 +62,7 @@ def validate_quantized_node(node_result: onnx.NodeProto, op_type: str) -> None:
|
|
|
63
62
|
[1],
|
|
64
63
|
),
|
|
65
64
|
)
|
|
65
|
+
|
|
66
66
|
for out in node_result.output:
|
|
67
67
|
if not any(vi.name == out for vi in temp_graph.output):
|
|
68
68
|
temp_graph.output.append(
|
|
@@ -74,12 +74,16 @@ def validate_quantized_node(node_result: onnx.NodeProto, op_type: str) -> None:
|
|
|
74
74
|
)
|
|
75
75
|
|
|
76
76
|
temp_graph.node.append(node_result)
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
|
|
78
|
+
# Explicit opset imports for default and contrib domains
|
|
79
|
+
temp_model = onnx.helper.make_model(
|
|
80
|
+
temp_graph,
|
|
81
|
+
opset_imports=[
|
|
82
|
+
onnx.helper.make_opsetid("", 22),
|
|
83
|
+
onnx.helper.make_opsetid("ai.onnx.contrib", 1),
|
|
84
|
+
],
|
|
81
85
|
)
|
|
82
|
-
|
|
86
|
+
|
|
83
87
|
onnx.checker.check_model(temp_model)
|
|
84
88
|
except onnx.checker.ValidationError as e:
|
|
85
89
|
pytest.fail(f"ONNX node validation failed for {op_type}: {e}")
|
|
@@ -117,5 +121,10 @@ def test_registered_quantizer_quantize(
|
|
|
117
121
|
for node_result in result:
|
|
118
122
|
validate_quantized_node(node_result, op_type)
|
|
119
123
|
else:
|
|
120
|
-
|
|
124
|
+
if inputs:
|
|
125
|
+
# Only assert if this op actually requires inputs
|
|
126
|
+
assert (
|
|
127
|
+
result.input
|
|
128
|
+
), f"Missing inputs for {op_type}; required_inputs={inputs}"
|
|
129
|
+
|
|
121
130
|
validate_quantized_node(result, op_type)
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|