data61 / cuda-fixnum

Extended-precision modular arithmetic library that targets CUDA.
Other
41 stars 28 forks source link

Speed up test case generation using multiprocessing #33

Open unzvfu opened 6 years ago

unzvfu commented 6 years ago

Currently takes 3 hours (1 CPU) to generate all the 256 byte modexp test cases.

unzvfu commented 6 years ago

Example output:

$ python3 gentests.py
Generating input arguments... done (0.00s). Created 13 arguments.
xs = [0, 1, 2, 3, 4294967295, 4294967294, 4294967293, 252645135, 4042322160, 16711935, 4278255360, 65535, 4294901760]
Writing 169 tests into "add_cy_4"... done (0.00s).
Writing 169 tests into "sub_br_4"... done (0.00s).
Writing 169 tests into "mul_wide_4"... done (0.00s).
Writing 2197 tests into "modexp_4"... done (0.01s).
Generating input arguments... done (0.00s). Created 21 arguments.
Writing 441 tests into "add_cy_8"... done (0.00s).
Writing 441 tests into "sub_br_8"... done (0.00s).
Writing 441 tests into "mul_wide_8"... done (0.00s).
Writing 9261 tests into "modexp_8"... done (0.03s).
Generating input arguments... done (0.00s). Created 35 arguments.
Writing 1225 tests into "add_cy_16"... done (0.00s).
Writing 1225 tests into "sub_br_16"... done (0.00s).
Writing 1225 tests into "mul_wide_16"... done (0.00s).
Writing 42875 tests into "modexp_16"... done (0.18s).
Generating input arguments... done (0.00s). Created 61 arguments.
Writing 3721 tests into "add_cy_32"... done (0.01s).
Writing 3721 tests into "sub_br_32"... done (0.01s).
Writing 3721 tests into "mul_wide_32"... done (0.01s).
Writing 226981 tests into "modexp_32"... done (1.40s).
Generating input arguments... done (0.00s). Created 111 arguments.
Writing 12321 tests into "add_cy_64"... done (0.02s).
Writing 12321 tests into "sub_br_64"... done (0.02s).
Writing 12321 tests into "mul_wide_64"... done (0.03s).
Writing 1367631 tests into "modexp_64"... done (19.04s).
Generating input arguments... done (0.00s). Created 209 arguments.
Writing 43681 tests into "add_cy_128"... done (0.09s).
Writing 43681 tests into "sub_br_128"... done (0.09s).
Writing 43681 tests into "mul_wide_128"... done (0.12s).
Writing 9129329 tests into "modexp_128"... done (397.75s).
Generating input arguments... done (0.00s). Created 403 arguments.
Writing 162409 tests into "add_cy_256"... done (1.12s).
Writing 162409 tests into "sub_br_256"... done (0.67s).
Writing 162409 tests into "mul_wide_256"... done (0.90s).
Writing 65450827 tests into "modexp_256"... done (10404.95s).
unzvfu commented 4 years ago

Follow up at https://github.com/unzvfu/cuda-fixnum/issues/16.