mersenneforum.org  

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

Reply
 
Thread Tools
Old 2021-07-13, 02:55   #1
JuanTutors
 
JuanTutors's Avatar
 
Mar 2004

10428 Posts
Default Running through an endless loop in Google Colab

Still working out the kinks on how to use Google Colab. Please, no jabs! I am pasting my code, and also the endless loop it seems to be running into:

Code:
#@title The GPU72 Trial Factoring Colaboratory Notebook. { output-height: 8, form-width: "90%", display-mode: "form" }
#@markdown -- Please see https://www.gpu72.com/ for more details.
#@markdown <br><br>
#@markdown  -- Enter your Access Key below.  Leave blank to work anonymously.
#@markdown <br><br>
#@markdown  -- Leave "Logging_Level" as Default unless you are a developer.
Access_Key = "acccesskeyacccesskeyacccesskey" #@param {type:"string"}
Logging_Level = "Default" #@param ["Default", "Verbose"]

import subprocess
import signal

!echo "Beginning GPU Trial Factoring Environment Bootstrapping..."
!echo "Please see https://www.gpu72.com/ for additional details."
!echo

!mkdir -p /home/gpu72/
%cd -q /home/gpu72/

!wget -qO bootstrap.tgz https://www.gpu72.com/colab/bootstrap.tgz
!tar -xzf bootstrap.tgz >/dev/null

p = subprocess.Popen(['./bootstrap.pl', Access_Key, Logging_Level],
  stdout=subprocess.PIPE,
  universal_newlines=True,
  bufsize=0)

try:
  for line in p.stdout:
    line=line[:-1]
    print(line)
except KeyboardInterrupt:
  print("\nExiting...")
  p.send_signal(signal.SIGINT)
  !./comms.pl ShutDown 5
  print("Done.")
  
Insert_Work = "Factor=N/A,332370583,78,79" #@param {type:"string"}
Delete_Results = True #@param {type:"boolean"}

import os.path
from google.colab import drive

if not os.path.exists('/content/drive/My Drive'):
  drive.mount('/content/drive')

%cd '/content/drive/My Drive/colab/'
!ls -lha
!echo

if Insert_Work:
  print("Add string is:" + Insert_Work + "\n")
  f=open("worktodo.add","w+")
  f.write(Insert_Work + "\n")
  f.close()
  !cat worktodo.add
  !echo

!cat "results.txt"
!echo

if Delete_Results:
  print("Deleting results!\n")
  !rm results.txt

!cat worktodo.txt
!wc -l worktodo.txt
And here is the loop it's running into:

Code:
20210713_025217 ( 0:07): running a simple selftest...
20210713_025222 ( 0:07): Selftest statistics
20210713_025222 ( 0:07):   number of tests           107
20210713_025222 ( 0:07):   successfull tests         107
20210713_025222 ( 0:07): selftest PASSED!
20210713_025222 ( 0:07): Fetching initial work...
20210713_025223 ( 0:07): Running GPU type Tesla T4
Repeats the same thing over and over. I don't see any errors yet, although I'm shooting in the dark at this point. Any pointers to get it started?

Last fiddled with by Uncwilly on 2021-07-13 at 06:29 Reason: Removed access key.
JuanTutors is online now   Reply With Quote
Old 2021-07-13, 06:30   #2
Uncwilly
6809 > 6502
 
Uncwilly's Avatar
 
"""""""""""""""""""
Aug 2003
101×103 Posts

100111000111102 Posts
Default

Does it look like it has fetched work? It might be a problem on Chris's end.
Uncwilly is offline   Reply With Quote
Old 2021-07-13, 10:23   #3
JuanTutors
 
JuanTutors's Avatar
 
Mar 2004

54610 Posts
Default

Quote:
Originally Posted by Uncwilly View Post
Does it look like it has fetched work? It might be a problem on Chris's end.
I used the code given in one of the posts as is to assign it TF work on a specific exponent. That may be the issue. I know that a few posts mentioned having trouble with the Tesla T4 architecture, like perhaps the code just doesn't work with that GPU?

Code:
Insert_Work = "Factor=N/A,332370583,78,79" #@param {type:"string"}
JuanTutors is online now   Reply With Quote
Old 2021-07-13, 12:38   #4
Uncwilly
6809 > 6502
 
Uncwilly's Avatar
 
"""""""""""""""""""
Aug 2003
101×103 Posts

100111000111102 Posts
Default

The T4 was working last I saw one.
Uncwilly is offline   Reply With Quote
Old 2021-07-13, 14:00   #5
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

7×1,423 Posts
Default

Quote:
Originally Posted by Uncwilly View Post
It might be a problem on Chris's end.
Yup. Sorry. My bad. Fixed.
chalsall is online now   Reply With Quote
Old 2021-07-13, 23:52   #6
JuanTutors
 
JuanTutors's Avatar
 
Mar 2004

2×3×7×13 Posts
Default

