mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Hardware > Cloud Computing

Reply
 
Thread Tools
Old 2021-02-21, 03:53   #1
danc2
 
Dec 2019

418 Posts
Default New Google Colab Notebooks For Primality Testing

Overview:
Hello fellow Crunchers,
Cruncher Teal Dulcet (@tdulcet) and I (@danc2) have been working on a project to expedite the computation of prime numbers. This project offers users the ability to run GIMPS programs on Google Colab for primality testing. This offers a cost effective way to utilize GPUs and CPUs to contribute to GIMPS without forking any money out for expensive hardware. Users may also increase their contribution by upgrading to Google Colab Pro, which offers a higher usage limit for GPU and CPU utilization than that of the 12 hours in the free version. This project is facilitated by the following noteworthy additions to the GIMPS project:

1. GPU-And-CPU-Powered Colab Jupyter Notebooks
Google Colab offers two free Jupyter notebooks for each Google Account, which can be run for a maximum of 12 hours per day without interruption. The GPU72 project previously created a notebook that can utilize assigned Nvidia GPUs and run mfaktc. Our CPU-powered notebook runs Prime95 and our GPU-powered notebook runs CUDALucas; with the added bonus of also using the CPU on that machine to run Prime95. On average, the time to finish a Category 4 First time LL test takes about 30 days when running CUDALucas on Google Colab. The results from these tests are highly reliable as Google Cloud uses ECC memory in its backend (source). Users can run multiple instances of each notebook while utilizing the same CUDALucas and/or MPrime binaries, but separate supporting files (e.g., worktodo). We also dynamically fix buffer overflows in CUDALucas, allowing it to utilize the P100 and V100 GPUs Google has to offer. Users interact with a form and run notebooks without the prerequisite need to know how to code.

2. Colab Autorun and Connect Browser Add-on/Extension
Our Colab Autorun and Connect Firefox and Chrome/Chromium add-on/extension will automatically connect, reconnect and run the first cell of notebooks in Google Colab. It can be used to automatically run both our GPU and CPU notebooks when the user opens their browser or wakes their computer. It will soon be published to Addons.mozilla.org (AMO) and possibly the Chrome Web Store.

3. PrimeNet Python Script For Mlucas and CUDALucas
Our script may also be used outside of these notebooks for other GIMPS projects. Notably, the script now uses the v5 API for all worktypes. We have also addressed a number of bugs from previous versions of the PrimeNet script.

Differences from the GPU72 Project notebook
1. Compute work types that are eligible for cash research discovery award of up to $50,000.
2. Choices are not limited to the Trial Factorization work type. Choose from any LL worktype for the GPU and all LL and PRP work types (not recommended due to ~3.5 GiB for current first time tests; ~23% of Drive space) on the CPU. Change these worktypes later if desired.
3. Assignments are sent from/to the PrimeNet server, without needing a third party intermediary server.
4. One can save state for long running work types (e.g., LL, PRP, etc.) using Google Drive.
5. Automatically obtain and submit jobs with PrimeNet, with little configuration.
6. Can utilize both the GPU and CPU to run CUDALucas and Prime95 (the GPU notebook).
7. Open Source.
8. Builds CUDALucas directly from source code rather than precompiled binaries.
9. Colab GPUs are much faster at primality testing (LL/PRP) than trial factoring (TF)(source).
10. Easier setup than existing Notebook implementations.
11. Includes counts of all previously received CPUs and GPUs.

How to Get Started
Use the GPU notebook.
Use the CPU notebook.
Or visit the repository for more detailed instructions.

Teal and I are available for further contact, questions, and feedback. Happy crunching!

Last fiddled with by ewmayer on 2021-02-23 at 20:14 Reason: Fixed Jupyter-Notebooks-scripts link @OP request
danc2 is offline   Reply With Quote
Old 2021-02-21, 04:42   #2
VBCurtis
 
VBCurtis's Avatar
 
"Curtis"
Feb 2005
Riverside, CA

10010100000102 Posts
Default

I'm glad you did this project, and starting a new thread for it is the right thing to do.
Please, please don't post links to your new thread in every possibly relevant (or not-so-relevant) thread you can think of. I've removed all those other posts.

Trust that users of this forum are smart enough to notice your new thread. Most users use the "new posts" feature in the menu bar at the top of the forum. Your topic will get plenty of notice there, and all your other links are redundant and clutter up that exact new-post feature.
VBCurtis is offline   Reply With Quote
Old 2021-02-21, 05:53   #3
Uncwilly
6809 > 6502
 
