Live data from Hacker News

Tell HN: GpuOwl/PRPLL, GPU software used to find the largest prime number

news.ycombinator.com

21–30 of 44 posts

Re: Tell HN: GpuOwl/PRPLL, GPU software used to find the largest prime number

#21
post #2

Some topic ideas: - Why use OpenCL when implementing GPU software - Does it run on AMD or on Nvidia GPUs? - How does the primality test implemented in GpuOwl work? - How fast is it to test a Mersenne candidate? - Why use FFTs? how large are the FFTs? - What do you use for sin/cos?

It definitely runs on our AMD MI300x. But, the documentation is pretty fragmented and requires a bunch of math knowledge that I don't have, so I'm not really sure how to run it. Just some proof of working... https://x.com/HotAisle/status/1848780396609106359 If someone can come up with a way to perf test this against an H100, hit me up! It seems like something that could make a fun competition given the use of OpenCL.…

Point taken. I need to improve the documentation and make it easier to start with.

There is a lot of documentation and HowTos on the Mersenne Forums [1] where experienced users help newcomers, and that relieves effort from myself.

[1] http://mersenneforum.org/

Re: Tell HN: GpuOwl/PRPLL, GPU software used to find the largest prime number

#22
post #3

Wow, congrats! Indeed, I’m curious why you’ve used OpenCL. And what was the hardware/general setup used for finding the prime? What was your motivation behind building this software?

The HW setup for finding the prime was Nvidia and AMD GPUs with good FP64 in the cloud, using "spot" instances for better price. This allowed scaling up quickly to many GPUs, and it did have a significant cost.

My personal setup is 8x Radeon Pro VII which also provide heating during the cold season. During summer the effort is in removing the excess heat, and the GPUs run in a reduced-power mode (slower & more efficient).

Re: Tell HN: GpuOwl/PRPLL, GPU software used to find the largest prime number

#23

First of all, thank you for your work and congratulations on your achievements, both in the search for Mersenne primes and software development. I am contributing to GIMPS with 2 Radeon Pro VII cards. I'm wondering what will happen when ROCm stops supporting these GPUs. Do you have any plans to keep them working with GPUOwl/Prpll when they are no longer supported by ROCm?

IF ROCm stops supporting Radeon Pro VII, the first solution is to stay on the most recent ROCm that still supports them.

Second, "does not support anymore" does not necessarily mean that it stops working on the old HW, but it could mean that new features/extension aren't implemented for the old HW anymore, and we may not care about those.

Third, AMD does contribute and integrates changes with upstream LLVM. This open-source work could be used by third parties (with significant effort I assume) to continue support.

Re: Tell HN: GpuOwl/PRPLL, GPU software used to find the largest prime number

#24
post #17

I'd also like to draw attention that a lot of this work was sponsored by IMC the market maker, Mihai's employer.

What! This is absolutely not true. My open source work was not sponsored by anyone. And IMC is not my employer. But really, how did you get this idea?

"primecurious", who you are and what is the purpose of such statements? how would you know who is or isn't sponsoring my work?

But just to set it straight, GpuOwl received exactly $0 contributions or sponsoring from exactly nobody. It's a pleasure work from my side, and it's open sourced for the easy access of curious minds to the algorithms and techniques implemented. I did receive great help, in the form of source-code contributions, most importantly from George Woltman.

Re: Tell HN: GpuOwl/PRPLL, GPU software used to find the largest prime number

#25
post #18

Why do you use OpenCL instead of CUDA?

Indeed CUDA is nice due to the way it uses C++, integrates host and GPU code in a single file, and in the convenience of compilation. Basically I think CUDA is a bit easier to start with than OpenCL. OTOH CUDA only works on Nvidia, and that's a major limitation. GpuOwl uses heavily FP64 ("double" floating point), and FP64 is more readily available at consumer prices on AMD GPUs. We (the GIMPS project) use a lot of Ra…

Thank you. It makes sense to use OpenCL if you have AMD GPUs in mind.

I thought though that prospective HPC users have more Nvidia A100 and H100 in mind when buying hardware.

