Bitcoin Forum
December 12, 2017, 08:53:04 PM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 [41] 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 ... 133 »
  Print  
Author Topic: [XPM] [ANN] Primecoin High Performance | HP14 released!  (Read 395385 times)
ReCat
Sr. Member
****
Offline Offline

Activity: 406



View Profile WWW
July 19, 2013, 03:18:14 AM
 #801



Second block I managed to mine with HP4. Seivesize 2M. I feel like getting adventurous and going to 4M...

BTC: 1recatirpHBjR9sxgabB3RDtM6TgntYUW
Hold onto what you love with all your might, Because you can never know when - Oh. What you love is now gone.
1513111984
Hero Member
*
Offline Offline

Posts: 1513111984

View Profile Personal Message (Offline)

Ignore
1513111984
Reply with quote  #2

1513111984
Report to moderator
1513111984
Hero Member
*
Offline Offline

Posts: 1513111984

View Profile Personal Message (Offline)

Ignore
1513111984
Reply with quote  #2

1513111984
Report to moderator
1513111984
Hero Member
*
Offline Offline

Posts: 1513111984

View Profile Personal Message (Offline)

Ignore
1513111984
Reply with quote  #2

1513111984
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1513111984
Hero Member
*
Offline Offline

Posts: 1513111984

View Profile Personal Message (Offline)

Ignore
1513111984
Reply with quote  #2

1513111984
Report to moderator
1513111984
Hero Member
*
Offline Offline

Posts: 1513111984

View Profile Personal Message (Offline)

Ignore
1513111984
Reply with quote  #2

1513111984
Report to moderator
1513111984
Hero Member
*
Offline Offline

Posts: 1513111984

View Profile Personal Message (Offline)

Ignore
1513111984
Reply with quote  #2

1513111984
Report to moderator
glassuser
Donator
Sr. Member
*
Offline Offline

Activity: 378


Co-Founder and CEO of Coingig.com


View Profile WWW
July 19, 2013, 03:19:46 AM
 #802

you should upgrade to hp5, you got some awesome primespersec ive reached max of around 2500

ReCat
Sr. Member
****
Offline Offline

Activity: 406



View Profile WWW
July 19, 2013, 03:21:29 AM
 #803

What's your CPU? Mine is two quad-core xeons. same architecture as the old core 2 duo processors... im thinking maybe im getting good speeds because of the large amount of cache i have or something?

BTC: 1recatirpHBjR9sxgabB3RDtM6TgntYUW
Hold onto what you love with all your might, Because you can never know when - Oh. What you love is now gone.
Kyune
Sr. Member
****
Offline Offline

Activity: 287


View Profile
July 19, 2013, 03:21:54 AM
 #804

Just wanted to say great miner!  I feel like this is probably the most optimized miner on the market right now.  Looking over the source code of the original miner and yours I think I see a way to make the miner (potentially much) faster from a mathematical standpoint rather than a code-optimization standpoint.  My optimization centers around the Primorial and the loop that occurs in main.cpp on line 4622.

Before getting into the code, it is important to realize why a primorial is helpful (if you already understand this, skip this paragraph).  With numbers on the order of 2256 there is about a 1 in 177 chance that a random number is prime.  If you select 8 random numbers, then, the odds of all of them being prime is about 1 in 1 quintillion--impractically low.  If you limit your search to only odd numbers, though, the odds shoot up tremendously.  Further limiting your search to numbers not divisible by 3, 5, 7, and so on can cause the odds of finding a prime number to become much, much better.  If the hash value is divisible by lots of these small numbers then multiples of that hash ± 1 will not be divisible by any of those numbers.  Thus, it is convenient to use a hash that is already a multiple of 2 * 3 * 5 * 7 * ... as it will produce far more primes than another hash.

As I understand the aforementioned loop, the program is searching for a hash that is divisible by a primorial.  Each iteration of this loop requires a hash to be generated as it increments the nonce value.  In the present form the primorail is of degree 7 (line 4579: static const unsigned int nPrimorialHashFactor = 7).  I suspect that this value is carefully chosen and it's probably ideal with the way that it is written.  However, I think there's an additional step that can be added to make the process much faster.  Increasing the degree of the primorial is incredibly expensive as it gets larger, since adding the 8th prime requires 19 times as many hashes to be checked; the 9th prime requires 23 times as many, and so on.  There is another way, though.

Prime origins are required to be in the form O = H * N where O is the origin, H is the hash, and N is any integer; H is selected to be divisible by p#7 (the primorial shown above).  If we extend this to O = H * N * P2 where P2 is 19 * 23 * 29 * ... * 51--a product of primes starting after the last prime used in the existing search--then the checked origin is still valid (an integer times an integer is still an integer).  This grants the benefits of searching with a higher degree primorial while not requiring a longer search for a working hash.  

