diff --git a/packages/orion-graph/README.md b/packages/orion-graph/README.md index 8bbf1513e..7bc44e216 100644 --- a/packages/orion-graph/README.md +++ b/packages/orion-graph/README.md @@ -1,8 +1,8 @@ -# Orion2 - A scalable and modular ZKML framework +# Orion-Graph - A ZKML framework for graph-based models -Orion2 is a ZKML frameworks that uses composable ZK compilers to achieve modularity and scalability. +Orion-Graph is a ZKML frameworks that uses composable ZK compilers to achieve modularity and scalability. -With Orion2 you only need to add 11 primitive operations (primops) to support a new ZK backend: +With Orion-Graph you only need to add 11 primitive operations (primops) to support a new ZK backend: - **Unary** - Log2, Exp2, Sin, Sqrt, Recip - **Binary** - Add, Mul, Mod, LessThan - **Other** - SumReduce, MaxReduce, Contiguous @@ -13,4 +13,4 @@ Once the graph is built, iterative ZK compiler passes can modify it to replace p This approach leads to a simple library, and performance is only limited by the creativity of the compiler programmer, not the model programmer. -![Orion2](https://github.com/gizatechxyz/orion2/assets/113879115/75320a2f-336f-49c8-a40e-7538aee50f9d) +![Orion Diagram](packages/orion-graph/imgs/Orion-Graph-Diagram.png) diff --git a/packages/orion-graph/imgs/Orion-Graph-Diagram.png b/packages/orion-graph/imgs/Orion-Graph-Diagram.png new file mode 100644 index 000000000..4b10e927f Binary files /dev/null and b/packages/orion-graph/imgs/Orion-Graph-Diagram.png differ diff --git a/packages/orion-graph/tests/test_cairo.py b/packages/orion-graph/tests/test_cairo.py index d7b4e1794..c5e1edff0 100644 --- a/packages/orion-graph/tests/test_cairo.py +++ b/packages/orion-graph/tests/test_cairo.py @@ -3,11 +3,11 @@ def test_cairo(): """ - Test function for the zk-backend cairo. + Test function for the zk-backends cairo. """ zk_backend = 'cairo' - result = subprocess.run(['scarb', 'test'], cwd=f"zk-backend/{zk_backend}", capture_output=True, text=True) + result = subprocess.run(['scarb', 'test'], cwd=f"zk-backends/{zk_backend}", capture_output=True, text=True) print(result.stdout) print(result.stderr) diff --git a/packages/orion-graph/zk-backend/cairo/.gitignore b/packages/orion-graph/zk-backends/cairo/.gitignore similarity index 100% rename from packages/orion-graph/zk-backend/cairo/.gitignore rename to packages/orion-graph/zk-backends/cairo/.gitignore diff --git a/packages/orion-graph/zk-backend/cairo/.tool-versions b/packages/orion-graph/zk-backends/cairo/.tool-versions similarity index 100% rename from packages/orion-graph/zk-backend/cairo/.tool-versions rename to packages/orion-graph/zk-backends/cairo/.tool-versions diff --git a/packages/orion-graph/zk-backend/cairo/Scarb.toml b/packages/orion-graph/zk-backends/cairo/Scarb.toml similarity index 100% rename from packages/orion-graph/zk-backend/cairo/Scarb.toml rename to packages/orion-graph/zk-backends/cairo/Scarb.toml diff --git a/packages/orion-graph/zk-backend/cairo/src/helpers.cairo b/packages/orion-graph/zk-backends/cairo/src/helpers.cairo similarity index 100% rename from packages/orion-graph/zk-backend/cairo/src/helpers.cairo rename to packages/orion-graph/zk-backends/cairo/src/helpers.cairo diff --git a/packages/orion-graph/zk-backend/cairo/src/lib.cairo b/packages/orion-graph/zk-backends/cairo/src/lib.cairo similarity index 100% rename from packages/orion-graph/zk-backend/cairo/src/lib.cairo rename to packages/orion-graph/zk-backends/cairo/src/lib.cairo diff --git a/packages/orion-graph/zk-backend/cairo/src/numbers.cairo b/packages/orion-graph/zk-backends/cairo/src/numbers.cairo similarity index 100% rename from packages/orion-graph/zk-backend/cairo/src/numbers.cairo rename to packages/orion-graph/zk-backends/cairo/src/numbers.cairo diff --git a/packages/orion-graph/zk-backend/cairo/src/numbers/erf.cairo b/packages/orion-graph/zk-backends/cairo/src/numbers/erf.cairo similarity index 100% rename from packages/orion-graph/zk-backend/cairo/src/numbers/erf.cairo rename to packages/orion-graph/zk-backends/cairo/src/numbers/erf.cairo diff --git a/packages/orion-graph/zk-backend/cairo/src/numbers/f16x16.cairo b/packages/orion-graph/zk-backends/cairo/src/numbers/f16x16.cairo similarity index 100% rename from packages/orion-graph/zk-backend/cairo/src/numbers/f16x16.cairo rename to packages/orion-graph/zk-backends/cairo/src/numbers/f16x16.cairo diff --git a/packages/orion-graph/zk-backend/cairo/src/numbers/helpers.cairo b/packages/orion-graph/zk-backends/cairo/src/numbers/helpers.cairo similarity index 100% rename from packages/orion-graph/zk-backend/cairo/src/numbers/helpers.cairo rename to packages/orion-graph/zk-backends/cairo/src/numbers/helpers.cairo diff --git a/packages/orion-graph/zk-backend/cairo/src/numbers/lut.cairo b/packages/orion-graph/zk-backends/cairo/src/numbers/lut.cairo similarity index 100% rename from packages/orion-graph/zk-backend/cairo/src/numbers/lut.cairo rename to packages/orion-graph/zk-backends/cairo/src/numbers/lut.cairo diff --git a/packages/orion-graph/zk-backend/cairo/src/numbers/math.cairo b/packages/orion-graph/zk-backends/cairo/src/numbers/math.cairo similarity index 100% rename from packages/orion-graph/zk-backend/cairo/src/numbers/math.cairo rename to packages/orion-graph/zk-backends/cairo/src/numbers/math.cairo diff --git a/packages/orion-graph/zk-backend/cairo/src/numbers/trig.cairo b/packages/orion-graph/zk-backends/cairo/src/numbers/trig.cairo similarity index 100% rename from packages/orion-graph/zk-backend/cairo/src/numbers/trig.cairo rename to packages/orion-graph/zk-backends/cairo/src/numbers/trig.cairo diff --git a/packages/orion-graph/zk-backend/cairo/src/primops.cairo b/packages/orion-graph/zk-backends/cairo/src/primops.cairo similarity index 100% rename from packages/orion-graph/zk-backend/cairo/src/primops.cairo rename to packages/orion-graph/zk-backends/cairo/src/primops.cairo diff --git a/packages/orion-graph/zk-backend/cairo/src/tensors.cairo b/packages/orion-graph/zk-backends/cairo/src/tensors.cairo similarity index 100% rename from packages/orion-graph/zk-backend/cairo/src/tensors.cairo rename to packages/orion-graph/zk-backends/cairo/src/tensors.cairo diff --git a/packages/orion-graph/zk-backend/cairo/tests/lib.cairo b/packages/orion-graph/zk-backends/cairo/tests/lib.cairo similarity index 100% rename from packages/orion-graph/zk-backend/cairo/tests/lib.cairo rename to packages/orion-graph/zk-backends/cairo/tests/lib.cairo diff --git a/packages/orion-graph/zk-backend/cairo/tests/test_mul.cairo b/packages/orion-graph/zk-backends/cairo/tests/test_mul.cairo similarity index 100% rename from packages/orion-graph/zk-backend/cairo/tests/test_mul.cairo rename to packages/orion-graph/zk-backends/cairo/tests/test_mul.cairo diff --git a/packages/orion-graph/zk-backend/cairo/tests/test_mul_broadcast.cairo b/packages/orion-graph/zk-backends/cairo/tests/test_mul_broadcast.cairo similarity index 100% rename from packages/orion-graph/zk-backend/cairo/tests/test_mul_broadcast.cairo rename to packages/orion-graph/zk-backends/cairo/tests/test_mul_broadcast.cairo diff --git a/packages/orion-graph/zk-backend/cairo/tests/test_reduce_sum_default_axes_keepdims.cairo b/packages/orion-graph/zk-backends/cairo/tests/test_reduce_sum_default_axes_keepdims.cairo similarity index 100% rename from packages/orion-graph/zk-backend/cairo/tests/test_reduce_sum_default_axes_keepdims.cairo rename to packages/orion-graph/zk-backends/cairo/tests/test_reduce_sum_default_axes_keepdims.cairo diff --git a/packages/orion-graph/zk-backend/cairo/tests/test_reduce_sum_empty_axes_input_noop.cairo b/packages/orion-graph/zk-backends/cairo/tests/test_reduce_sum_empty_axes_input_noop.cairo similarity index 100% rename from packages/orion-graph/zk-backend/cairo/tests/test_reduce_sum_empty_axes_input_noop.cairo rename to packages/orion-graph/zk-backends/cairo/tests/test_reduce_sum_empty_axes_input_noop.cairo diff --git a/packages/orion-graph/zk-backend/cairo/tests/test_reduce_sum_keep_dims.cairo b/packages/orion-graph/zk-backends/cairo/tests/test_reduce_sum_keep_dims.cairo similarity index 100% rename from packages/orion-graph/zk-backend/cairo/tests/test_reduce_sum_keep_dims.cairo rename to packages/orion-graph/zk-backends/cairo/tests/test_reduce_sum_keep_dims.cairo diff --git a/packages/orion-graph/zk-backend/cairo/tests/test_reduce_sum_negative_axes_keepdims.cairo b/packages/orion-graph/zk-backends/cairo/tests/test_reduce_sum_negative_axes_keepdims.cairo similarity index 100% rename from packages/orion-graph/zk-backend/cairo/tests/test_reduce_sum_negative_axes_keepdims.cairo rename to packages/orion-graph/zk-backends/cairo/tests/test_reduce_sum_negative_axes_keepdims.cairo diff --git a/packages/orion-graph/zk-backend/cairo/tests/test_reduce_sum_no_keep_dims.cairo b/packages/orion-graph/zk-backends/cairo/tests/test_reduce_sum_no_keep_dims.cairo similarity index 100% rename from packages/orion-graph/zk-backend/cairo/tests/test_reduce_sum_no_keep_dims.cairo rename to packages/orion-graph/zk-backends/cairo/tests/test_reduce_sum_no_keep_dims.cairo diff --git a/packages/orion-graph/zk-backend/cairo/tests/utils.cairo b/packages/orion-graph/zk-backends/cairo/tests/utils.cairo similarity index 100% rename from packages/orion-graph/zk-backend/cairo/tests/utils.cairo rename to packages/orion-graph/zk-backends/cairo/tests/utils.cairo diff --git a/packages/orion-numbers/README.md b/packages/orion-numbers/README.md new file mode 100644 index 000000000..dca06fa3d --- /dev/null +++ b/packages/orion-numbers/README.md @@ -0,0 +1,15 @@ +# Orion-Numbers: A Cairo Numbers Library + +## Fixed Points +A fixed point library, inspired by [Cubit lib](https://github.com/influenceth/cubit). + +### Supported Implementations + +| Implementations | Status | +| :-------------: | :----: | +| 16x16 | ✅ | +| 32x32 | ⏳ | +| 64x64 | ⏳ | + + +A signed 16.16-bit fixed point number is a fraction in which the numerator is a signed 32-bit integer and the denominator is 2^16. Since the denominator stays the same there is no need to store it (as in a floating point value).