ChangeLog 13 KB

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