Skip to content
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

Make Prover generic over the ConstraintCommitment type #343

Merged
merged 11 commits into from
Nov 24, 2024

Conversation

gswirski
Copy link
Contributor

@gswirski gswirski commented Nov 22, 2024

For better GPU performance, allow provers to customize ConstraintCommitment implementation/memory layout.

Implementors of the Prover trait would need to add the following lines since default associated types are unstable.

    type ConstraintCommitment<E: FieldElement<BaseField = Felt>> = DefaultConstraintCommitment<E, H, Self::VC>;

   [...]

    #[maybe_async]
    fn build_constraint_commitment<E: FieldElement<BaseField = Felt>>(
        &self,
        composition_poly_trace: CompositionPolyTrace<E>,
        num_constraint_composition_columns: usize,
        domain: &StarkDomain<Self::BaseField>,
        partition_options: PartitionOptions,
    ) -> (Self::ConstraintCommitment<E>, CompositionPoly<E>) {
        DefaultConstraintCommitment::new(composition_poly_trace, num_constraint_composition_columns, domain, partition_options)
    }

@gswirski gswirski marked this pull request as ready for review November 23, 2024 19:41
@gswirski gswirski force-pushed the gswirski/constraint branch from 2e16460 to 0c06168 Compare November 23, 2024 19:54
@irakliyk irakliyk self-requested a review November 23, 2024 20:23
Copy link
Collaborator

@irakliyk irakliyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thank you! I left a couple of small comments inline. Also, we should update the main README file (as it contains an example of how to instantiate a prover (i.e., WorkProver)) and the prover crate README file.

prover/src/lib.rs Outdated Show resolved Hide resolved
prover/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@irakliyk irakliyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good! Thank you!

@irakliyk irakliyk merged commit 08be71c into facebook:main Nov 24, 2024
8 checks passed
@gswirski gswirski deleted the gswirski/constraint branch November 24, 2024 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants