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.
Files changed (33) hide show
  1. {jstprove-1.2.0.dist-info → jstprove-1.4.0.dist-info}/METADATA +1 -1
  2. {jstprove-1.2.0.dist-info → jstprove-1.4.0.dist-info}/RECORD +32 -26
  3. python/core/binaries/onnx_generic_circuit_1-4-0 +0 -0
  4. python/core/circuits/base.py +29 -12
  5. python/core/circuits/errors.py +1 -2
  6. python/core/model_processing/converters/base.py +3 -3
  7. python/core/model_processing/onnx_custom_ops/__init__.py +5 -4
  8. python/core/model_processing/onnx_quantizer/exceptions.py +2 -2
  9. python/core/model_processing/onnx_quantizer/layers/base.py +79 -2
  10. python/core/model_processing/onnx_quantizer/layers/clip.py +92 -0
  11. python/core/model_processing/onnx_quantizer/layers/max.py +49 -0
  12. python/core/model_processing/onnx_quantizer/layers/maxpool.py +79 -4
  13. python/core/model_processing/onnx_quantizer/layers/min.py +54 -0
  14. python/core/model_processing/onnx_quantizer/onnx_op_quantizer.py +6 -0
  15. python/core/model_templates/circuit_template.py +48 -38
  16. python/core/utils/errors.py +1 -1
  17. python/core/utils/scratch_tests.py +29 -23
  18. python/tests/circuit_e2e_tests/circuit_model_developer_test.py +18 -14
  19. python/tests/circuit_e2e_tests/helper_fns_for_tests.py +11 -13
  20. python/tests/circuit_parent_classes/test_ort_custom_layers.py +35 -53
  21. python/tests/onnx_quantizer_tests/layers/base.py +1 -3
  22. python/tests/onnx_quantizer_tests/layers/clip_config.py +127 -0
  23. python/tests/onnx_quantizer_tests/layers/max_config.py +100 -0
  24. python/tests/onnx_quantizer_tests/layers/maxpool_config.py +106 -0
  25. python/tests/onnx_quantizer_tests/layers/min_config.py +94 -0
  26. python/tests/onnx_quantizer_tests/layers_tests/test_integration.py +6 -5
  27. python/tests/onnx_quantizer_tests/layers_tests/test_quantize.py +6 -1
  28. python/tests/onnx_quantizer_tests/test_registered_quantizers.py +17 -8
  29. python/core/binaries/onnx_generic_circuit_1-2-0 +0 -0
  30. {jstprove-1.2.0.dist-info → jstprove-1.4.0.dist-info}/WHEEL +0 -0
  31. {jstprove-1.2.0.dist-info → jstprove-1.4.0.dist-info}/entry_points.txt +0 -0
  32. {jstprove-1.2.0.dist-info → jstprove-1.4.0.dist-info}/licenses/LICENSE +0 -0
  33. {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 model with custom opset for validation
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
- temp_model = onnx.helper.make_model(temp_graph)
78
- custom_domain = onnx.helper.make_operatorsetid(
79
- domain="ai.onnx.contrib",
80
- version=1,
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
- temp_model.opset_import.append(custom_domain)
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
- assert result.input, f"Missing inputs for {op_type}"
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)