JSTprove 1.0.0__py3-none-macosx_11_0_arm64.whl → 1.1.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.

Potentially problematic release.


This version of JSTprove might be problematic. Click here for more details.

Files changed (52) hide show
  1. {jstprove-1.0.0.dist-info → jstprove-1.1.0.dist-info}/METADATA +2 -2
  2. {jstprove-1.0.0.dist-info → jstprove-1.1.0.dist-info}/RECORD +51 -24
  3. python/core/binaries/onnx_generic_circuit_1-1-0 +0 -0
  4. python/core/circuit_models/generic_onnx.py +43 -9
  5. python/core/circuits/base.py +231 -71
  6. python/core/model_processing/converters/onnx_converter.py +86 -32
  7. python/core/model_processing/onnx_custom_ops/maxpool.py +1 -1
  8. python/core/model_processing/onnx_custom_ops/relu.py +1 -1
  9. python/core/model_processing/onnx_quantizer/layers/add.py +54 -0
  10. python/core/model_processing/onnx_quantizer/layers/base.py +121 -1
  11. python/core/model_processing/onnx_quantizer/layers/constant.py +1 -1
  12. python/core/model_processing/onnx_quantizer/layers/conv.py +20 -68
  13. python/core/model_processing/onnx_quantizer/layers/gemm.py +20 -66
  14. python/core/model_processing/onnx_quantizer/layers/maxpool.py +53 -43
  15. python/core/model_processing/onnx_quantizer/layers/relu.py +20 -35
  16. python/core/model_processing/onnx_quantizer/onnx_op_quantizer.py +6 -1
  17. python/core/utils/general_layer_functions.py +17 -12
  18. python/core/utils/model_registry.py +6 -3
  19. python/tests/circuit_e2e_tests/other_e2e_test.py +202 -9
  20. python/tests/circuit_parent_classes/test_circuit.py +561 -38
  21. python/tests/circuit_parent_classes/test_onnx_converter.py +22 -13
  22. python/tests/onnx_quantizer_tests/__init__.py +1 -0
  23. python/tests/onnx_quantizer_tests/layers/__init__.py +13 -0
  24. python/tests/onnx_quantizer_tests/layers/add_config.py +102 -0
  25. python/tests/onnx_quantizer_tests/layers/base.py +279 -0
  26. python/tests/onnx_quantizer_tests/layers/constant_config.py +39 -0
  27. python/tests/onnx_quantizer_tests/layers/conv_config.py +154 -0
  28. python/tests/onnx_quantizer_tests/layers/factory.py +142 -0
  29. python/tests/onnx_quantizer_tests/layers/flatten_config.py +61 -0
  30. python/tests/onnx_quantizer_tests/layers/gemm_config.py +160 -0
  31. python/tests/onnx_quantizer_tests/layers/maxpool_config.py +82 -0
  32. python/tests/onnx_quantizer_tests/layers/relu_config.py +61 -0
  33. python/tests/onnx_quantizer_tests/layers/reshape_config.py +61 -0
  34. python/tests/onnx_quantizer_tests/layers_tests/__init__.py +0 -0
  35. python/tests/onnx_quantizer_tests/layers_tests/base_test.py +94 -0
  36. python/tests/onnx_quantizer_tests/layers_tests/test_check_model.py +115 -0
  37. python/tests/onnx_quantizer_tests/layers_tests/test_e2e.py +196 -0
  38. python/tests/onnx_quantizer_tests/layers_tests/test_error_cases.py +59 -0
  39. python/tests/onnx_quantizer_tests/layers_tests/test_integration.py +198 -0
  40. python/tests/onnx_quantizer_tests/layers_tests/test_quantize.py +265 -0
  41. python/tests/onnx_quantizer_tests/layers_tests/test_scalability.py +109 -0
  42. python/tests/onnx_quantizer_tests/layers_tests/test_validation.py +45 -0
  43. python/tests/onnx_quantizer_tests/test_base_layer.py +228 -0
  44. python/tests/onnx_quantizer_tests/test_exceptions.py +99 -0
  45. python/tests/onnx_quantizer_tests/test_onnx_op_quantizer.py +246 -0
  46. python/tests/onnx_quantizer_tests/test_registered_quantizers.py +121 -0
  47. python/tests/onnx_quantizer_tests/testing_helper_functions.py +17 -0
  48. python/core/binaries/onnx_generic_circuit_1-0-0 +0 -0
  49. {jstprove-1.0.0.dist-info → jstprove-1.1.0.dist-info}/WHEEL +0 -0
  50. {jstprove-1.0.0.dist-info → jstprove-1.1.0.dist-info}/entry_points.txt +0 -0
  51. {jstprove-1.0.0.dist-info → jstprove-1.1.0.dist-info}/licenses/LICENSE +0 -0
  52. {jstprove-1.0.0.dist-info → jstprove-1.1.0.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: JSTprove
3
- Version: 1.0.0
3
+ Version: 1.1.0
4
4
  Summary: Zero-knowledge proofs of ML inference on ONNX models
5
5
  Author: Inference Labs Inc
6
6
  Requires-Python: >=3.10
@@ -45,7 +45,7 @@ Dynamic: license-file
45
45
  Zero-knowledge proofs of ML inference on **ONNX** models — powered by [Polyhedra Network’s **Expander**](https://github.com/PolyhedraZK/Expander) (GKR/sum-check prover) and [**Expander Compiler Collection (ECC)**](https://github.com/PolyhedraZK/ExpanderCompilerCollection).
46
46
 
47
47
  * 🎯 **You bring ONNX** → we quantize, compile to a circuit, generate a witness, prove, and verify — via a simple CLI.
48
- * ✅ Supported ops (current): **Conv2D**, **GEMM/MatMul (FC)**, **ReLU**, **MaxPool2D**.
48
+ * ✅ Supported ops (current): **Conv2D**, **GEMM/MatMul (FC)**, **ReLU**, **MaxPool2D**, **Add**.
49
49
  * 🧰 CLI details: see **[docs/cli.md](docs/cli.md)**
50
50
 
51
51
  👉 Just want to see it in action? Jump to [Quickstart (LeNet demo)](#quickstart-lenet-demo).<br>
@@ -1,47 +1,48 @@
1
- jstprove-1.0.0.dist-info/licenses/LICENSE,sha256=UXQRcYRUH-PfN27n3P-FMaZFY6jr9jFPKcwT7CWbljw,1160
1
+ jstprove-1.1.0.dist-info/licenses/LICENSE,sha256=UXQRcYRUH-PfN27n3P-FMaZFY6jr9jFPKcwT7CWbljw,1160
2
2
  python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  python/core/__init__.py,sha256=RlfbqGAaUulKl44QGMCkkGJBQZ8R_AgC5bU5zS7BjnA,97
4
4
  python/core/binaries/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  python/core/binaries/expander-exec,sha256=C_1JcezdfLp9sFOQ2z3wp2gcq1k8zjIR09CxJKGGIuM,7095168
6
- python/core/binaries/onnx_generic_circuit_1-0-0,sha256=Lh1hGumXMjFTJEUD9SeYY2RIMl635L35Y7W7GpR0SQM,3027264
6
+ python/core/binaries/onnx_generic_circuit_1-1-0,sha256=2YBhVx-neun-Dmx3ntyLq20qwsLrY9coOcU2bNLprZ0,3086160
7
7
  python/core/circuit_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- python/core/circuit_models/generic_onnx.py,sha256=OevM274yeaMQIroAv-eTjUcu_tY1Kr9BqEKdoEIpKjM,7597
8
+ python/core/circuit_models/generic_onnx.py,sha256=P65UZkfVBTE6YhaQ951S6QoTHPuU5ntDt8QL5pXghvw,8787
9
9
  python/core/circuit_models/simple_circuit.py,sha256=igQrZtQyreyHc26iAgCyDb0TuD2bJAoumYhc1pYPDzQ,4682
10
10
  python/core/circuits/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- python/core/circuits/base.py,sha256=GNHJs7FBGJZdvlqGxsLix2TYc41hs-jsK23gSAFWyyU,35951
11
+ python/core/circuits/base.py,sha256=tvCHwk_V2ftEocQkmoK5Nf98Iy0F0Ce1FWp03HhNHfA,41274
12
12
  python/core/circuits/errors.py,sha256=KzIXyi2ssVvBmXV0Rgn0dBfsTgweKHjeSvP2byRmqGc,5964
13
13
  python/core/circuits/zk_model_base.py,sha256=5ggOaJjs2_MJvn-PO1cPN3i7U-XR4L-0zJGYuLVKOLc,820
14
14
  python/core/model_processing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  python/core/model_processing/errors.py,sha256=uh2YFjuuU5JM3anMtSTLAH-zjlNAKStmLDZqRUgBWS8,4611
16
16
  python/core/model_processing/converters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  python/core/model_processing/converters/base.py,sha256=eG7iRDbDJJDTG2cCVgYlPlfkpmYPEnMzjGNK9wrA1m0,4303
18
- python/core/model_processing/converters/onnx_converter.py,sha256=ks78fNZfgHU0RDnZZ2T3cdrlDxLnk7jqeR9o8OSqfFw,42862
18
+ python/core/model_processing/converters/onnx_converter.py,sha256=BJc6rU3wLHI3imt8yzm8Cngri3KvcBSUbJ3Urw2PoEQ,44560
19
19
  python/core/model_processing/onnx_custom_ops/__init__.py,sha256=ofecV9pzpDJJl_r6inRw9JOKxtfK2rzzxWahAq9BKXE,475
20
20
  python/core/model_processing/onnx_custom_ops/conv.py,sha256=6jJm3fcGWzcU4RjVgf179mPFCqsl4C3AR7bqQTffDgA,3464
21
21
  python/core/model_processing/onnx_custom_ops/custom_helpers.py,sha256=2WdnHw9NAoN_6wjIBoAQDyL6wEIlZOqo6ysCZp5DpZs,1844
22
22
  python/core/model_processing/onnx_custom_ops/gemm.py,sha256=bnEUXhqQCEcH4TIfbMTsCTtAlAlRzFvl4jj8g2QZFWU,2674
23
- python/core/model_processing/onnx_custom_ops/maxpool.py,sha256=dlnFIRX3lZGtpqmwSqmhRaCJpogefdtXEAUlv4NuJ0U,2316
23
+ python/core/model_processing/onnx_custom_ops/maxpool.py,sha256=Sd3BwqpGLSVU2iuAAIXAHdI3WO27Aa3g3r29HPiECvM,2319
24
24
  python/core/model_processing/onnx_custom_ops/onnx_helpers.py,sha256=utnJuc5sgb_z1LgxuY9y2cQbMpdEJ8xOOrcP8DhfDCM,5686
25
- python/core/model_processing/onnx_custom_ops/relu.py,sha256=iEOnGn9Hoipta3UepKIz5oO1veBdcctcLRRT-_xMPqE,1202
25
+ python/core/model_processing/onnx_custom_ops/relu.py,sha256=pZsPXC_r0FPggURKDphh8P1IRXY0w4hH7ExBmYTlWjE,1202
26
26
  python/core/model_processing/onnx_quantizer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
27
  python/core/model_processing/onnx_quantizer/exceptions.py,sha256=_YaXXEMbfD1P8N86L5YIz3uCilkuzlhv_2lU90T4FfA,5646
28
- python/core/model_processing/onnx_quantizer/onnx_op_quantizer.py,sha256=JpTZZKlMRLavm7vM8VNC1XQY4up7rY5Je7XIezjI1fc,7468
28
+ python/core/model_processing/onnx_quantizer/onnx_op_quantizer.py,sha256=POoDEBFzkr145P4INgAux2LQY2GdpsBtRpw_UuKVNhw,7679
29
29
  python/core/model_processing/onnx_quantizer/layers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
- python/core/model_processing/onnx_quantizer/layers/base.py,sha256=wY2_65h0bPJHKErGlC4zamSKhhBKq3P7BEYIgwPKAV8,13259
31
- python/core/model_processing/onnx_quantizer/layers/constant.py,sha256=iWfurTtJk-KaQW6OI4oIDvA8H3clfVwTmf5Xy-QrM0U,3699
32
- python/core/model_processing/onnx_quantizer/layers/conv.py,sha256=ay9pkctbPfHmra9qZLhz5YCcEGuI67lnXZbJ5rNTgH8,6043
33
- python/core/model_processing/onnx_quantizer/layers/gemm.py,sha256=VRhN2goyhKFUmGMFX14p3vHvxNAvA1GLKyzjCRUnBoI,5554
34
- python/core/model_processing/onnx_quantizer/layers/maxpool.py,sha256=ie9rAwdQAh-QoymkrkEeFcRNLqgVk2MdmuJs4iRTc8k,4650
35
- python/core/model_processing/onnx_quantizer/layers/relu.py,sha256=h6KLK4rboTMc3ZA6GpsLTLkD74pumshaA8igLQeb_pw,2357
30
+ python/core/model_processing/onnx_quantizer/layers/add.py,sha256=AGxzqMa0jABIEKOIgPqEAA7EpZtynQtnD9nxI2NHc0s,1409
31
+ python/core/model_processing/onnx_quantizer/layers/base.py,sha256=LvyTvmR2w6jYSJiBvyFluaDgL_Voc6dZ00TTWi6V7Tc,17426
32
+ python/core/model_processing/onnx_quantizer/layers/constant.py,sha256=l1IvgvXkmFMiaBsym8wchPF-y1ZH-c5PmFUy92IXWok,3694
33
+ python/core/model_processing/onnx_quantizer/layers/conv.py,sha256=TlUpCRO6PPqH7MPkIrEiEcVfzuiN1WMYEiNIjhYXtWM,4451
34
+ python/core/model_processing/onnx_quantizer/layers/gemm.py,sha256=7fCUMv8OLVZ45a2lYjA2XNvcW3By7lSbX7zeForNK-0,3950
35
+ python/core/model_processing/onnx_quantizer/layers/maxpool.py,sha256=PJ8hZPPBpfWV_RZdySl50-BU8TATjcg8Tg_mrAVS1Ic,4916
36
+ python/core/model_processing/onnx_quantizer/layers/relu.py,sha256=d-5fyeKNLTgKKnqCwURpxkjl7QdbJQpuovtCFBM03FA,1685
36
37
  python/core/model_templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
38
  python/core/model_templates/circuit_template.py,sha256=X8bA4AdmtQeb3ltU74GaWYfrOFhqs_DOpUqRMFXLAD8,2352
38
39
  python/core/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
40
  python/core/utils/benchmarking_helpers.py,sha256=0nT38SCrjP_BlvJODsc9twF9ZmIFg_1sAvSyeNfv4mQ,5235
40
41
  python/core/utils/constants.py,sha256=Qu5_6OUe1XIsL-IY5_4923eN7x1-SPv6ohQonztAobA,102
41
42
  python/core/utils/errors.py,sha256=vTlluhbSqmyI5e1JNLEZ1mQ-dG_Wbxe4p5l4aa59zAY,3739
42
- python/core/utils/general_layer_functions.py,sha256=l_aIqMbSUKxWdUTI_sVLqTdNZj_NnpzXXejSHidhoag,9706
43
+ python/core/utils/general_layer_functions.py,sha256=tg2WWhmR-4TlKn8OeCu1qNbLf8qdKVP3jl9mhZn_sTg,9781
43
44
  python/core/utils/helper_functions.py,sha256=3JwJa4wHoUBteukDw4bAetqMsQLeJ0_sJ0qIdKy7GCY,37097
44
- python/core/utils/model_registry.py,sha256=nhx1N2bV6YtqEtRuCnA6GB8TSZf2kdwzuGlUgYQc9F8,4789
45
+ python/core/utils/model_registry.py,sha256=aZg_9LEqsBXK84oxQ8A3NGZl-9aGnLgfR-kgxkOwV50,4895
45
46
  python/core/utils/scratch_tests.py,sha256=UYXsWIBh_27OxnyfH9CuxeNFT-OWCK0YpJ-j-8f0QHc,2332
46
47
  python/core/utils/witness_utils.py,sha256=ukvbF6EaHMPzRQVZad9wQ9gISRwBGQ1hEAHzc5TpGuw,9488
47
48
  python/frontend/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -67,15 +68,41 @@ python/tests/test_cli.py,sha256=OiAyG3aBpukk0i5FFWbiKaF42wf-7By-UWDHNjwtsqo,2704
67
68
  python/tests/circuit_e2e_tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
68
69
  python/tests/circuit_e2e_tests/circuit_model_developer_test.py,sha256=Ic9hprCn1Rs-XAF-SUmBNEDn65yaCxUK9z5875KPg5o,39416
69
70
  python/tests/circuit_e2e_tests/helper_fns_for_tests.py,sha256=4toXD0pJMYVZFL1O9JZAJF-iqbi9k1eyuk_goUnchRo,5190
70
- python/tests/circuit_e2e_tests/other_e2e_test.py,sha256=o2YfYNwdWRbalB4pE3qZTyTs5nHAAWN33vVHtl_OHv0,6034
71
+ python/tests/circuit_e2e_tests/other_e2e_test.py,sha256=amWRa1tIBHdQpd9-XS7vBXG0tkdV_9K9fH-FT5LFh7E,11301
71
72
  python/tests/circuit_parent_classes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
72
- python/tests/circuit_parent_classes/test_circuit.py,sha256=t4h4Bkz3PJpm2fARGw6TJS4S9cE0uTa8FFkkAUaBGEI,30685
73
- python/tests/circuit_parent_classes/test_onnx_converter.py,sha256=naNDsxpcxH2ClsUgv5_TS_ZOpLo8XSGse_x7gfFLTUY,6266
73
+ python/tests/circuit_parent_classes/test_circuit.py,sha256=5vgcZHD2wY_pIRFNAhEZuBJD4uw2QyTck75Z9CJaACE,45968
74
+ python/tests/circuit_parent_classes/test_onnx_converter.py,sha256=sJ0o8sducNUtmYKmsqfx7WEsIEd6oNbnWk71rXS_nIU,6575
74
75
  python/tests/circuit_parent_classes/test_ort_custom_layers.py,sha256=FEEY8nbuMC2xb6WrBsik7TeDde6SlMwwG9PKSqmCymo,3980
76
+ python/tests/onnx_quantizer_tests/__init__.py,sha256=IZPGWHgjoay3gM1p2WJNh5cnZ79EP2VP-bcKy8AfJjY,18
77
+ python/tests/onnx_quantizer_tests/test_base_layer.py,sha256=Ro7k-eUbGCyfIZ-OVNjLlCIz3mb02uHFWboFuWOdXKs,6526
78
+ python/tests/onnx_quantizer_tests/test_exceptions.py,sha256=pwhARalEXx7REkcnIVZPi-4J1wgzgZN4xG-wLsx4rTs,3473
79
+ python/tests/onnx_quantizer_tests/test_onnx_op_quantizer.py,sha256=m6mNe1KDRFIE2P0YURTIAim9-Di0BoPPAaaOOlorDIk,7367
80
+ python/tests/onnx_quantizer_tests/test_registered_quantizers.py,sha256=M8N3KxApfIpZIu2Swh_z8eSy3DDqB3XxebN685hHHlw,4052
81
+ python/tests/onnx_quantizer_tests/testing_helper_functions.py,sha256=N0fQv2pYzUCVZ7wkcR8gEKs5zTXT1hWrK-HKSTQYvYU,534
82
+ python/tests/onnx_quantizer_tests/layers/__init__.py,sha256=xP-RmW6LfIANgK1s9Q0KZet2yvNr-3c6YIVLAAQqGUY,404
83
+ python/tests/onnx_quantizer_tests/layers/add_config.py,sha256=T3tGddupDtrvLck2SL2yETDblNtv0aU7Tl7fNyZUhO4,4133
84
+ python/tests/onnx_quantizer_tests/layers/base.py,sha256=uLCqhMcBA7zWiRSLRMNKKb4A9N27l-RUqSEEQ8SR3xI,9393
85
+ python/tests/onnx_quantizer_tests/layers/constant_config.py,sha256=RdrKNMNZjI3Sk5o8WLNqmBUyYVJRWgtFbQ6oFWMwyQk,1193
86
+ python/tests/onnx_quantizer_tests/layers/conv_config.py,sha256=H0ioW4H3ei5IK4tKhrA0ffThxJ4K5oO9jIs9A0T0VaM,6005
87
+ python/tests/onnx_quantizer_tests/layers/factory.py,sha256=WLLEP9ECmSpTliSjhtdWOHcX1xOi6HM10S9Y4re1A74,4844
88
+ python/tests/onnx_quantizer_tests/layers/flatten_config.py,sha256=Xln5Hh6gyeM5gGRCjLGvIL-u08NEs1tXSF32urCqPfE,2110
89
+ python/tests/onnx_quantizer_tests/layers/gemm_config.py,sha256=t7nJY-Wnj6YUD821-jaWzgrQVPa6ytwER3hFMsvyY6Y,7294
90
+ python/tests/onnx_quantizer_tests/layers/maxpool_config.py,sha256=XfTPk_ZQXEzaCjHHymSLVv2HS-PKH1rS9IuyyoEtM78,3176
91
+ python/tests/onnx_quantizer_tests/layers/relu_config.py,sha256=_aHuddDApLUBOa0FiR9h4fNfmMSnH5r4JzOMLW0KaTk,2197
92
+ python/tests/onnx_quantizer_tests/layers/reshape_config.py,sha256=fZchSqIAy76m7j97wVC_UI6slSpv8nbwukhkbGR2sRE,2203
93
+ python/tests/onnx_quantizer_tests/layers_tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
94
+ python/tests/onnx_quantizer_tests/layers_tests/base_test.py,sha256=UgbcT97tgcuTtO1pOADpww9bz_JElKiI2mxLJYKyF1k,2992
95
+ python/tests/onnx_quantizer_tests/layers_tests/test_check_model.py,sha256=Vxn4LEWHZeGa_vS1-7ptFqSSBb0D-3BG-ETocP4pvsI,3651
96
+ python/tests/onnx_quantizer_tests/layers_tests/test_e2e.py,sha256=40779aaHgdryVwLlIO18F1d7uSLSXdJUG5Uj_5-xD4U,6712
97
+ python/tests/onnx_quantizer_tests/layers_tests/test_error_cases.py,sha256=t5c_zqO4Ex3HIFWcykX4PTftdKN7UWnEOF5blShL0Ik,1881
98
+ python/tests/onnx_quantizer_tests/layers_tests/test_integration.py,sha256=Mq1-PBKR3756i9VrFOP5DY3GkRE32D6Hjd1fK9wZdVk,7228
99
+ python/tests/onnx_quantizer_tests/layers_tests/test_quantize.py,sha256=zclzXxtgA5BEmNwSf_aNbJgbsArMXn5WDdlxiMR2-aM,9255
100
+ python/tests/onnx_quantizer_tests/layers_tests/test_scalability.py,sha256=RfnIIiYbgPbU3620H6MPvSxE3MNR2G1yPELwdWV3mK4,4107
101
+ python/tests/onnx_quantizer_tests/layers_tests/test_validation.py,sha256=jz-WtIEP-jjUklOOAnznwPUXbf07U2PAMGrhzMWP0JU,1371
75
102
  python/tests/utils_testing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
76
103
  python/tests/utils_testing/test_helper_functions.py,sha256=xmeGQieh4LE9U-CDKBlHhSWqH0cAmmDU3qXNbDkkvms,27192
77
- jstprove-1.0.0.dist-info/METADATA,sha256=nM_w5Qsh8TwJJ6PDGZcBzND029Fj4uWwmilqQXVx_mw,14047
78
- jstprove-1.0.0.dist-info/WHEEL,sha256=jc2C2uw104ioj1TL9cE0YO67_kdAwX4W8JgYPomxr5M,105
79
- jstprove-1.0.0.dist-info/entry_points.txt,sha256=nGcTSO-4q08gPl1IoWdrPaiY7IbO7XvmXKkd34dYHc8,49
80
- jstprove-1.0.0.dist-info/top_level.txt,sha256=J-z0poNcsv31IHB413--iOY8LoHBKiTHeybHX3abokI,7
81
- jstprove-1.0.0.dist-info/RECORD,,
104
+ jstprove-1.1.0.dist-info/METADATA,sha256=3gdOLaD4eYGawv4SuvofjuzBW-y564J4gpNPXHFNY1A,14056
105
+ jstprove-1.1.0.dist-info/WHEEL,sha256=jc2C2uw104ioj1TL9cE0YO67_kdAwX4W8JgYPomxr5M,105
106
+ jstprove-1.1.0.dist-info/entry_points.txt,sha256=nGcTSO-4q08gPl1IoWdrPaiY7IbO7XvmXKkd34dYHc8,49
107
+ jstprove-1.1.0.dist-info/top_level.txt,sha256=J-z0poNcsv31IHB413--iOY8LoHBKiTHeybHX3abokI,7
108
+ jstprove-1.1.0.dist-info/RECORD,,
@@ -127,11 +127,16 @@ class GenericModelONNX(ONNXConverter, ZKModelBase):
127
127
  )
128
128
  return models_onnx_path
129
129
 
130
- def adjust_inputs(self: GenericModelONNX, input_file: str) -> str:
130
+ def adjust_inputs(
131
+ self: GenericModelONNX,
132
+ inputs: dict[str, np.ndarray],
133
+ input_file: str,
134
+ ) -> str:
131
135
  """Preprocess and flatten model inputs for the circuit.
132
136
 
133
137
  Args:
134
- input_file (str): Input data file or array compatible with the model.
138
+ inputs (str): inputs, read from json file
139
+ input_file (str): path to input_file
135
140
 
136
141
  Returns:
137
142
  str: Adjusted input file after reshaping and scaling.
@@ -140,7 +145,7 @@ class GenericModelONNX(ONNXConverter, ZKModelBase):
140
145
  input_shape = self.input_shape.copy()
141
146
  shape = self.adjust_shape(input_shape)
142
147
  self.input_shape = [math.prod(shape)]
143
- x = super().adjust_inputs(input_file)
148
+ x = super().adjust_inputs(inputs, input_file)
144
149
  self.input_shape = input_shape.copy()
145
150
  except Exception as e:
146
151
  msg = f"Failed to adjust inputs for GenericModelONNX: {e}"
@@ -169,7 +174,9 @@ class GenericModelONNX(ONNXConverter, ZKModelBase):
169
174
  operation="get_outputs",
170
175
  ) from e
171
176
  else:
172
- return torch.as_tensor(np.array(raw_outputs)).flatten()
177
+ flat_outputs = [o.flatten() for o in raw_outputs]
178
+ combined = np.concatenate(flat_outputs, axis=0)
179
+ return torch.as_tensor(combined)
173
180
 
174
181
  def format_inputs(
175
182
  self: GenericModelONNX,
@@ -186,15 +193,42 @@ class GenericModelONNX(ONNXConverter, ZKModelBase):
186
193
  Returns:
187
194
  Dict[str, List[int]]: Dictionary mapping `input` to scaled integer values.
188
195
  """
196
+
197
+ def _raise_type_error(inputs: np.ndarray | list[int] | torch.Tensor) -> None:
198
+ msg = (
199
+ "Expected np.ndarray, torch.Tensor, "
200
+ f"list, or dict for inputs, got {type(inputs)}"
201
+ )
202
+
203
+ raise TypeError(msg)
204
+
189
205
  try:
190
- x = {"input": inputs}
206
+ if isinstance(inputs, (np.ndarray, torch.Tensor, list)):
207
+ inputs = {"input": inputs}
208
+ elif not isinstance(inputs, dict):
209
+ _raise_type_error(inputs)
191
210
  scaling = BaseOpQuantizer.get_scaling(
192
211
  scale_base=self.scale_base,
193
212
  scale_exponent=self.scale_exponent,
194
213
  )
195
- for key in x: # noqa: PLC0206
196
- x[key] = torch.as_tensor(x[key]).flatten().tolist()
197
- x[key] = (torch.as_tensor(x[key]) * scaling).long().tolist()
214
+
215
+ input_shapes: dict[str, tuple[int, ...]] = {}
216
+ flattened_tensors: list[torch.Tensor] = []
217
+
218
+ # Flatten, scale, and collect each input
219
+ for name, value in inputs.items():
220
+ tensor = torch.as_tensor(value)
221
+ input_shapes[name] = tuple(tensor.shape)
222
+
223
+ scaled = (tensor * scaling).long().flatten()
224
+ flattened_tensors.append(scaled)
225
+
226
+ # Concatenate all inputs into one long tensor
227
+ concatenated = torch.cat(flattened_tensors, dim=0)
228
+ flattened_list = concatenated.tolist()
229
+
230
+ # Wrap it into a dict under "input" key to read into rust
231
+ formatted_inputs = {"input": flattened_list}
198
232
  except Exception as e:
199
233
  msg = f"Failed to format inputs for GenericModelONNX: {e}"
200
234
  raise CircuitProcessingError(
@@ -203,7 +237,7 @@ class GenericModelONNX(ONNXConverter, ZKModelBase):
203
237
  data_type=type(inputs).__name__,
204
238
  ) from e
205
239
  else:
206
- return x
240
+ return formatted_inputs
207
241
 
208
242
  def get_weights(
209
243
  self: GenericModelONNX,