Nothing is free, though, as this method inflates the size of the primes to be checked.  If the fast modular exponentiation is implemented through the same method as is used on the Fermat Primality Test Wikipedia page then the algorithmic efficiency is O(log2(n) * log(log(n)) * log(log(log(n))) ).  There should be some sweet spot of how large of a primorial to use where the increased frequency of primes more than offsets the extra time required for the fast modular exponentiation.  It's possible that the sweet spot is 0 extra primes, but I think it's worth looking into.
Number theorist in the hizzouse!

BTC:  1K4VpdQXQhgmTmq68rbWhybvoRcyNHKyVP
glassuser
Donator
Sr. Member
*
Offline Offline

Activity: 378


Co-Founder and CEO of Coingig.com


View Profile WWW
July 19, 2013, 03:22:22 AM
 #805

What's your CPU? Mine is two quad-core xeons. same architecture as the old core 2 duo processors... im thinking maybe im getting good speeds because of the large amount of cache i have or something?

yea you have more i have one quadcore with 8gigs of ram lol, im jealous

ReCat
Sr. Member
****
Offline Offline

Activity: 406



View Profile WWW
July 19, 2013, 03:27:06 AM
 #806

the computer im using costed me 180 bucks. its a retired rack server. Tongue

BTC: 1recatirpHBjR9sxgabB3RDtM6TgntYUW
Hold onto what you love with all your might, Because you can never know when - Oh. What you love is now gone.
glassuser
Donator
Sr. Member
*
Offline Offline

Activity: 378


Co-Founder and CEO of Coingig.com


View Profile WWW
July 19, 2013, 03:28:08 AM
 #807

the computer im using costed me 180 bucks. its a retired rack server. Tongue

thats awesome!

forsetifox
Sr. Member
****
Offline Offline

Activity: 266



View Profile
July 19, 2013, 03:28:58 AM
 #808

the computer im using costed me 180 bucks. its a retired rack server. Tongue

Going to buy one of those when I get ~ 2 BTC playing with primecoins. =3
ReCat
Sr. Member
****
Offline Offline

Activity: 406



View Profile WWW
July 19, 2013, 03:33:52 AM
 #809

Did I mention how everyone mocked me for buying the rack server?

"You'll mine 1 litecoin with it, maybe two"

 Cheesy

BTC: 1recatirpHBjR9sxgabB3RDtM6TgntYUW
Hold onto what you love with all your might, Because you can never know when - Oh. What you love is now gone.
noodle_dam
Hero Member
*****
Offline Offline

Activity: 529



View Profile
July 19, 2013, 03:55:14 AM
 #810

What is the best way to get an hp build working on OS X?

Having toyed with it for hours, I can conclusively say that installing VMWare Fusion with an image of Ubuntu and compiling / running it on there yields the best results. I don't know why, it just does. Natively, compiled in Mountain Lion, I get about half the performance from the same build compiled in the VM.

I hope helps you out.

Thank you.

yourofl10
Full Member
***
Offline Offline

Activity: 168


View Profile
July 19, 2013, 04:35:02 AM
 #811

So what's more important? The number of cores or the clockspeed? Also, where are some good places to mine now?

ReCat
Sr. Member
****
Offline Offline

Activity: 406



View Profile WWW
July 19, 2013, 04:39:17 AM
 #812

Both put together. To find out, just run a benchmark like passmark.

BTC: 1recatirpHBjR9sxgabB3RDtM6TgntYUW
Hold onto what you love with all your might, Because you can never know when - Oh. What you love is now gone.
nullbitspectre1848
Full Member
***
Offline Offline

Activity: 141



View Profile
July 19, 2013, 04:42:17 AM
 #813

Where do I go for the latest miner updates etc?

#Darren
Sr. Member
****
Offline Offline

Activity: 316



View Profile
July 19, 2013, 04:48:08 AM
 #814

Where do I go for the latest miner updates etc?

Page 1 of this thread.
AstroKev
Newbie
*
Offline Offline

Activity: 22


View Profile
July 19, 2013, 06:21:31 AM
 #815

Some more stats for people to have fun with:

aws cc2.8xlarge,
primecoin-0.1.1-hp5 native

2013-07-19 06:03:07 primemeter  79132085 prime/h 688566896 test/h      2040 5-chains/h
2013-07-19 06:04:07 primemeter  79653622 prime/h 698384521 test/h      2700 5-chains/h
2013-07-19 06:05:07 primemeter  79337338 prime/h 695558447 test/h      2040 5-chains/h
2013-07-19 06:06:07 primemeter  79792250 prime/h 695628406 test/h      1560 5-chains/h
2013-07-19 06:07:07 primemeter  80470419 prime/h 705139328 test/h      2280 5-chains/h
2013-07-19 06:08:07 primemeter  80764354 prime/h 704518758 test/h      1980 5-chains/h
2013-07-19 06:09:07 primemeter  76383887 prime/h 667428216 test/h      1500 5-chains/h