Uncwilly's Avatar
 
"""""""""""""""""""
Aug 2003
101×103 Posts

23·1,187 Posts
Default

There is a notebook that Chris of GPU72 set up. I am guessing it does what you think yours does. His automatically uses the CPU and GPU (when available). The thing is, transferring big files associated with primality tests (and storing them) is not real practical. So he has his set to do P-1 on the CPU.
https://www.mersenneforum.org/showthread.php?t=24875
https://www.mersenneforum.org/showpo...5&postcount=19
Uncwilly is online now   Reply With Quote
Old 2021-02-21, 14:19   #4
tdulcet
 
tdulcet's Avatar
 
"Teal Dulcet"
Jun 2018

2×3×5 Posts
Default

Quote:
Originally Posted by Uncwilly View Post
There is a notebook that Chris of GPU72 set up. I am guessing it does what you think yours does.
See the "Differences from the GPU72 Project notebook" section of the first post, which addresses this. In short, his notebook is for trial factoring and our notebooks are for primality testing.

Note that users of the GPU72 notebook or any other notebooks can also use our browser add-on/extension.
tdulcet is offline   Reply With Quote
Old 2021-02-21, 15:12   #5
kriesel
 
kriesel's Avatar
 
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest

7×719 Posts
Default

Please do not encourage people to run LL first tests. We're trying to phase LL out entirely as routine first tests. Assignment rules may prevent issuance of LL first test work at some point in the future. PRP with GEC and proof generation is far superior for first tests:
  1. Error detection almost 100% by GEC on PRP, vs. only 50% probability of detection by Jacobi check (and CUDALucas does not have the Jacobi check)
  2. Essentially equal effort for first primality test computation
  3. Approx. 1% the effort of verification, so less than half the total effort for first-test and verification, more than twice the effective primality testing throughput (~1.01 tests equiv per PRP, proof generation, and Cert completion of an exponent, vs. ~2.04 tests per LL, DC, and occasional TC, QC, 5C, 6C)
  4. Superior quality / standard of verification (certs can't be faked, even by the person who did the PRP test, while LL DC result reports could be; a successful cert also shows the primality test was done completely and correctly)
  5. Far faster verification of a primality test (hours to weeks for PRP with proof generation via prompt brief Cert priority assignments, vs. several YEARS for LL DC, TC, etc.) Verification issues can be traced back to problem hardware or configuration usefully early in the hardware's useful life, instead of after it's removed from service.
  6. Setting up for PRP from the start avoids a transition from LL to PRP later.
Those determined to run LL despite PRP's superiority are welcome to help with the approximately 8 year backlog of LL DC. There will be less of an issue with assignment expiration before completion on Google Colab, because LL DC assignments are much quicker than first-time LL assignments; about 1/4 the duration as a result of the nearly 2:1 ratio of exponent values at their respective wavefronts.

Last fiddled with by kriesel on 2021-02-21 at 15:25
kriesel is online now   Reply With Quote
Old 2021-02-21, 16:49   #6
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

9,533 Posts
Default

Quote:
Originally Posted by tdulcet View Post
See the "Differences from the GPU72 Project notebook" section of the first post, which addresses this. In short, his notebook is for trial factoring and our notebooks are for primality testing.
Very nice work gentlemen.

Thanks for the reference in your docs. I had a hoot designing and implementing my particular "proof-of-concept".

And, yes. I made a conscious decision to only do Trial Factoring on the GPUs (although as you said, they are actually better at other work on some of the GPU offerings). I didn't want to get into the whole legal question of what is the situation if an MP was actually found.

Also... I decided very early on not to require the attachment of a Drive. At the time, it wasn't as easy as it is now, and so didn't "scale" well. And so the tiny TF checkpoint files mapped well (only later were the much larger P-1 contexts added).

Quote:
Originally Posted by tdulcet View Post
Note that users of the GPU72 notebook or any other notebooks can also use our browser add-on/extension.
I would advise against this.

The Colab Terms of Service are very clear that automation is *not* acceptable for Notebook startup / restarting. They want a human in the loop (I suspect part of this is actually a sociology experiment... 9-)

But, again... Nice work! I'm sure there are many out there who will use this.
chalsall is online now   Reply With Quote
Old 2021-02-21, 19:50   #7
danc2
 
Dec 2019

3×11 Posts
Default Response

Thank you for all the encouragement, congratulatory words, and constructive feedback. Below is a simple clarification on our intentions, thoughts, and motivations.

Quote:
Trust that users of this forum are smart enough to notice your new thread
We hope no offense was taken to forum users' intellect. Posting in other places was an attempt to update users who are still interested in GIMPS, have become less active on forums, but still hold email subscriptions to popular threads (i.e., are still interested in the topics discussed therein). Nevertheless, we will honor moderator opinions.

Quote:
Please do not encourage people to run LL first tests.
While we would love for this project to be optimal for PRP testing, the Google Drive size constraints make it difficult to do so, especially if Drive space is used for more than this project by the user. We are not encouraging users to do more LL testing as opposed to PRP testing on their other machines, but rather are trying to increase the net contribution with spare compute time offered by Google Cloud and not cause the project to fill up/bork the user's drive. I think that it is a very good point that this project could speed up DC checks. Note also that we started this project before GEC on PRP was a part of GIMPS.


Quote:
The Colab Terms of Service are very clear that automation is *not* acceptable
I could not find anything besides the pro terms of service, but did not see anything about automation (I am probably missing it). The warning is noted, however. Though I will say that personally I think that rule would be a bit silly as the whole point of the project is to increase progress in research and machines can be disconnected quite often, even though another machine is available to reconnect to and continue progress on. This may be a rule that is more focused on miners of cryptocurrency then anything else (or maybe it is a sociological experiment). There are also a number of existing extensions (though they do not work) that attempt to do the same thing which Google has not yet barred from running on their machines thus far, perhaps because of their ineffectiveness.

Quote:
Nice work! I'm sure there are many out there who will use this.:
Thanks! We really appreciate viewing and building off of your work!

Note: The link in #1 of overview is incorrect (my fault). The link should be GPU-And-CPU-Powered Colab Jupyter Notebooks.

Last fiddled with by danc2 on 2021-02-21 at 19:54
danc2 is offline   Reply With Quote
Old 2021-02-22, 00:48   #8
Chuck
 
Chuck's Avatar
 
May 2011
Orange Park, FL

2×443 Posts
Default

I used Chris' notebook setup successfully for several months (even signing up for the paid Colab Pro service), but Colab kept continually reducing the availability of service with no stated policy. It finally became so restricted that I just dumped the whole thing and cancelled the service.
Chuck is offline   Reply With Quote
Old 2021-02-22, 06:16   #9
danc2
 
Dec 2019

3·11 Posts
Default

Quote:
It finally became so restricted that I just dumped the whole thing and cancelled the service.
I have not noticed any severe availability issues as of this present date. In fact I am so happy with the service, I actually have paid for three Colab Pro accounts ($9.99 each). Keep in mind also that some availability issues are made null by the AutoRun and Connect extension. That is, notebooks reconnect after (tight) usage limits and reconnect if your particular backend has been assigned to a Google Cloud customer.
danc2 is offline   Reply With Quote
Old 2021-02-22, 06:24   #10
danc2
 
Dec 2019

2116 Posts
Default GPU Output

I realize we did not post any output or pictures, just links.

Since we have this dedicated thread, here is example output from a GPU notebook running the Tesla V100-SMX2-16GB (a $6,195.00 GPU according to Amazon).

Click image for larger version

Name:	colab_output.png
Views:	81
Size:	56.4 KB
ID:	24374

Last fiddled with by danc2 on 2021-02-22 at 06:25
danc2 is offline   Reply With Quote
Old 2021-02-22, 06:25   #11
Uncwilly
6809 > 6502
 
Uncwilly's Avatar
 
"""""""""""""""""""
Aug 2003
101×103 Posts

23×1,187 Posts
Default

Quote:
Originally Posted by danc2 View Post
I have not noticed any severe availability issues as of this present date.
There are messages that pop up about usage limits.
Uncwilly is online now   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Google Diet Colab Notebook Corbeau Cloud Computing 1142 2021-04-15 02:11
Primality testing of numbers k*b^n+c Viliam Furik Math 3 2020-08-18 01:51
Alternatives to Google Colab kriesel Cloud Computing 11 2020-01-14 18:45
Google Notebooks -- Free GPUs!!! -- Deployment discussions... chalsall Cloud Computing 3 2019-10-13 20:03
a new primality testing method jasong Math 1 2007-11-06 21:46

All times are UTC. The time now is 01:47.

Wed Apr 21 01:47:16 UTC 2021 up 12 days, 20:28, 0 users, load averages: 0.92, 1.32, 1.40

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.