NEWS 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. Please check http://hogranch.com/mayer/README.html#news for latest news.
  2. 11 Dec 2014: v14.1 released. Again thanks to Mike Vang for doing independent-
  3. build and QA work. This release features significant performance and accuracy
  4. improvements for all recent x86 platforms, and especial gains for Intel
  5. Haswell (and soon, Broadwell) users.
  6. First, a note on version numbering: After many years frozen at 3.0x (since my
  7. x86 code was until recently wildly uncompetitive with Prime95), now that I'm
  8. < 2x slower (on Haswell+), resumed version numbering according to the scheme:
  9. Major index = year - 2000
  10. Minor index = release # of that year, zero-indexed.
  11. As before, a patch suffix of x, y, or z following the numeric index indicates
  12. an [alpha,beta,gamma] (experimental,unstable) code. Since I consider this
  13. release stable and it's the 2nd release of the year
  14. , thus 14.1 = [20]14.[--2][no xyz suffix].
  15. What's new/improved:
  16. 1. Self-test now has prestored residues for 10000 iterations
  17. (at least though FFT length 18432K), in addition to the previously-
  18. supported 100 and 1000. As before, to use a non-default #iters
  19. (default is 100) for a given self-test range
  20. , add '-iters [1000 | 10000]' to the command line.
  21. 2. One no longer needs any special flags like DFT_V* for any FMA-
  22. using routines - just DUSE_THREADS to enable multithreading
  23. and DUSE_[SSE2 | AVX | AVX2] to select an x86 SIMD-vector-instruction
  24. target.
  25. 3. Propagated Fused multiply-add optimizations to all key discrete
  26. Fourier transform (DFT) and related arithmetic macros. "FMA everywhere"
  27. means Haswell users should see at least a 10% speedup for their AVX2
  28. builds, compared to plain AVX.
  29. 4. Overall accuracy should be appreciably better, meaning users should
  30. see very few roundoff warnings, even for 10Kiter self-tests.
  31. 5. The program now only reports roundoff warnings if it encounters a
  32. fractional part > 0.40625 (previous was >= 0.4) during the carry step.
  33. Some self-tests (meaning exponents right at the upper limit for the
  34. given FFT length, by definition) were emitting slews of 0.40625
  35. warnings, but as this error level is nearly always benign
  36. , I've silenced the warnings for it.
  37. Larger errors will still emit warnings as before.
  38. 6. The accuracy-problematic radix-11 DFTs (used to build composite
  39. leading radices such as 44 and 176) have improved accuracy in SSE2
  40. and AVX modes, but will still emit a few roundoff warnings in longer
  41. self-tests for certain radix combos in those build types. In AVX2 mode
  42. , however, the fact that "multiplies are free" (assuming we can fuse
  43. them with adds, which we can to a very large extent in this case)
  44. allowed me implement an entirely different radix-11 algorithm which is
  45. much more multiply-heavy, but has significantly better roundoff
  46. properties. Thus AVX2 builders will see dramatically lower roundoff
  47. errors for FFT lengths using the aforementioned leading radices 44
  48. and 176.
  49. 7. I added large-stride prefetching to all the carry routines, since
  50. the 2 DFTs (specifically the final-radix-pass of the inverse FFT
  51. , followed by the normalize/carry step, followed by the initial-
  52. radix-pass of the subsequent iteration's forward FFT) bookending the
  53. carry step in those access data in large strides and are thus
  54. problematic for the kinds of default data prefetching done by most x86
  55. hardware. That "manual assist" prefetch should provide a nice boost (5-
  56. 10% for me at FFT lengths in the Mdoubles range) for all build modes.
  57. 18 Sep 2014: Special thanks to Mike Vang for doing significant amounts of QA
  58. work and making numerous feature-related suggestions for this version.
  59. This release features mostly modest changes:
  60. Restoration of 32-bit USE_SSE2 build mode (GCC/clang only - no Visual
  61. Studio). But see the comments in the build section regarding the need
  62. to build some files using GCC
  63. (i.e. no pure-Clang builds in 32-bit mode).
  64. A new initial-FFT-pass/final-iFFT-pass radices 288, which should
  65. provide a decent (~5%%) speedup for folks doing 100Mdigit-range
  66. assignments (FFT length 18Mdoubles = 18432K).
  67. To allow for incremental rerun of testcases (e.g. ones which fail to
  68. match an independent test done by another user/machine, which is the
  69. standard matching-double-check requirement for "exponent retirement"
  70. by GIMPS, the program now saves a unique-named bytewise restart file
  71. every millionth iteration, i.e. if you are testing the Mersenne
  72. number M(XXX), in addition to the status (log) file pXXX.stat and the
  73. pair of redundant checkpoint files pXXX and qXXX, you will also see
  74. files pXXX.1M, pXXX.2M, etc, get deposited as those iteration
  75. milestones are passed. Note that in order to avoid an unneeded file-
  76. copy and to minimize the chances of a bad disk sector from corrupting
  77. a run, the way this works is that when it comes time to write the
  78. checkpoint files for (say) iteration 1010000 (1.01M), the code simply
  79. renames the current pXXX savefile (containing data for iteration 1M)
  80. to pXXX.1M, then creates a new pXXX file to write the new-checkpoint
  81. data to. (The redundant q-savefile is unaffected by this).
  82. Note also that as these files do pile up quickly on a fast machine
  83. , especially if disk space is constrained (for instance if you are
  84. using a smallish SSD rather than a big old-style moving-parts HD)
  85. , you will want to "offload" these Miteration files periodically to
  86. either a larger drive or backup media, and/or delete them if the
  87. result double-checks OK.)
  88. 23 Jun 2014: Special thanks to Stephen Searle for doing significant amounts of
  89. analysis and debug of the code in this version.
  90. This release features the following major enhancements and changes:
  91. Continuing the multithread optimizations described in the previous
  92. release below, new initial-FFT-pass/final-iFFT-pass radices
  93. 128,144,160,176,192,208,224,240,256, as well as some larger
  94. experimental radices 768,960,1008 and 4032. The latter are not
  95. currently useful for LL testing (as the obligatory self-tests which
  96. create the mlucas.cfg file optimized for the user's machine will
  97. reveal, by way of absence of said radices in the best-radix-set data
  98. captured in the .cfg file), but the radices in the 128-256 range
  99. should provide a benefit for most users, especially for FFT lengths
  100. of roughly 2048 Kdoubles and larger.
  101. Fused-multiply-add (FMA) support for Intel Haswell (and beyond).
  102. Since Intel released their FMA support in the same chip generation they
  103. used to deploy the AVX2 instructions, use of FMA is triggered via
  104. -DUSE_AVX2 at compile time. Currently only a limited fraction of the
  105. key code macros use FMA, but this will continue to expand as I get a
  106. better sense of where use of FMA is most likely to yield a benefit.
  107. (This depends sensitively on the details of the particular FFT
  108. implementation, for example whether a pre-twiddles or post-twiddles
  109. complex-multiply scheme is used for the various passes of the inverse
  110. FFT; Mlucas uses the latter, which is nice from a dataflow-symmetry
  111. and auxiliary-data-indexing perspective, but is not favorable for an
  112. FMA-based code speedup.)
  113. A compact-object code scheme for all the carry-step-wrapping DFT
  114. radices >= 32. This yields a significant throughout boost for older
  115. and more bandwidth-limited processors such as Core2 and Sandy/Ivy
  116. Bridge. The speedups are more modest on Haswell, but even there the
  117. user will at least enjoy the slashed compile times for the larger-radix
  118. radix**_ditN_cy_dif1.c sourcefiles in question. Compile (and likely
  119. run-times) for non-SIMD (i.e. scalar-double C code) builds on non-x86
  120. hardware will benefit similarly.
  121. Multiple bugfixes, most related to self-testing and thread-safeness.
  122. The format for the per-iteration timing data written to mlucas.cfg file
  123. created by the running the automated self-tests is changed from seconds
  124. to milliseconds in this version, to provide finer-grained numbers.
  125. 02 Oct 2013 (Patched rev1 posted 09 May 2014): This features the following
  126. major enhancements and changes:
  127. AVX-instructions-set inline assembly support for 64-bit Linux/GCC MacOS
  128. (both GCC and LLVM/clang). This yields nice speedups over the SSE2-
  129. based SIMD code on Intel chips supporting AVX (Sandy/Ivy Bridge and
  130. Haswell/Broadwell). Owners of AMD CPUs featuring AVX are welcome to try
  131. the code out, but should not get their hopes up too much, as AMD's
  132. implementation of AVX appears to be disappointing int terms of
  133. performance.
  134. Although the 32-bit Windows/MSVC and Linux/GCC inline assembler of the
  135. previous release is still all there, as of this version 32-bit support
  136. for x86 SIMD builds is officially discontinued. Builders using 64-bit
  137. Windows should use a *nix virtualization package such as mingw64.
  138. The previously-available-by-request-only threadpool code is now
  139. included in the release. See build instructions below for details.
  140. Several new carry-step-wrapping "initial FFT pass" DFT radices:
  141. 48,56,64, all fully SIMD-capable. These are added to the existing
  142. SIMD-capable radix-16,20,24,28,32,36,40,44,52,60 carry-step-wrapping
  143. DFTs. The reason I added the new radices is related to ongoing
  144. experience with multithreaded performance: In particular
  145. , leading radices greater than 32 or so tend to perform quite poorly
  146. in unthreaded-build mode and for FFT lengths < 2048 Kdoubles
  147. (which guided most of the codebase evolution until quite recently)
  148. , but are standouts in multithreaded mode and for large FFT lengths.
  149. Since the parallelization strategy I use for my FFT means that
  150. "maximum number of independent thread-based work chunks" is directly
  151. related to the above leading-radix, the emerging manycore
  152. (GPU and similar) paradigm will be driving adoption of even larger DFT
  153. radices in future releases.
  154. Multithreaded (pthread/threadpool) support extended to the non-SIMD
  155. (i.e. scalar-double) code. This replaces the previous and only-
  156. partially-working threading model based on the OpenMP API, with its
  157. weird (and virtually-impossible-to-debug) performance issues and
  158. opaque interface. For code such as mine, opacity of the threading-
  159. interface is not advantageous, especially in terms of basic-
  160. development-and-debug work.
  161. 04 Feb 2013:
  162. Lots of SSE2-related enhancements, including inline assembler optimized
  163. for 64-bit OSes via use of the full 16-XMM-register set. New SSE2-
  164. supported carry-step-wrapping DFT radices, yielding SSE2-able radix-16
  165. ,20,24,28,32,36,40,44,52,60 carry steps.
  166. Multithreaded (pthread/threadpool) SSE2 support! This code was used for
  167. the new-Mersenne-prime verification run described below. The threadpool
  168. code is not included in the default release; please contact the author
  169. if you wish to play with multithreaded builds of the code.
  170. Mlucas SSE2 used to verify the 48th known Mersenne prime. Note that the
  171. the author could have done the verification himself in around 11 days
  172. on his humble quad-core Sandy Bridge box, but since for new-prime
  173. verifies such as this wall-clock time is the overriding factor
  174. , it makes sense to run on the fastest hardware available, even if
  175. this is relatively less efficient than running on a fewer-core
  176. workstation. In the present case, Serge Batalov ran the verify in 6
  177. days on a 32-core Xeon cluster kindly made available by Novartis Inc.
  178. Due to poor scaling of the parallel code beyond 4 cores, this
  179. represents significantly more total cycles (and watt-hours) than a 4-
  180. core run would need, but we find new Mersenne primes rarely enough
  181. that such cycle-wastage is justified. (And Why hog all the fun, I say -
  182. Serge said he hadn't had this much computational fun in years.)
  183. 06 Nov 2009: Well, it took a full year longer than I had hoped, but a tarball
  184. of the Mlucas v3.0 beta code described in the entry below is finally available.
  185. This has SSE2 inline assembly support for 32-bit Windows and 32/64-bit Linux
  186. , but no PrimeNet support (yet) ... the latter will come later this year, if
  187. things go reasonably according to plan. A GUI will have to wait for at least
  188. another year. But the code is sufficiently ready for early adopters to run on
  189. their x86 machines (Win32, 32 and 64-bit Linux and MacOS ... code is most-
  190. optimized for the latter) and for builders, profilers and assembler experts to
  191. have a look and send me feedback and suggestions for improvement.
  192. 15 Sep 2008: Mlucas 3.0 used to verify 45th and 46th known Mersenne primes.
  193. Note that the verify runs by Tom Duell and Rob Giltrap of Sun Microsystems used
  194. a pre-beta version of Mlucas 3.0, scheduled for official release later this
  195. Fall. Key new features of the upcoming release [besides a radically overhauled
  196. header-file structure and many other code cleanups and bugfixes] include:
  197. SSE2 inline assembly support [at least for FFT lengths which are powers
  198. of 2 or divisible by the small odd primes 3, 5 and 7] - this will
  199. provide a roughly 2x speedup over the previous generic-C build on the
  200. newer x86 platforms [AMD64, Core2 and beyond]. Initial targets will be
  201. 32-bit Windows and 32/64-bit Linux, as well as MacOS..
  202. Platform-independent compact bytewise savefile format - you can now
  203. transfer savefiles between any systems having a working 3.0 build
  204. , independently of the Endian-ness and 32-vs-64-bit-ness of the
  205. platform.
  206. Copyright:
  207. Copyright (C) 2015 Ernst W. Mayer.
  208. Permission is granted to copy, distribute and/or modify
  209. this document under the terms of the GNU Free Documentation License,
  210. Version 1.3 or any later version published by
  211. the Free Software Foundation; with no Invariant Sections,
  212. no Front-Cover Texts, and no Back-Cover Texts.