Quote:
Originally Posted by chalsall View Post
Yup. Sorry. My bad. Fixed.
Thanks! Seems to be running but I can't seem to get it to work on assignments of my choosing. I have tried the following code on line 38 posted above, meaning I tried all of that code with line 38 containing one of these two lines.
Code:
Insert_Work = "Factor=N/A,332370583,78,79" #@param {type:"string"}
Code:
Insert_Work = "Factor=[ASSIGNMENT ID FROM MERSENNE.ORG],332370583,78,79" #@param {type:"string"}
I just got assigned a few hundred assignments to TF instead of factoring the assignment I chose. I tried on a third google account and now I seem to be doing a TF and a P-1 on some smaller exponents, one of them being 120698189. I read through the instructions and I seem to have copied/pasted it correctly.
JuanTutors is online now   Reply With Quote
Old 2021-07-14, 17:11   #7
Flaukrotist
 
Sep 2020
Germany

3810 Posts
Default

I think there are some problems with your code. You are basically using the scripts of GPU72 to run an instance of mprime together with an instance of mfaktc. Chris has written this code in a way to avoid using a google drive. And it is designed to fetch work from GPU72.com in a loop until the session dies. The actual execution you can't see in the code you pasted because it is hidden in some perl code (bootstrap.pl) which is loaded after the start from gpu72.com.

So when I get it right, you will never reach the code block where you define your worktodo.add contents. And even if you ever reach it, it won't have any effect because the mfaktc execution doesn't use google drive and will never detect your worktodo.add. The program of GPU72 is just not defined for a scenario where you set a work item explicitely. Instead you do what GPU72 serves you based on the work type you selected when you created the colab notebook reference on GPU72. So, either you do that, then you should use exactly the code from gpu72.com without any changes. Or if you are interested enough in defining your own work items you have to write your own script based on python experience and the very helpful colab section in Kriesel's help pages to run mprime and/or mfaktc using google drive.

Last fiddled with by Flaukrotist on 2021-07-14 at 17:16 Reason: added that perl code is not using google drive
Flaukrotist is offline   Reply With Quote
Old 2021-07-14, 18:38   #8
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

26E916 Posts
Default

Quote:
Originally Posted by Flaukrotist View Post
So, either you do that, then you should use exactly the code from gpu72.com without any changes. Or if you are interested enough in defining your own work items you have to write your own script based on python experience and the very helpful colab section in Kriesel's help pages to run mprime and/or mfaktc using google drive.
Ah... Thank you for that. I didn't have the bandwidth to parse the code delta.

I /did/ have a bug on the server-side (a stupid constrained select for a particular work type) which was corrected.

But, yeah. As with all things "tech", you touch it, you own it!
chalsall is online now   Reply With Quote
Old 2021-07-14, 19:27   #9
kriesel
 
kriesel's Avatar
 
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest

3×1,933 Posts
Default

Quote:
Originally Posted by Flaukrotist View Post
I think there are some problems with your code. ... you will never reach the code block where you define your worktodo.add contents. And even if you ever reach it, it won't have any effect because the mfaktc execution doesn't use google drive and will never detect your worktodo.add. ... So, either you do that, then you should use exactly the code from gpu72.com without any changes. Or if you are interested enough in defining your own work items you have to write your own script based on python experience and the very helpful colab section in Kriesel's help pages to run mprime and/or mfaktc using google drive.
Thanks for the sleuthing and the positive colab thread mention (which covers attempts of almost all GIMPS software title on Colab free, by various originators of scripts). I haven't seen anything that indicates T4 won't run any appropriately selected and configured app. T4 is just slow in DP, and may be limited on max exponent like any other GPU is.

Sounds like Juan created a chimera. Shouldn't shock anyone much that half a horse plus half a tortoise doesn't run well.
A good outcome is it led to detection and resolution of a GPU72 bug.

Last fiddled with by kriesel on 2021-07-14 at 19:39
kriesel is online now   Reply With Quote
Old 2021-07-14, 22:40   #10
mathwiz
 
Mar 2019

23·52 Posts
Default

Quote:
Originally Posted by kriesel View Post
Sounds like Juan created a chimera. Shouldn't shock anyone much that half a horse plus half a tortoise doesn't run well.
Would that not he... a centaurtoise?
mathwiz is online now   Reply With Quote
Old 2021-07-18, 08:11   #11
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
"name field"
Jun 2011
Thailand

9,787 Posts
Default

Quote:
Originally Posted by mathwiz View Post
Would that not he... a centaurtoise?
Nope. That's a turthorse.
LaurV is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Google Diet Colab Notebook Corbeau Cloud Computing 1180 2021-10-21 09:42
New Google Colab Notebooks For Primality Testing danc2 Cloud Computing 85 2021-07-08 22:06
Alternatives to Google Colab kriesel Cloud Computing 11 2020-01-14 18:45
x86 ASM loop control: JUMP vs LOOP ewmayer Programming 23 2012-04-29 21:13
Unreserve exponent endless loop luckyduck288 Software 3 2008-01-22 13:45

All times are UTC. The time now is 16:36.


Sun Oct 24 16:36:42 UTC 2021 up 93 days, 11:05, 0 users, load averages: 1.27, 1.39, 1.38

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.