Re: Tell HN: GpuOwl/PRPLL, GPU software used to find the largest prime number

#26

The binary of this number is over 16MB of 1s. that's nuts.

What's nuts is how fast you can square such a number on a GPU!

A number of 136M bits (136 Mega bits), using a 7'500'000-points FFT, can be squared and mod-reduced (modular reduction) in less than 1ms (one milli-second) on consumer-priced (less than $500) GPUs.

Re: Tell HN: GpuOwl/PRPLL, GPU software used to find the largest prime number

#27
post #18

Why do you use OpenCL instead of CUDA?

Indeed CUDA is nice due to the way it uses C++, integrates host and GPU code in a single file, and in the convenience of compilation. Basically I think CUDA is a bit easier to start with than OpenCL. OTOH CUDA only works on Nvidia, and that's a major limitation. GpuOwl uses heavily FP64 ("double" floating point), and FP64 is more readily available at consumer prices on AMD GPUs. We (the GIMPS project) use a lot of Ra…

Are there any potential benefits of using CUDA instead of OpenCL on Nvidia GPUs? Like, better driver support, ability to utilize Nvidia-specific features?

Nvidia A100 GPU which was used to find a new Mersenne prime has specialized dedicated hardware like tensor cores, which on A100 can work not only for FP16 and FP32 but also for FP64. Are there any benefits of utilizing this capabilities?

Re: Tell HN: GpuOwl/PRPLL, GPU software used to find the largest prime number

#28
Hi! Please, I also have a few questions:

1. I guess the most time consuming part is multiplication, right? What kind of FFT do you use? Schönhage-Strassen, multi-prime NTT, ..? Is it implemented via floating-point numbers or integers?

2. Not sure if you encountered this, but do you have any advice for small mulmod (multiplication reduced by prime modulus)? By small I mean machine-word size (i.e. preferably 64-bits).

3. For larger modulus, what do you use? Is it worth precomputing the inverse by, say, Newton iteration or is it faster to use asymptotically slower algorithms? Do you use Montgomery representation?

4. Does the code use any kind of GCD? What algorithm did you choose?

5. Now this is a bit broad question, but could you perhaps compare the traditional algorithms implemented sequentially (e.g. GMP) and algorithm suitable to run on GPUs? I mean, does it make sense to use, say, a quadratic algorithm amenable to parallel execution, rather than a asymptotically faster (and sequential) algorithm?

Re: Tell HN: GpuOwl/PRPLL, GPU software used to find the largest prime number

#29
post #18

Earlier quoted context omitted.

Indeed CUDA is nice due to the way it uses C++, integrates host and GPU code in a single file, and in the convenience of compilation. Basically I think CUDA is a bit easier to start with than OpenCL. OTOH CUDA only works on Nvidia, and that's a major limitation. GpuOwl uses heavily FP64 ("double" floating point), and FP64 is more readily available at consumer prices on AMD GPUs. We (the GIMPS project) use a lot of Ra…

Thank you. It makes sense to use OpenCL if you have AMD GPUs in mind. I thought though that prospective HPC users have more Nvidia A100 and H100 in mind when buying hardware.

GIMPS is not typically targeting HPC, it is typically targeting hobbyists who have spare cycles to burn.

Re: Tell HN: GpuOwl/PRPLL, GPU software used to find the largest prime number

#30

Hi, I've got few questions: 1). What profiling tools do you use for GPU code? 2). Where one would start, in terms of learning resources, about coding using inline GPU assembler? 3). Do you verify GPU assembler generated by a compiler from C/C++ code, in terms of effectiveness? If so, which tools do you use for that? 4). Is SIMD on GPUs a thing? 5). What are the primary factors being taken into account by you (cache s…

And another more general question: (6) gcc, clang, and nvcc have some OpenMP offloading capabilities which allow to compile code into binaries which can then run on GPUs. Is the code they produce through OpenMP anywhere close to what one gets directly with i.e. opencl?

Using OpenMP with the GPU may be fine depending on the problem, but you cant explore the full GPU potential. Parallelizing the loops on the GPU may be sufficient, but when it is not you have to dig deeper.
Post reply on HN