Skip to content

Commit

Permalink
Merge branch 'main' into ac/numerical-accuracy-report
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-camuto committed Jan 6, 2024
2 parents 9b0df1e + e97713f commit 955bec6
Show file tree
Hide file tree
Showing 35 changed files with 330 additions and 7,660 deletions.
129 changes: 77 additions & 52 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cargo-features = ["profile-rustflags"]

[package]
name = "ezkl"
version = "0.0.0"
Expand Down Expand Up @@ -27,7 +29,7 @@ hex = { version = "0.4.3", default_features = false }
halo2_wrong_ecc = { git = "https://github.com/zkonduit/halo2wrong", branch = "ac/chunked-mv-lookup", package = "ecc" }
snark-verifier = { git = "https://github.com/zkonduit/snark-verifier", branch = "ac/chunked-mv-lookup", features=["derive_serde"]}
halo2_solidity_verifier = { git = "https://github.com/alexander-camuto/halo2-solidity-verifier", branch= "ac/lookup-modularity" }
rayon = { version = "1.7.0", default_features = false }
maybe-rayon = { version = "0.1.1", default_features = false }
bincode = { version = "1.3.3", default_features = false }
ark-std = { version = "^0.3.0", default-features = false }
unzip-n = "0.1.2"
Expand Down Expand Up @@ -155,3 +157,11 @@ ezkl = ["onnx", "serde", "serde_json", "log", "colored", "env_logger", "tabled/c
mv-lookup = ["halo2_proofs/mv-lookup", "snark-verifier/mv-lookup", "halo2_solidity_verifier/mv-lookup"]
det-prove = []
icicle = ["halo2_proofs/icicle_gpu"]


# icicle patch to 0.1.0 if feature icicle is enabled
[patch.'https://github.com/ingonyama-zk/icicle']
icicle = { git = "https://github.com/ingonyama-zk/icicle?rev=45b00fb", package = "icicle", branch = "fix/vhnat/ezkl-build-fix"}

[profile.release]
rustflags = [ "-C", "relocation-model=pic" ]
1 change: 0 additions & 1 deletion examples/notebooks/data_attest.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,6 @@
"\n",
"res = ezkl.create_evm_data_attestation(\n",
" input_path,\n",
" vk_path,\n",
" settings_path,\n",
" sol_code_path,\n",
" abi_path,\n",
Expand Down
5 changes: 2 additions & 3 deletions examples/notebooks/data_attest_hashed.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -568,7 +568,6 @@
"\n",
"res = ezkl.create_evm_data_attestation(\n",
" input_path,\n",
" vk_path,\n",
" settings_path,\n",
" sol_code_path,\n",
" abi_path,\n",
Expand Down Expand Up @@ -649,7 +648,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.15"
"version": "3.9.13"
},
"orig_nbformat": 4
},
Expand Down
1 change: 0 additions & 1 deletion examples/notebooks/ezkl_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,6 @@
" proof_path,\n",
" settings_path,\n",
" vk_path,\n",
" \n",
" )\n",
"\n",
"assert res == True\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/notebooks/svm.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 10,
"id": "b1c561a8",
"metadata": {},
"outputs": [],
Expand Down
1 change: 0 additions & 1 deletion examples/notebooks/world_rotation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@
"\n",
"res = ezkl.create_evm_data_attestation(\n",
" input_path,\n",
" vk_path,\n",
" settings_path,\n",
" sol_code_path,\n",
" abi_path,\n",
Expand Down
10 changes: 6 additions & 4 deletions examples/onnx/1l_topk/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ def __init__(self):
super(MyModel, self).__init__()

def forward(self, x):
topk = torch.topk(x, 4)
print(topk)
return [topk.values]
topk_largest = torch.topk(x, 4)
topk_smallest = torch.topk(x, 4, largest=False)
print(topk_largest)
print(topk_smallest)
return topk_largest.values + topk_smallest.values


circuit = MyModel()
Expand All @@ -21,7 +23,7 @@ def forward(self, x):

torch.onnx.export(circuit, x, "network.onnx",
export_params=True, # store the trained parameter weights inside the model file
opset_version=10, # the ONNX version to export the model to
opset_version=14, # the ONNX version to export the model to
do_constant_folding=True, # whether to execute constant folding for optimization
input_names=['input'], # the model's input names
output_names=['output'], # the model's output names
Expand Down
2 changes: 1 addition & 1 deletion examples/onnx/1l_topk/input.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"input_data": [[2, 1, 5, 3, 3, 7]], "output_data": [[7, 5, 3, 3]]}
{"input_data": [[2, 1, 5, 4, 8, 2]], "output_data": [[9, 7, 6, 6]]}
Binary file modified examples/onnx/1l_topk/network.onnx
Binary file not shown.
Loading

0 comments on commit 955bec6

Please sign in to comment.