mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > Lone Mersenne Hunters

Reply
 
Thread Tools
Old 2015-04-30, 14:55   #89
R.D. Silverman
 
R.D. Silverman's Avatar
 
"Bob Silverman"
Nov 2003
North of Boston

11101100011012 Posts
Default

Quote:
Originally Posted by lorgix View Post
He is using the -v flag of GMP-ECM, and trusting the values it returns.
This is a non-answer to the question I asked.
R.D. Silverman is offline   Reply With Quote
Old 2015-04-30, 14:59   #90
R.D. Silverman
 
R.D. Silverman's Avatar
 
"Bob Silverman"
Nov 2003
North of Boston

756510 Posts
Default

Quote:
Originally Posted by fivemack View Post
Yes you do, that's the 't40 503 curves' part; gmp-ecm has implementations of all the Dickman-function work necessary for computing that probability, and reports its reciprocal there.
A choice of B1, B2 is optimal only for a particular factor SIZE. Dickman's function only returns
probabilities of smoothness for given B1,B2 with respect to a composite integer of a given size.
There is no such specification of size in the discussion. All that is presented is run-time info
for various B1, B2 choices.

There are still no probabilities given in the discussion, nor do I see any computations
involving probability/time.
R.D. Silverman is offline   Reply With Quote
Old 2015-04-30, 15:21   #91
R.D. Silverman
 
R.D. Silverman's Avatar
 
"Bob Silverman"
Nov 2003
North of Boston

5×17×89 Posts
Default

Quote:
Originally Posted by fivemack View Post
Yes you do, that's the 't40 503 curves' part; gmp-ecm has implementations of all the Dickman-function work necessary for computing that probability, and reports its reciprocal there.
We see, for example, a choice of B1, B2 for t40 and a time of 12.2 hrs.
We also see a choice for t40 where B2 is raised from 35e9 to 240e9 and a time of 13 hrs.

We do not see how the probability of success CHANGED when B2 went from 35e9 to 240e9.
Did it change more than or less than the relative time increase? (i.e. 13/12.2)

If the probability went up by more than a factor of 13/12.2, then it is clear that the choice
of 240e9 (i.e. equal time in step 1 and step 2) does give an improvement.

But nowhere in the discussion are the relative probabilities discussed!
R.D. Silverman is offline   Reply With Quote
Old 2015-04-30, 15:38   #92
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

3·5·251 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
We see, for example, a choice of B1, B2 for t40 and a time of 12.2 hrs.
We also see a choice for t40 where B2 is raised from 35e9 to 240e9 and a time of 13 hrs.

We do not see how the probability of success CHANGED when B2 went from 35e9 to 240e9.
Did it change more than or less than the relative time increase? (i.e. 13/12.2)

If the probability went up by more than a factor of 13/12.2, then it is clear that the choice
of 240e9 (i.e. equal time in step 1 and step 2) does give an improvement.

But nowhere in the discussion are the relative probabilities discussed!
The probablility stays the same - that is the definition of "t40". t40 means there is a 1/e chance of missing a factor of size 40 digits with the provided parameters. GMP-ECM computes all of the probabilities and is also aware of how long it takes itself to compute a curve. Running -v reports these details. When B2=35e9 it will take 12.2 hours to have a 1/e chance of missing a factor of size 40 digits. With B2=240e9 it takes 13 hours to have the same chance of missing a factor of size 40 digits. So the relative probabilities are being discussed.
bsquared is offline   Reply With Quote
Old 2015-04-30, 16:43   #93
R.D. Silverman
 
R.D. Silverman's Avatar
 
"Bob Silverman"
Nov 2003
North of Boston

756510 Posts
Default

Quote:
Originally Posted by bsquared View Post
The probablility stays the same - that is the definition of "t40".
Ah. That's the part that I was missing.
R.D. Silverman is offline   Reply With Quote
Old 2015-04-30, 18:19   #94
VBCurtis
 
VBCurtis's Avatar
 
"Curtis"
Feb 2005
Riverside, CA

2×2,927 Posts
Default

Quote:
Originally Posted by lorgix View Post
He is using the -v flag of GMP-ECM, and trusting the values it returns.
This is not-quite-true; I average the times for a bunch of stage 1 runs, a couple of stage 2 runs for each choice of B2, and then multiply by the number of curves expected to be required to find a factor. This is a bit more accurate to get expected-time-to-find, but it's useful accuracy when trying to find 5% or small improvements. I do trust -v to provide expected curve counts, as listed in my sample data.

Doing such work on a spreadsheet also allows for quick calculation of expected time for a variety of B1/B2 values; invoking ECM with -v provides the expected curve counts immediately, so I can call ECM with a combination not already tried, note the curve counts required, and use the timings from previous stage 1 & stage 2 runs to find expected time to find a factor. Also, Stage 1 time is almost precisely linear in B1, so one can extrapolate for a variety of B1 values.

Now that Mr Silverman understands the definition of t40 and t45, how does the choice of B2=240e9 improve the probability of success PER UNIT TIME to find any size factor over B2=35e9, or 96e9?
VBCurtis is offline   Reply With Quote
Old 2015-04-30, 18:46   #95
R.D. Silverman
 
R.D. Silverman's Avatar
 
"Bob Silverman"
Nov 2003
North of Boston

166158 Posts
Default

Quote:
Originally Posted by VBCurtis View Post
This is not-quite-true; I average the times for a bunch of stage 1 runs, a couple of stage 2 runs for each choice of B2, and then multiply by the number of curves expected to be required to find a factor. This is a bit more accurate to get expected-time-to-find, but it's useful accuracy when trying to find 5% or small improvements. I do trust -v to provide expected curve counts, as listed in my sample data.

Doing such work on a spreadsheet also allows for quick calculation of expected time for a variety of B1/B2 values; invoking ECM with -v provides the expected curve counts immediately, so I can call ECM with a combination not already tried, note the curve counts required, and use the timings from previous stage 1 & stage 2 runs to find expected time to find a factor. Also, Stage 1 time is almost precisely linear in B1, so one can extrapolate for a variety of B1 values.

Now that Mr Silverman understands the definition of t40 and t45, how does the choice of B2=240e9 improve the probability of success PER UNIT TIME to find any size factor over B2=35e9, or 96e9?
Clearly, for this implementation/hardware combination, it doesn't.
R.D. Silverman is offline   Reply With Quote
Old 2015-04-30, 19:35   #96
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

3×5×251 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
Clearly, for this implementation/hardware combination, it doesn't.
Perhaps it's worth noting at this point that GMP-ECM implements features that violate assumptions made in the paper. So it should be no surprise that the results of the paper do not hold. For instance, stage 2 in GMP-ECM uses a fast polynomial arithmetic continuation. Therefore the time to compute to B2 is not a linear function of B1, as assumed in the paper. I.e., K increases with increasing (B2 - B1). GMP-ECM can also find factors by the Brent-Suyama extension, which is not treated in the paper.
bsquared is offline   Reply With Quote
Old 2015-04-30, 22:08   #97
ATH
Einyen
 
ATH's Avatar
 
Dec 2003
Denmark

22×863 Posts
Default

Quote:
Originally Posted by VBCurtis View Post
These expected times are better than GMP-ECM default, showing the improved efficiency of choosing B2 such that stage 2 uses just 2 steps. This is why I suggest the -k 2 flag rather than B2scale in general.
-k 1 should be even better if you have enough RAM, it should be faster to do stage 2 in one chunk. For P-1 and P+1 it is always faster with -k 1 and I measured it on many occations, but with ECM it sometimes seems faster with -k 2 for some reason.

M1277 B1=110e6 B2=2e12:
k=1: Step 2 took 519171ms (Peak memory usage: 4400MB)
k=2: Step 2 took 720366ms (Peak memory usage: 4593MB)
So here -k 1 was faster but -k 2 took more RAM which makes no sense.

With P-1 and P+1 it never uses the exact B2 value you type in, but chooses the next larger that fits with parameters. For ECM it displays the exact value you typed in which makes me think it might do a stage 2 with a larger B2 value fitting parameters in the background, which could be why -k 2 is sometimes faster because it fits parameters better.

Last fiddled with by ATH on 2015-04-30 at 22:09
ATH is offline   Reply With Quote
Old 2015-05-01, 00:23   #98
VBCurtis
 
VBCurtis's Avatar
 
"Curtis"
Feb 2005
Riverside, CA

2·2,927 Posts
Default

Interesting! When I tried -k 1, it did not use just one step. I'll look into what I did wrong when I first tried that- I assumed it just never would do a single-step stage 2.
The data point you posted is a substantial improvement, and most of my ECM usage (t45 and t50 levels) is not memory-limited, so this could speed things along nicely.
Thanks!

Edit: First test isn't so interesting. I tried B1 = 11e6, B2 = 47e9 with the usual k=4, and with k=1 (GMP-ECM chose 48e9 for this). Stage 2 times were nearly equal, a tiny bit slower for k=1. Perhaps this is why GMP-ECM never chooses k=1 on its own. Your result is clearly faster, so it bears more experimentation.

Last fiddled with by VBCurtis on 2015-05-01 at 00:39
VBCurtis is offline   Reply With Quote
Old 2015-05-01, 00:42   #99
lorgix
 
lorgix's Avatar
 
Sep 2010
Scandinavia

61510 Posts
Default

Quote:
Originally Posted by VBCurtis View Post
This is not-quite-true; I average the times for a bunch of stage 1 runs, a couple of stage 2 runs for each choice of B2, and then multiply by the number of curves expected to be required to find a factor. This is a bit more accurate to get expected-time-to-find, but it's useful accuracy when trying to find 5% or small improvements. I do trust -v to provide expected curve counts, as listed in my sample data.

Doing such work on a spreadsheet also allows for quick calculation of expected time for a variety of B1/B2 values; invoking ECM with -v provides the expected curve counts immediately, so I can call ECM with a combination not already tried, note the curve counts required, and use the timings from previous stage 1 & stage 2 runs to find expected time to find a factor. Also, Stage 1 time is almost precisely linear in B1, so one can extrapolate for a variety of B1 values.

Now that Mr Silverman understands the definition of t40 and t45, how does the choice of B2=240e9 improve the probability of success PER UNIT TIME to find any size factor over B2=35e9, or 96e9?
Yeah, I do the same. I was hoping my post could help clear up the confusion. Apparently it didn't work, but then B^2 stepped in.
Quote:
Originally Posted by bsquared View Post
Perhaps it's worth noting at this point that GMP-ECM implements features that violate assumptions made in the paper. So it should be no surprise that the results of the paper do not hold. For instance, stage 2 in GMP-ECM uses a fast polynomial arithmetic continuation. Therefore the time to compute to B2 is not a linear function of B1, as assumed in the paper. I.e., K increases with increasing (B2 - B1). GMP-ECM can also find factors by the Brent-Suyama extension, which is not treated in the paper.
I still don't see how the paper says to spend as much time in stage2 as in stage1. I read it as stage1time:stage2time::0.59:0.41, which is consistent with my experience (testing in the way VBCurtis describes).

edit:
About k and B2: GMP-ECM won't use just any B2 you supply, it will use a reasonable number close to what you supply. It doesn't necessarily use the k you supply either, IIRC.

Last fiddled with by lorgix on 2015-05-01 at 00:45
lorgix is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
GMP-ECM & Prime95 Stage 1 Files Gordon GMP-ECM 3 2016-01-08 12:44
Stage 1 with mprime/prime95, stage 2 with GMP-ECM D. B. Staple Factoring 2 2007-12-14 00:21
Need help to run stage 1 and stage 2 separately jasong GMP-ECM 9 2007-10-25 22:32
P4 Prescott - 31 Stage Pipeline ? Bad news for Prime95? Angular Hardware 18 2004-11-15 07:04
Stage 1 and stage 2 tests missing Matthias C. Noc PrimeNet 5 2004-08-25 15:42

All times are UTC. The time now is 13:19.


Fri Jul 7 13:19:50 UTC 2023 up 323 days, 10:48, 0 users, load averages: 1.31, 1.29, 1.19

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, 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.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