mratsim / constantine

Constantine: modular, high-performance, zero-dependency cryptography stack for verifiable computation, proof systems and blockchain protocols.
Other
413 stars 44 forks source link

Nvidia GPU: field substraction and multiplication #348

Closed mratsim closed 10 months ago

mratsim commented 10 months ago

This PR adds:

This ups the minimum requirement to Cuda 11.5.1 to ensure 32-bit fused-multiply-add "hi" works properly: https://forums.developer.nvidia.com/t/wrong-result-returned-by-madc-hi-u64-ptx-instruction-for-specific-operands/196094

Also, using 64-bit arithmetic on GPU will give wrong results due to: https://forums.developer.nvidia.com/t/incorrect-result-of-ptx-code/221067