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

Questions about the test #15

Open
SilverPoker opened this issue Jan 20, 2020 · 3 comments
Open

Questions about the test #15

SilverPoker opened this issue Jan 20, 2020 · 3 comments

Comments

@SilverPoker
Copy link

Hi Marius, I have some questions about your code in main.cpp under the test folder
The function test_multiexp() has _size variable for setting different sizes, it works well using your initial code. However, when I changed the _size from 1<<18 to 1<<10. (Since 1<<10 needs shorter time), then the result doesn't match. I didn't find the reason why it mismatches, could you help me check why? The only change I made is changing "1<<18" to "1<<10"
I found that, it's also wrong if _size is less than 1<<14 (like 1<<13, 1<<12, 1<<10, and etc)
The error is below.

TEST MULTI_EXP
Field size: 96, Field count: 1024
Device FFT took 365
Host FFT took 4
Missmatch:
3832513521, 4114774966, 396713337, 473830846, 2659081024, 1847764696, 4867011, 2310256010, 2653309445, 1284315027, 4070234458, 3507217355, 518278877, 1714081604, 1468053814, 3791946234, 981627699, 3593337843, 358896652, 3408152632, 1224301292, 1561265861, 1175238034, 39629,
1218468944, 581656546, 1276554598, 4217098761, 339338039, 2296720683, 3362761856, 4177621453, 3482569788, 3598741332, 1672683522, 2895558447, 3948325594, 104581546, 909519637, 2054422881, 1545362927, 2025652791, 4237826918, 2431456373, 4175224577, 72776181, 119637567, 90433,
fft_test: /home/silverpoker/github/gpusnarks/test/../cuda/device_field.h:212: static void fields::Scalar::testEquality(fields::Scalar, fields::Scalar): Assertion `!"missmatch"' failed.
Aborted (core dumped)
@MariusVanDerWijden
Copy link
Owner

Hey,
you also need to change the size here: https://github.com/MariusVanDerWijden/gpusnarks/blob/master/cuda/multi_exp.cu#L30
Unfortunately the size has to be set at compile time.

@SilverPoker
Copy link
Author

I see, thanks for your reply! I will read that part carefully. But it seems that 1<<14 or bigger than this doesn't need to change the size there? (Also, btw, does it support other sizes which are not powers of 2?)

@MariusVanDerWijden
Copy link
Owner

Currently it doesn't support sizes not powers of 2. In theory you can just leave the empty elements as zero. However since the input data is in monty form not real form, the "zero element" becomes the neutral element regarding multiplication in the finite field I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants