-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[matrix]: simplify scale_row #31
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onesk
approved these changes
Feb 14, 2025
storojs72
added a commit
to argumentcomputer/binius
that referenced
this pull request
Feb 25, 2025
* Support for Karatsuba "infinity" point in evaluation & interpolation domains * [sumcheck] Small field zerocheck and its HAL support removed * [ring_switch] Optimize RingSwitchEqInd::multilinear_extension * [clippy]: avoid needless pass by value * [math] Fix `fold_right` crash on big multilinears and make it single threaded * [math] Use specialized zero variable folding in the first sumcheck round. * [test]: add test coverage for eq_ind_partial_eval * [test]: add test coverage for inner_product_par * [test]: test coverage for MultilinearQuery update * [tracing] Display proof size in graph * [ci]: Setting Up GitHub Pipelines * [ci]: Setting Up Mirror to GitLab (#8) * Fix typos (#2) [nicetohave] fix typos * [ci]: Improvements (IrreducibleOSS#17) [ci]: Removing continue or error, and depricating Gitlab pipelines * Improve test compilation time (#10) Co-authored-by: Dmytro Gordon <[email protected]> This MR addresses tow issues that make cargo test slow: Thin LTO slows down compilation of all the crates a bit. It takes quite a time to compile and link all the examples with test profile which are not actually executed. So I've added an alias to compile and run tests only for fast local usage. * [serialization] Add canonical serialize/deserialize traits + derive macros Introduces the following traits: SerializeCanonical (which replaces most uses of SerializeBytes) DeserializeCanonical (which replaces most uses of DeserializeBytes) Conveniently, this also comes with proc-macros for deriving these traits for an arbitrary struct/enum (unions are not supported). * [security]: Add CODEOWNERS file for GitHub * [scripts] Added benchmarking script This adds the script to benchmark various of our examples, default sampling is set to 5 to reduce total time to benchmark. * [field] Implement PackedField::unzip * [cleanup]: Remove some useless checked_log_2 calls * [field] Add TowerField::min_tower_level(self), and use it to derive ArithExpr tower_level from its constants (#6) In contrast to TowerField::TOWER_LEVEL, TowerField::binary_tower_level(self) returns the smallest tower level that can fit the current value. This can be useful for shrinking field values to the smaller container that fits them, for the purpose of making arithmetic operations (in particular multiplication) cheaper. * [core]: simplify merkle tree `verify_opening` (IrreducibleOSS#14) * [ci] Adjusting nightly benchmark repository (IrreducibleOSS#23) * [ci]: Adjusting nightly benchmark repository * [ci]: Adjusting CODEOWNERS for .github/ subdir * [circuits] Simplify usage of ConstraintSystemBuilder by making it less generic (IrreducibleOSS#22) [circuits] Simplfy ConstraintSystemBuilder to only support BinaryField128b for the top field. * [field] Simplify usage of PackedExtension, RepackedExtension by making each trait imply its bounds (IrreducibleOSS#24) * [macros] Remove unused IterOracles, IterPolys derive proc macros (IrreducibleOSS#25) * [matrix]: simplify scale_row (IrreducibleOSS#31) * [field] Remove unnecessary `WithUnderlier` trait bound (IrreducibleOSS#32) * [field] Optimize SIMD element access for Zen4 architecture as well. (IrreducibleOSS#28) * refactor: Use binary_tower_level for base field detection (IrreducibleOSS#30) * [serialization] impl SerializeCanonical, DeserializeCanonical for ConstraintSystem (IrreducibleOSS#11) * [circuits] Optimize plain_lookup using selector flushing (IrreducibleOSS#29) * [scripts] Remove groestl run from benchmark script (IrreducibleOSS#26) * [arith_expr]: Statically compile exponentiation in ArithCircuitPoly (IrreducibleOSS#15) * [serialization] Introduce SerializationMode (IrreducibleOSS#36) Changes: Adds SerializaitonMode that specifies whether to use native (fast) or canonical (needed for transcript) serialization/deserializtion. You need to use the same mode for serialization and deserialization. SerializeCanonical is renamed to SerializeBytes, and takes an extra argument of type SerializationMode DeserializeCanonical is renamed to DeserializeBytes and takes an extra argument of type SerializationMode SerializeBytes and DeserializeBytes are now required bounds for the Field trait, rather than being generically implemented for TowerField. u16, u32, u64, u128 now serialize to/deserialize from little-endian rather than big-endian byte order, to be consistent with BinaryField*b serialization. The serialization traits are moved back to binius_utils Automatic implementations of SerializeBytes for Box<T: SerializeBytes> and &(T: SerializeBytes) Automatic implementation of DeserializeBytes for Box<T: DeserializeBytes> * [gkr_int_mul] Fix type bounds (IrreducibleOSS#34) * feat: Blake3 G function gadget (IrreducibleOSS#16) * [circuits] Add test_circuit helper (IrreducibleOSS#27) * Leave only the object-safe version of the `CompositionPoly` trait (IrreducibleOSS#43) * ]field] Byte-sliced fields changes (IrreducibleOSS#21) * Refactor a bit TowerLevels to remove packed field parameter from the TowerLevel to the Data associated type. This also makes generic bounds a bit more clean, since TowerLevel itself doesn't depend on a concrete packed field type. * Add support of byte-sliced fields with arbitrary register size, i.e. 128b, 256b, 512b. * Add shifts and unpack low/high within 128-bit lanes to UnderlierWithBitOps. This allows implementing transposition in an efficient way. * Add the transparent implementation of UnderlierWithBitOps for PackedScaledUnderlier as we need it to re-use PackedScaledField. * feat: Add example of LinearCombination column usage * ci: Add basic Rust CI (#2) * ci: Add basic Rust CI * Fix test flags * example: Linear combination with offset (#4) * example: Add linear-combination-with-offset usage example * chore: Add example for bit masking using LinearCombination * chore: Add byte decomposition constraint * example: Implement bit-shifting/rotating and packing (#5) * example: Add example of Shifted column usage * example: Add example of Packed column usage * chore: Add 'unconstrained gadgets' warning * example: Projected / Repeated columns usage (#6) * example: Add example of Projected column usage * example: Add example of Repeated column usage * example: Add example of ZeroPadded column usage * examples: Transparent columns usage (part 1) (#8) * feat: Add example of Transparent (Constant) column usage * example: Add example of Transparent (Powers) column usage * example: Add example of Transparent (DisjointProduct) column usage * example: Add example of Transparent (EqIndPartialEval) column usage * examples: Transparent columns usage (part 2) (#9) * example: Add example of Transparent (MultilinearExtensionTransparent) column usage * example: Add example of Transparent (SelectRow) column usage * example: Add example of Transparent (ShiftIndPartialEval) column usage * example: Add example of Transparent (StepDown) column usage * example: Add example of Transparent (StepUp) column usage * example: Add example of Transparent (TowerBasis) column usage * chore: Forward port * feat: Blake3 permutation using channels API * chore: Formatting --------- Co-authored-by: Nikita Lesnikov <[email protected]> Co-authored-by: Dmitry Gordon <[email protected]> Co-authored-by: Thomas Coratger <[email protected]> Co-authored-by: Aliaksei Dziadziuk <[email protected]> Co-authored-by: Milos Backonja <[email protected]> Co-authored-by: Milos Backonja <[email protected]> Co-authored-by: chloefeal <[email protected]> Co-authored-by: Dmytro Gordon <[email protected]> Co-authored-by: Tobias Bergkvist <[email protected]> Co-authored-by: Anex007 <[email protected]> Co-authored-by: Thomas Coratger <[email protected]> Co-authored-by: Nikita Lesnikov <[email protected]> Co-authored-by: Joseph Johnston <[email protected]> Co-authored-by: Samuel Burnham <[email protected]>
storojs72
added a commit
to argumentcomputer/binius
that referenced
this pull request
Feb 25, 2025
* Support for Karatsuba "infinity" point in evaluation & interpolation domains * [sumcheck] Small field zerocheck and its HAL support removed * [ring_switch] Optimize RingSwitchEqInd::multilinear_extension * [clippy]: avoid needless pass by value * [math] Fix `fold_right` crash on big multilinears and make it single threaded * [math] Use specialized zero variable folding in the first sumcheck round. * [test]: add test coverage for eq_ind_partial_eval * [test]: add test coverage for inner_product_par * [test]: test coverage for MultilinearQuery update * [tracing] Display proof size in graph * [ci]: Setting Up GitHub Pipelines * [ci]: Setting Up Mirror to GitLab (#8) * Fix typos (#2) [nicetohave] fix typos * [ci]: Improvements (IrreducibleOSS#17) [ci]: Removing continue or error, and depricating Gitlab pipelines * Improve test compilation time (#10) Co-authored-by: Dmytro Gordon <[email protected]> This MR addresses tow issues that make cargo test slow: Thin LTO slows down compilation of all the crates a bit. It takes quite a time to compile and link all the examples with test profile which are not actually executed. So I've added an alias to compile and run tests only for fast local usage. * [serialization] Add canonical serialize/deserialize traits + derive macros Introduces the following traits: SerializeCanonical (which replaces most uses of SerializeBytes) DeserializeCanonical (which replaces most uses of DeserializeBytes) Conveniently, this also comes with proc-macros for deriving these traits for an arbitrary struct/enum (unions are not supported). * [security]: Add CODEOWNERS file for GitHub * [scripts] Added benchmarking script This adds the script to benchmark various of our examples, default sampling is set to 5 to reduce total time to benchmark. * [field] Implement PackedField::unzip * [cleanup]: Remove some useless checked_log_2 calls * [field] Add TowerField::min_tower_level(self), and use it to derive ArithExpr tower_level from its constants (#6) In contrast to TowerField::TOWER_LEVEL, TowerField::binary_tower_level(self) returns the smallest tower level that can fit the current value. This can be useful for shrinking field values to the smaller container that fits them, for the purpose of making arithmetic operations (in particular multiplication) cheaper. * [core]: simplify merkle tree `verify_opening` (IrreducibleOSS#14) * [ci] Adjusting nightly benchmark repository (IrreducibleOSS#23) * [ci]: Adjusting nightly benchmark repository * [ci]: Adjusting CODEOWNERS for .github/ subdir * [circuits] Simplify usage of ConstraintSystemBuilder by making it less generic (IrreducibleOSS#22) [circuits] Simplfy ConstraintSystemBuilder to only support BinaryField128b for the top field. * [field] Simplify usage of PackedExtension, RepackedExtension by making each trait imply its bounds (IrreducibleOSS#24) * [macros] Remove unused IterOracles, IterPolys derive proc macros (IrreducibleOSS#25) * [matrix]: simplify scale_row (IrreducibleOSS#31) * [field] Remove unnecessary `WithUnderlier` trait bound (IrreducibleOSS#32) * [field] Optimize SIMD element access for Zen4 architecture as well. (IrreducibleOSS#28) * refactor: Use binary_tower_level for base field detection (IrreducibleOSS#30) * [serialization] impl SerializeCanonical, DeserializeCanonical for ConstraintSystem (IrreducibleOSS#11) * [circuits] Optimize plain_lookup using selector flushing (IrreducibleOSS#29) * [scripts] Remove groestl run from benchmark script (IrreducibleOSS#26) * [arith_expr]: Statically compile exponentiation in ArithCircuitPoly (IrreducibleOSS#15) * [serialization] Introduce SerializationMode (IrreducibleOSS#36) Changes: Adds SerializaitonMode that specifies whether to use native (fast) or canonical (needed for transcript) serialization/deserializtion. You need to use the same mode for serialization and deserialization. SerializeCanonical is renamed to SerializeBytes, and takes an extra argument of type SerializationMode DeserializeCanonical is renamed to DeserializeBytes and takes an extra argument of type SerializationMode SerializeBytes and DeserializeBytes are now required bounds for the Field trait, rather than being generically implemented for TowerField. u16, u32, u64, u128 now serialize to/deserialize from little-endian rather than big-endian byte order, to be consistent with BinaryField*b serialization. The serialization traits are moved back to binius_utils Automatic implementations of SerializeBytes for Box<T: SerializeBytes> and &(T: SerializeBytes) Automatic implementation of DeserializeBytes for Box<T: DeserializeBytes> * [gkr_int_mul] Fix type bounds (IrreducibleOSS#34) * feat: Blake3 G function gadget (IrreducibleOSS#16) * [circuits] Add test_circuit helper (IrreducibleOSS#27) * Leave only the object-safe version of the `CompositionPoly` trait (IrreducibleOSS#43) * ]field] Byte-sliced fields changes (IrreducibleOSS#21) * Refactor a bit TowerLevels to remove packed field parameter from the TowerLevel to the Data associated type. This also makes generic bounds a bit more clean, since TowerLevel itself doesn't depend on a concrete packed field type. * Add support of byte-sliced fields with arbitrary register size, i.e. 128b, 256b, 512b. * Add shifts and unpack low/high within 128-bit lanes to UnderlierWithBitOps. This allows implementing transposition in an efficient way. * Add the transparent implementation of UnderlierWithBitOps for PackedScaledUnderlier as we need it to re-use PackedScaledField. * feat: Add example of LinearCombination column usage * ci: Add basic Rust CI (#2) * ci: Add basic Rust CI * Fix test flags * example: Linear combination with offset (#4) * example: Add linear-combination-with-offset usage example * chore: Add example for bit masking using LinearCombination * chore: Add byte decomposition constraint * example: Implement bit-shifting/rotating and packing (#5) * example: Add example of Shifted column usage * example: Add example of Packed column usage * chore: Add 'unconstrained gadgets' warning * example: Projected / Repeated columns usage (#6) * example: Add example of Projected column usage * example: Add example of Repeated column usage * example: Add example of ZeroPadded column usage * examples: Transparent columns usage (part 1) (#8) * feat: Add example of Transparent (Constant) column usage * example: Add example of Transparent (Powers) column usage * example: Add example of Transparent (DisjointProduct) column usage * example: Add example of Transparent (EqIndPartialEval) column usage * examples: Transparent columns usage (part 2) (#9) * example: Add example of Transparent (MultilinearExtensionTransparent) column usage * example: Add example of Transparent (SelectRow) column usage * example: Add example of Transparent (ShiftIndPartialEval) column usage * example: Add example of Transparent (StepDown) column usage * example: Add example of Transparent (StepUp) column usage * example: Add example of Transparent (TowerBasis) column usage * chore: Forward port * feat: Blake3 permutation using channels API * chore: Formatting --------- Co-authored-by: Nikita Lesnikov <[email protected]> Co-authored-by: Dmitry Gordon <[email protected]> Co-authored-by: Thomas Coratger <[email protected]> Co-authored-by: Aliaksei Dziadziuk <[email protected]> Co-authored-by: Milos Backonja <[email protected]> Co-authored-by: Milos Backonja <[email protected]> Co-authored-by: chloefeal <[email protected]> Co-authored-by: Dmytro Gordon <[email protected]> Co-authored-by: Tobias Bergkvist <[email protected]> Co-authored-by: Anex007 <[email protected]> Co-authored-by: Thomas Coratger <[email protected]> Co-authored-by: Nikita Lesnikov <[email protected]> Co-authored-by: Joseph Johnston <[email protected]> Co-authored-by: Samuel Burnham <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The check
assert!(i < self.m);
is already done inself.row_mut(i)