avg 5-chains/h ~~ 2000

------

aws cc2.8xlarge,
primecoin-0.1.1-hp5 two changes:

1) prime.cpp
const unsigned int nPrimes = (uint64)nTotalPrimes * 8 / 100;  // down from 10

2) main.cpp
static const unsigned int nPrimorialHashFactor = 9; // up from 7

2013-07-19 06:12:12 primemeter  52307908 prime/h 395403610 test/h      2640 5-chains/h
2013-07-19 06:13:12 primemeter  56580497 prime/h 440204443 test/h      2820 5-chains/h
2013-07-19 06:14:12 primemeter  56291842 prime/h 438057079 test/h      3000 5-chains/h
2013-07-19 06:15:12 primemeter  56267549 prime/h 437380981 test/h      2100 5-chains/h
2013-07-19 06:16:12 primemeter  56236005 prime/h 432883711 test/h      2580 5-chains/h
2013-07-19 06:17:12 primemeter  54281275 prime/h 412524505 test/h      2580 5-chains/h
2013-07-19 06:18:12 primemeter  54689509 prime/h 419307812 test/h      2220 5-chains/h

avg 5-chains/h ~~ 2500





martingale gambler bot: http://goo.gl/b4XsJ
paulthetafy
Hero Member
*****
Offline Offline

Activity: 815


View Profile
July 19, 2013, 06:52:37 AM
 #816

Some more stats for people to have fun with:

aws cc2.8xlarge,
primecoin-0.1.1-hp5 native

2013-07-19 06:03:07 primemeter  79132085 prime/h 688566896 test/h      2040 5-chains/h
2013-07-19 06:04:07 primemeter  79653622 prime/h 698384521 test/h      2700 5-chains/h
2013-07-19 06:05:07 primemeter  79337338 prime/h 695558447 test/h      2040 5-chains/h
2013-07-19 06:06:07 primemeter  79792250 prime/h 695628406 test/h      1560 5-chains/h
2013-07-19 06:07:07 primemeter  80470419 prime/h 705139328 test/h      2280 5-chains/h
2013-07-19 06:08:07 primemeter  80764354 prime/h 704518758 test/h      1980 5-chains/h
2013-07-19 06:09:07 primemeter  76383887 prime/h 667428216 test/h      1500 5-chains/h


avg 5-chains/h ~~ 2000

------

aws cc2.8xlarge,
primecoin-0.1.1-hp5 two changes:

1) prime.cpp
const unsigned int nPrimes = (uint64)nTotalPrimes * 8 / 100;  // down from 10

2) main.cpp
static const unsigned int nPrimorialHashFactor = 9; // up from 7

2013-07-19 06:12:12 primemeter  52307908 prime/h 395403610 test/h      2640 5-chains/h
2013-07-19 06:13:12 primemeter  56580497 prime/h 440204443 test/h      2820 5-chains/h
2013-07-19 06:14:12 primemeter  56291842 prime/h 438057079 test/h      3000 5-chains/h
2013-07-19 06:15:12 primemeter  56267549 prime/h 437380981 test/h      2100 5-chains/h
2013-07-19 06:16:12 primemeter  56236005 prime/h 432883711 test/h      2580 5-chains/h
2013-07-19 06:17:12 primemeter  54281275 prime/h 412524505 test/h      2580 5-chains/h
2013-07-19 06:18:12 primemeter  54689509 prime/h 419307812 test/h      2220 5-chains/h

avg 5-chains/h ~~ 2500


Have you found any blocks with these changes? My very poor understanding of the algorithm suggests that changing the has factor will not work...

bidji29
Sr. Member
****
Offline Offline

Activity: 392


View Profile
July 19, 2013, 07:10:35 AM
 #817

Thanks for the data Astrokev.
We see the pps is lower but the 5-chain bigger with your change. I think it's good, 5chain seems a better indicator.

Did you test with other number aswell?

http://www.freebieservers.com/  100% FREE GAME SERVERS
grc
Jr. Member
*
Offline Offline

Activity: 40


View Profile
July 19, 2013, 07:20:29 AM
 #818

2) main.cpp
static const unsigned int nPrimorialHashFactor = 9; // up from 7

I could be wrong, but I'm not convinced this change will make any significant difference. The primorial of 7 is the same as that of 9, since 8 and 9 aren't primes.

AstroKev
Newbie
*
Offline Offline

Activity: 22


View Profile
July 19, 2013, 07:36:58 AM
 #819

Quote
Have you found any blocks with these changes? My very poor understanding of the algorithm suggests that changing the has factor will not work...

No - I only was testing based on some of Koooooj's comments to see if there was a possible tradeoff.
The primecoin paper says:

