Skip to content

Conversation

soonum
Copy link
Contributor

@soonum soonum commented Jul 10, 2025

Some application like blockchain, may wants to prove less bits than CRS size allows to.


This change is Reviewable

@soonum soonum self-assigned this Jul 10, 2025
@cla-bot cla-bot bot added the cla-signed label Jul 10, 2025
Copy link
Contributor

@nsarlin-zama nsarlin-zama left a comment

Choose a reason for hiding this comment

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

Just so I understand, the goal is to be able to benchmark with proofs that do not completely fill the max size supported by the crs ?

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @IceTDrinker)


tfhe/web_wasm_parallel_tests/worker.js line 703 at r1 (raw file):

      [64, [64]],
      [640, [640]],
      [2048, [2048, 64 * 3]],

I guess this comes from a real life usecase ?

@soonum soonum requested a review from IceTDrinker August 7, 2025 10:53
@IceTDrinker
Copy link
Member

@soonum currently seeing a conflict on that PR, if you can rebase ?

@soonum soonum force-pushed the dt/bench/custom_bits_to_prove branch 2 times, most recently from 2a924a7 to 4b83694 Compare August 28, 2025 10:46
@soonum soonum requested a review from nsarlin-zama August 28, 2025 13:01
@soonum soonum force-pushed the dt/bench/custom_bits_to_prove branch from 4b83694 to fdcf026 Compare August 28, 2025 13:30
Copy link
Member

@IceTDrinker IceTDrinker left a comment

Choose a reason for hiding this comment

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

@nsarlin-zama yes

Reviewable status: 0 of 2 files reviewed, 3 unresolved discussions (waiting on @nsarlin-zama and @soonum)

Copy link
Contributor Author

@soonum soonum left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 3 unresolved discussions (waiting on @agnesLeroy, @IceTDrinker, and @nsarlin-zama)


tfhe/web_wasm_parallel_tests/worker.js line 703 at r1 (raw file):

Previously, nsarlin-zama (Nicolas Sarlin) wrote…

I guess this comes from a real life usecase ?

Yes, from blockchain use case.

@soonum soonum requested a review from IceTDrinker September 1, 2025 12:23
Copy link
Member

@IceTDrinker IceTDrinker left a comment

Choose a reason for hiding this comment

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

A few questions

@IceTDrinker reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @agnesLeroy, @IceTDrinker, and @nsarlin-zama)


tfhe-benchmark/benches/integer/zk_pke.rs line 52 at r2 (raw file):

    let usable_cpu_threads = (rayon::current_num_threads() as u64 / max_threads).max(1) + 1;

    #[cfg(feature = "gpu")]

prefer if cfg!(feature = "gpu")


tfhe/web_wasm_parallel_tests/worker.js line 700 at r2 (raw file):

      {"crs_bit_size": 640, "bits_to_encrypt": [640]},
      {"crs_bit_size": 2048, "bits_to_encrypt": [2048, 64 * 4]}  // 64 * 4 is a production use-case
      //{"crs_bit_size": 4096, "bits_to_encrypt": [4096]}, // This case is too big and make webdriver timeout

that's odd, might be a crash ? does it work with integer ? Or the CRS gen is timing out in the browser, did you try with the integer bench ?

how is the timeout managed currently ? It's an old system, so could it be that the test

@soonum soonum force-pushed the dt/bench/custom_bits_to_prove branch 2 times, most recently from 1de5613 to e5a9e5a Compare September 3, 2025 16:11
Copy link
Contributor Author

@soonum soonum left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @agnesLeroy, @IceTDrinker, and @nsarlin-zama)


tfhe/web_wasm_parallel_tests/worker.js line 700 at r2 (raw file):

Previously, IceTDrinker (Arthur Meyre) wrote…

that's odd, might be a crash ? does it work with integer ? Or the CRS gen is timing out in the browser, did you try with the integer bench ?

how is the timeout managed currently ? It's an old system, so could it be that the test

The timeout for this test currently is 3600 seconds.
I guess the CRS generation time plus the benchmarks exceed that duration.
I have to measure the 4096 case only to see how long it takes.

Copy link
Contributor

@nsarlin-zama nsarlin-zama left a comment

Choose a reason for hiding this comment

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

small comment

Reviewable status: 0 of 2 files reviewed, 5 unresolved discussions (waiting on @agnesLeroy and @IceTDrinker)


tfhe-benchmark/benches/integer/zk_pke.rs line 110 at r4 (raw file):

                // Packing, so we take the message and carry modulus to compute our block count
                let num_block = 64usize.div_ceil(
                    (param_pke.message_modulus.0 * param_pke.carry_modulus.0).ilog2() as usize,

You could reuse msg_bits computed above here


tfhe-benchmark/benches/integer/zk_pke.rs line 245 at r4 (raw file):

                // Packing, so we take the message and carry modulus to compute our block count
                let num_block = 64usize.div_ceil(
                    (param_pke.message_modulus.0 * param_pke.carry_modulus.0).ilog2() as usize,

same could use msg_bits


tfhe-benchmark/benches/integer/zk_pke.rs line 505 at r4 (raw file):

                    // Packing, so we take the message and carry modulus to compute our block count
                    let num_block = 64usize.div_ceil(
                        (param_pke.message_modulus.0 * param_pke.carry_modulus.0).ilog2() as usize,

same

@soonum soonum force-pushed the dt/bench/custom_bits_to_prove branch from 4bce34c to a2db574 Compare September 4, 2025 10:37
@IceTDrinker
Copy link
Member

build is red currently

@soonum soonum force-pushed the dt/bench/custom_bits_to_prove branch from a2db574 to eb856dd Compare September 4, 2025 13:35
@soonum soonum requested a review from IceTDrinker September 4, 2025 14:48
Copy link
Member

@IceTDrinker IceTDrinker left a comment

Choose a reason for hiding this comment

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

@IceTDrinker reviewed 2 of 2 files at r5, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @agnesLeroy, @IceTDrinker, and @soonum)


tfhe/web_wasm_parallel_tests/worker.js line 700 at r2 (raw file):

Previously, soonum (David Testé) wrote…

The timeout for this test currently is 3600 seconds.
I guess the CRS generation time plus the benchmarks exceed that duration.
I have to measure the 4096 case only to see how long it takes.

you reverted the comment, so this cases passes now in 1h ?

Some application like blockchain, may wants to prove less bits
than CRS size allows to.
@soonum soonum force-pushed the dt/bench/custom_bits_to_prove branch from eb856dd to 860f38f Compare September 4, 2025 15:16
@zama-bot zama-bot removed the approved label Sep 4, 2025
@soonum soonum requested a review from IceTDrinker September 4, 2025 15:32
Copy link
Member

@IceTDrinker IceTDrinker left a comment

Choose a reason for hiding this comment

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

Thanks !

Copy link
Member

@IceTDrinker IceTDrinker left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 2 files reviewed, 5 unresolved discussions (waiting on @agnesLeroy and @soonum)

@soonum soonum merged commit 4a06583 into main Sep 5, 2025
113 of 114 checks passed
@soonum soonum deleted the dt/bench/custom_bits_to_prove branch September 5, 2025 07:03
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.

5 participants