Quote
In one case, varying nonce and finding a block header hash that is divisible by a small
primorial number – the product of all primes smaller than a given prime p – can help
only slightly. It allows the prime miner to work on somewhat smaller primes, like maybe
a few digits shorter, for prime numbers of typically 100 digits, only a very small
advantage.

which suggested further that this is only used to help make finding candidates faster.

--------

Related, I finally was able to coerce primecoind to compile on FreeBSD.  Here are some stats for an HP DL 585 w/64 cores -- which is actually almost the same for 5-chains as the cc2.8xlarge:
2013-07-19 07:21:20 primemeter  52706242 prime/h 409095802 test/h      2700 5-chains/h
2013-07-19 07:22:20 primemeter  55256799 prime/h 430313188 test/h      2820 5-chains/h
2013-07-19 07:23:20 primemeter  57252732 prime/h 451175301 test/h      3180 5-chains/h
2013-07-19 07:24:20 primemeter  60431918 prime/h 472296745 test/h      2280 5-chains/h
2013-07-19 07:25:20 primemeter  49530089 prime/h 384528982 test/h      2460 5-chains/h
2013-07-19 07:26:20 primemeter  51512423 prime/h 400527689 test/h      1980 5-chains/h


If you're interested in compiling for FreeBSD, you also will need to install the usual libraries and also change init.cpp:
Code:
//    nMaxConnections = std::max(std::min(nMaxConnections, FD_SETSIZE - nBind - MIN_CORE_FILEDESCRIPTORS), 0);
    nMaxConnections = std::max(std::min(nMaxConnections, static_cast<int>(FD_SETSIZE - nBind - MIN_CORE_FILEDESCRIPTORS)), 0);
I had to specify the install paths for a lot of things and remove the explicit -ldl in the makefile as well.. go figure.



Quote
Did you test with other number aswell?
Yes, I did 10, 11, 12, 13, 14, 15, 16, 17.  It starts to get bad around 13 on the big aws instance.

Quote
I could be wrong, but I'm not convinced this change will make any significant difference. The primorial of 7 is the same as that of 9, since 8 and 9 aren't primes.
No this is not what primorial means.  

primorial(1) = 2
primorial(2) = 2 * 3
primorial(3) = 2 * 3 * 5
and so forth.
primorial(7) = 2 * 3 * 5 * 7 * 11 * 13 * 17 = 510510
primorial(9) = 2 * 3 * 5 * 7 * 11 * 13 * 17 * 19 * 23 = 223092870



Notice the list of divisors this produces when using p#9 * some random price
> bc
print 223092870 * 498497689
111211280127377430

http://www.wolframalpha.com/input/?i=factor+%28111211280127377430%29



Honestly I can't say I really understand what the code is doing here, but based on some the comments from Kooooooj and running through gprof, Weave is sucking up all the time -- so I was trying to push some of the work out of there and into the caller function.  I am 100% speculating also that the increases in difficulty may make the primorial a little more important. But anyway, mostly just hacking.


oh well, off to bed.

martingale gambler bot: http://goo.gl/b4XsJ
grc
Jr. Member
*
Offline Offline

Activity: 40


View Profile
July 19, 2013, 08:18:45 AM
 #820

Quote
I could be wrong, but I'm not convinced this change will make any significant difference. The primorial of 7 is the same as that of 9, since 8 and 9 aren't primes.
No this is not what primorial means.  

primorial(1) = 2
primorial(2) = 2 * 3
primorial(3) = 2 * 3 * 5
and so forth.
primorial(7) = 2 * 3 * 5 * 7 * 11 * 13 * 17 = 510510
primorial(9) = 2 * 3 * 5 * 7 * 11 * 13 * 17 * 19 * 23 = 223092870



Notice the list of divisors this produces when using p#9 * some random price
> bc
print 223092870 * 498497689
111211280127377430

http://www.wolframalpha.com/input/?i=factor+%28111211280127377430%29



Honestly I can't say I really understand what the code is doing here, but based on some the comments from Kooooooj and running through gprof, Weave is sucking up all the time -- so I was trying to push some of the work out of there and into the caller function.  I am 100% speculating also that the increases in difficulty may make the primorial a little more important. But anyway, mostly just hacking.


oh well, off to bed.

Sorry, I was thinking of this definition, where the primorial of a number is defined as the product of all primes ≤ n.

It seems to be implemented this way in prime.cpp, as the Primorial function stops at the first prime greater than the given number:

Code:
void Primorial(unsigned int p, mpz_class& mpzPrimorial)
{
    mpzPrimorial = 1;
    BOOST_FOREACH(unsigned int nPrime, vPrimes)
    {
        if (nPrime > p) break;
        mpzPrimorial *= nPrime;
    }
}

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 [41] 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 ... 133 »
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!