42

My current computer is a MacBook Air, the mid-2011 version: 4 GB RAM, 1.7 GHz Intel dual core. It runs Mathematica 9 smoothly, but a bit too slowly for my taste. I use Mathematica almost exclusively for complicated graphics-intensive calculations, e.g., high-res animations of implicit surfaces (ContourPlot3D sees lots of action around here). Supposing that my main objective is an increase in Mathematica's speed (within the stated field of use), what things should I look for in a new computer?

I can sort of guess that I should go for the largest amount of RAM and the fastest CPU (and maybe GPU) within my budget. But what exactly is the relative importance of these factors? Given a choice between an expensive unit with very fast CPU and a moderate amount of RAM, and a cheap unit with moderately fast CPU and tons of RAM, which should I choose?

What kind of speed-up can I reasonably expect, going from Mathematica on my current computer to Mathematica on a newer (off-the-shelf) unit? Is it even worth the trouble and the money to buy a new computer for Mathematica?

Sorry if this question doesn't come across as the most intelligent question in the world, but I'm a bit of an airhead when hardware-related stuff is concerned.

Kim Fierens
  • 1,857
  • 1
  • 16
  • 18
  • The answer depends on what sorts of problems you will be solving. For some, parallel processing (typically with four processors) can achieve a speed-up of three or so. Thus, a four-core CPU might make good sense. Since memory is cheap, get 8 Gig in any case. – bbgodfrey Dec 20 '14 at 00:00
  • This is an interesting Q given the lack of benchmarks. I'm also intersted in the Mac Pro but can only justify it if it's going to substantially improve execution time and can do ParallelCombine etc across multi-cores. – alancalvitti Dec 20 '14 at 00:24
  • GPU may be important especially if you plan to use CUDA or OpenCL. But it really is a very broad question which I don't believe has a unique answer. – Jens Dec 20 '14 at 01:16
  • @Mr.Wizard Essentially it is a duplicate, but the answers here a more numerous and detailed...? – Yves Klett Dec 20 '14 at 07:57
  • 1
    In my subjective opinion the front end works much smoother on a mac. You might want to keep the macbook air for the front end and run the kernel elsewhere? – chris Dec 20 '14 at 09:34
  • Here's my 2 cents about closing as duplicate. Note that the OP says: "I use Mathematica almost exclusively for complicated graphics-intensive calculations, ...", which is quite specific. On the other hand, he/she is asking for basic hardware considerations in general, which I suppose could be covered in the other Q&A. It would make sense to only focus on graphics intensive calculations here, but I guess there is too much momentum already towards general benchmarks. I am voting to close. – Jacob Akkerboom Dec 21 '14 at 14:06
  • That's true, Jacob Akkerboom. Unfortunately, just about everyone seems to have missed my point that I use Mathematica for a quite specific purpose. – Kim Fierens Dec 21 '14 at 16:43

4 Answers4

28

Let me give you a start by sharing some insights. This all is purely subjective. When I buy a new computer, then I take some time to study the state of the art regarding hardware. You will never know everything because there are just too much topics, too much details and just too much to read, but with some research you can get a pretty good idea. Last time when I did this for my own pc was about 2 years ago. Here is my benchmark from today in Mathematica 10.0.2 (with overclocked settings in BIOS):

Mathematica graphics

Let me tell you upfront: You buy this kind of benchmark with money. There is no way of cleverly choosing cheap hardware and getting a super computer. The problem is that the dependency between money and computational power is not linear but highly exponential. It always follows this kind of graph:

Mathematica graphics

So when you buy the second best processor which is already very very good, then buying the best one will probably cost you much much more, although the speed increase is not really noticeable. So when you have a fixed budget, you should keep this in mind because you probably can save some money at one place and spend it in another one, where the impact on the overall power of your system is higher.

When you do much with graphics, then you should definitely care about the graphics card. The rendering of 3d graphics is done with OpenGL and runs completely in the graphics card. Although the creation of the graphics doesn't! For me, the choice here was always simple because I started with NVidia when they introduced CUDA and used it ever since. OK, one time I was forced because the Apple guys switched to ATI once.

Graphics cards are expensive; they usually cost much more than your mainboard. The German NVidia page gives you a pretty good overview what the GeForce series cost. If you want to compare them, then look out for number of CUDA cores and how much RAM they have. Note that NVidia cards are usually built by others. So you will find the same card (say Geforce GTX 980) from different vendors like MSI, ASUS, Gainward, ZOTAC, etc. They can differ in some details. I usually use ASUS because I often use ASUS mainboards. But I guess this just like the belief in god and has not really an impact.

The second big pack comes as triple: CPU, RAM, Mainboard. This is because the mainboard needs to have the correct socket for the CPU, and CPU and mainboard need to support the RAM size and type you want. I usually start by deciding what CPU I want. Intel CPU's are my favorite for two reasons: When I program something in C/C++, then I use the Intel Compiler, which works best with their own CPU's. Additionally, Mathematica uses the Intel libraries for numerical algorithms too. Choosing the CPU is probably the hardest part, because there are zillion of different types and revisions which differ not only in the frequency and number of cores and threads, but additionally in things like L1/L2/L3 cache sizes, when they were build, etc... What you probably want is a quad-core (which has 8 hyperthreads). If your budget is high enough, you could look out for the i7 series. In my two year old pc I have a i7-2700K 3.5GHz x 8 which still rocks.

For the mainboards, I usually go for a gamer product because they often support features like overclocking. The important parts of a mainboard are the chipsets that do the work. I know that my Maximus IV Extreme-Z mainboard has an Intel chipset but whether this really is necessary, I have no idea.

If you choose RAM, then I would suggest at least 8GB. I'm doing data processing very often and I have to work with 3d data. With such stuff, you can fill a large amount of RAM very quickly. That is why I chose 32GB back then. Two points: (i) Usually, you don't need that much, but on the other hand (ii) even 32GB are sometimes not enough.

Regarding hard-drive: When your budget allows it, then buy 2 hard-drives. One SSD where you install the operating system and one big normal hard-drive for your data. You will be surprised what a difference this makes because one of the (often underestimated) bottlenecks is the transfer of data from the hard-drive to the RAM during startup.

As a final note: If you don't want to build your computer from pieces but rather like to buy a complete system, then just go for a good gamer pc. They usually have exactly the properties of a very good computer, because, well, they need to be power-horses to run today's games.

halirutan
  • 112,764
  • 7
  • 263
  • 474
  • You have an unlocked K series CPU -- why don't you run a higher multiplier? – Mr.Wizard Dec 20 '14 at 05:55
  • 1
    @Mr.Wizard Never needed it since other things need way more time than I could get back by tweaking the overclocking (e.g. me thinking or watching p*rn is one slowing factor). I turned it on for you and uploaded a new benchmark which came from 4.6GHz. – halirutan Dec 20 '14 at 06:30
  • That's more like it. That CPU is the big brother to mine so it should be faster. I think you'll find 4.6GHz quite stable; I use an offset voltage of +0.1v by the way. – Mr.Wizard Dec 20 '14 at 06:40
  • 1
    Consumer cards (GeForce) are hobbled quite badly though when it comes to CUDA performance. You get similar (but unlocked) hardware with different drivers for a multiple of the price with under the Quadro brand name which is specifically designed for enterprise use. – Yves Klett Dec 20 '14 at 07:50
  • Thanks for this very extensive answer! It will definitely help me make a better decision. – Kim Fierens Dec 20 '14 at 08:54
  • Nice summary. I think your final note is very important; there may be plenty of Mathematica users out there that aren't the tech-fiddling types. – bobthechemist Dec 20 '14 at 14:53
  • @Yves I didn't know that. That is disappointing. Have there been any efforts to unlock these cards that you are aware of? – Mr.Wizard Dec 20 '14 at 17:02
  • 1
    @Mr.Wizard for older GeForce models you could make the Quadro drivers work after a fashion but last time I took a closer look (about three years ago) there were purportedly hardware blocks in place. You can still do CUDA, but not with the same number of cores that are available for rendering. Again, info may be dated, but Quadros are still ridiculously expensive, so I expect no substantial changes. – Yves Klett Dec 20 '14 at 17:32
  • @YvesKlett Do you have references for that? Because what I know is that e.g. double precision is reduced for GeForce but this is marketing strategy of NVidia. I don't think that the price difference between Quadro (or Tesla) and GeFore is justified for home use. See here and here. – halirutan Dec 20 '14 at 17:49
  • @halirutan thanks for the link! Probably the core statement was incorrect (no clue how the hobbling is acutally achieved). And yes, the pricing is really steep (plus, the gaming performance may be worse because the drivers are not optimized for that, and I seem to remember you are a Battlefield fiend). – Yves Klett Dec 20 '14 at 18:26
  • Anybody who overclocks their CPU doesn't seem to care about their work - sure it may work fine today (and I sure hope you ran a 3 day long stress test before making that conclusion), but over time components degrade, the higher heat has consequences, etc. There's a reason no server MB ever mentions any kind of overclocking features but instead things like ECC memory, while gaming MBs do all the time. The worst thing that happens when your CPU makes an error in a game is that the game crashes (or corrupts your save file), getting the wrong result on some computations on the other hand.. – Voo Dec 20 '14 at 21:54
  • @Voo Wouldn't you check your results anyway for important computations? Heat may degrade components but not necessarily faster than other system components already degrade. Anecdotally I have not yet had a CPU die and I tend to keep mine for a long time. – Mr.Wizard Dec 22 '14 at 03:24
  • What "BenchmarkResut" did you get without overclocking? – Karsten7 Dec 22 '14 at 06:39
  • I'm just having my hands on a PC based on the newest intel platform (X99 Mainboard, i7-5820K CPU, 8 GB DDR4 RAM) and I'm getting a "BenchmarkResut" of 1.99. Clock speed really seems to trump architecture. – Karsten7 Dec 22 '14 at 06:58
  • @Karsten7. After all it is only a benchmark. Usually I don't overclock my computer because I can very often improve performance with compiling, parallelization or reformulating of problems. With those improvements you often gain some magnitudes of speed and not only very small fractions. – halirutan Dec 22 '14 at 11:18
  • @Mr.Wizard Sure you may have the same problems without overclocking too, but the chances for it are greatly reduced. Sure you may get a CPU that will run perfectly fine at the higher clock speed for years but you could also get a CPU that was binned for a good reason. Overclocking is a very well known source of problems - dying is the least of my worries, that's obvious and easy to debug. Now if you do run a several hour long stress test at the end of your project and throw your data away if it fails - no problems then. – Voo Dec 22 '14 at 13:17
  • @Voo CPUs are not tested that thoroughly, and a cosmic ray could come along at any time... overclocking does cause problems, usually when done carelessly, with insufficient cooling, or without sufficient testing. If you have a formal proof of the correctness of your program, operating system, etc., (yeah right!), then it is time to run it multiple times on independent and dissimilar hardware to test consistency of the results. This is a little bit flippant, but verifying correctness is a hard (and important) problem. Not overclocking (with due care) is a fairly minor consideration. – Oleksandr R. Apr 27 '15 at 02:49
  • @YvesKlett years ago, I converted a GeForce2 Ultra to a Quadro2 Pro. Then it was just a driver distinction, but now, the hardware is different (but not necessarily "better"). Nowadays, these cards are becoming so power- and space-constrained, that it is not economical to make the all-singing, all-dancing card and sell it off with features disabled at a lower price. They stratify the cards within a single market this way, but normally the reason for it is big dies, low yields, and many resulting partially working GPUs. Full-speed DP CUDA requires hardware that is absent from the gaming cards. – Oleksandr R. Apr 27 '15 at 03:00
  • @OleksandrR. thanks for the information! In fact, my GTX just died on me, so I am kind of flirting with a Quadro solution. – Yves Klett Apr 27 '15 at 09:27
  • @YvesKlett well, be careful, would be my advice; for the smaller and cheaper chips, the dies are indeed the same between the GeForce and Quadro lines. In these cases the benefit comes from a few specialized units that are fused out in the consumer line, plus the driver, which is heavily optimized for particular software in collaboration with the software vendors. (And this is still a large fraction of what you pay for.) Quadro is no better for CUDA than GeForce, because the DP compute cores require a lot of space and power that is not justified in either product. The main difference is that... – Oleksandr R. Apr 27 '15 at 11:44
  • ...in GeForce, the driver is optimized for speed in games at all costs, to the point of sacrificing rendering accuracy if it is not that noticeable. Quadro takes the opposite approach, but they also try to optimize its driver for fewer different applications, and they strictly test and guarantee the results. That this costs money is fair enough, because it's a lot of work, and good hardware is useless without solid drivers (ask any ATI user...). If you don't use one of the applications for which optimizations have been made, I don't think you'll see much/any benefit from using a Quadro... – Oleksandr R. Apr 27 '15 at 12:01
  • ... and in fact it may even be worse, because they can fuse out texture units and other hardware that is needed for games but not for professional applications to make room in the power budget for higher clocks, or a 100% yield on CUDA cores, or other things. AFAIK, Mathematica doesn't use any features for which Quadro is better, so I would be doubtful that it is worth the money unless you have other applications in mind as well. Definitely try before you buy, if possible. – Oleksandr R. Apr 27 '15 at 12:01
  • @OleksandrR. sure, CATIA and similar are on the table as well. Thanks for the advice in any case! – Yves Klett Apr 27 '15 at 12:21
22

Mathematica comes with benchmarking tools to help you with this problem. For example, the code below gives me a report...

Needs["Benchmarking`"]
BenchmarkReport[]

enter image description here

...which is helpful in justifying why I am asking for a new computer for Christmas.

bobthechemist
  • 19,693
  • 4
  • 52
  • 138
  • Never knew that. I just did a benchmark for my own system. I have been wanting a new laptop for a long time. But I am a poor student. Most of the time, I just use the server from my university. – Chen Stats Yu Dec 20 '14 at 02:19
  • So does this mean that Mathematica runs the fastest on Linux? My report also shows Linux at the top, followed by OS X, and then followed by Windows. – Shredderroy Dec 20 '14 at 03:05
  • 3
    @Shredderroy No, in fact Linux people seem to have a lot more problems with Mathematica than users of either OS X or Windows. As you can see the hardware is different; they just happened to have Linux with that hardware. Focus on the hardware. (+1 for this answer, I didn't know about this either.) – C. E. Dec 20 '14 at 03:13
  • 1
    (-1) This fails on my machine: Negative values not allowed Any ideas? – Dr. belisarius Dec 20 '14 at 05:48
  • get a mac for Mathematica. many at WRI use mac's not PC's. I think due to origin of how Mathematica was created, it is apple first, windows second, and then Linux 5th. – Nasser Dec 20 '14 at 06:56
  • 1
    @belisarius while Mr.Wizard and Halirutan battle it out for biggest CPU on the block, we can fight for the low end. I ran the full benchmark on the RPi once, and it takes about 60 minutes. – bobthechemist Dec 20 '14 at 14:51
  • @bobthechemist I don't have the "biggest CPU on the block" and that was actually my point: I would prioritize raw clock speed over newer architecture. For a while CPU's were actually getting slower from a clock perspective. Although Intel started locking their CPU multipliers on non-K chips, forcing me to get a more expensive CPU that I wanted to, I used to get good results by overclocking a budget CPU. – Mr.Wizard Dec 20 '14 at 21:56
  • @bobthechemist As a point halirutan's 2700K was released Q4 2011 and retailed for $332 whereas my 2500K was released in Q1 2011 for $216. At the same clock my CPU gets about 2.06 where his gets 2.33 in the benchmark. I assert that one would get a faster reward by putting extra money into a better cooler for the cheaper chip and pushing it further. – Mr.Wizard Dec 20 '14 at 22:08
  • @Mr.Wizard I get your point. I limit myself to AMD chips due primarily to price, and I don't see any AMD chips on the standard benchmark tool. Since AMD chips are typically considered lower performing relative to similar speed Intel chips, I wonder if they would show better performance vs. price metrics. – bobthechemist Dec 21 '14 at 04:36
12

I have found that Mathematica responds most to raw CPU clock speed. More functions are parallelized in recent versions but my non-hyperthreading i5-2500K CPU (released Q1 2011) still seems to outperform many newer and more expensive units because of the clock. I usually run at 4.6GHz for quiet stability but with the fan and voltage cranked up I can run at 4.8GHz as I did for this benchmark:

enter image description here

(I get 2.06 in the 4.6GHz configuration.)

After that I would rate RAM as important as Mathematica can easily consume a lot but that is probably more specific to the kind of data and problems one works on.

Mr.Wizard
  • 271,378
  • 34
  • 587
  • 1,371
  • The clock speed relationship seems to be consistent with what I found on the RPi as well, (obviously, the effect is a relative one). – bobthechemist Dec 20 '14 at 14:41
  • The performances of Mr.Wizard's or Halituran's machines are difficult to beat. Just for comparison, I use a 13" Retina Macbook Pro (type Late 2013) with 2.8 GHZ Intel Core i7 CPU (2 cores, 4 hyperthreads) and 16 GB SSD. The Mathematica 10.0.2 Benchmark[] yields a performance of 1.426 . – Romke Bontekoe Dec 21 '14 at 11:59
  • 4.8GHz is a very large overclock, and the maximum case temperature for this product is rather low at only 72°C. Are you using water cooling? It's interesting that Intel is not going to use the on-die voltage regulator in future products. It was a valiant attempt (150MHz switching regulator is surely not easy to get working!), but apparently did not deliver the benefits hoped for. Presumably this will mean that the power density in Skylake will be somewhat lower. I also heard that Intel is moving toward permanently soldered processors, which may not be a bad thing, IMO. – Oleksandr R. Apr 27 '15 at 12:25
  • @Oleksandr I haven't looked at the state of affairs since 2011 and perhaps it has had a resurgence but water cooling fell out of favor with the introduction of heat pipe coolers for all but special applications. The 2500K is only a 95W TDP chip which is no more than e.g. the earlier Kentsfield chips that could also be overclocked with fan-on-heat-pipe coolers. My 4.6GHz clock can be achieved quietly; I could probably drive the chip to 4.9-5.0GHz on air with higher speed fans if I did not mind it sounding like a hairdryer as other people have done that. (continued) – Mr.Wizard Apr 27 '15 at 18:37
  • @Oleksandr I expect that the top full-time overclocks are still achieved with a phase change system (refrigeration compressor) but I wouldn't want the cost or complexity. I'll have to read about the permanently soldered processors. – Mr.Wizard Apr 27 '15 at 18:39
  • Well, it's 95W at 3.3GHz and 1.2V. If you run it at 4.8GHz and 1.3V then that's roughly 160W, which is a lot to dissipate and maintain a case temperature of 72.6°C. The thermal interface + heatsink needs to have a thermal resistance of at most 0.3°C/W if your room temperature is 20°C, which seems like pushing it a bit? And TDP is only an average anyway; peak thermal power is higher. What kind of die temperature do you achieve? – Oleksandr R. Apr 27 '15 at 19:43
  • @Oleksandr Interesting analysis; I've never actually attempted to calculate the thermal transfer properties. It's been so long since I first played with OC'ing this CPU that I cannot recall the numbers you ask for. I also can't test 4.8GHz now as I have only one 12cm fan operating, whereas I had two on the heat sink and one on the case before. (continued) – Mr.Wizard Apr 29 '15 at 02:57
  • Lessening the stress I am also not running a fixed 4.6GHz overclock but letting the CPU down-clock to 4.1GHz when all four cores are in use. (I cannot recall what that feature is called.) Since most of the time I am only running one or two and it can sustain a 46 multiplier in that circumstance this is optimal for me. I am embarrassed to say I cannot recall what tool I need to run to monitor core temps but I started a Prime95 stress test a little while ago, so when I figure it out I can report current thermal behavior. (It might have changed in the last four years.) – Mr.Wizard Apr 29 '15 at 02:59
  • @Oleksandr A brief 30 minute stress test puts the hotter cores at 80-82°C Tjunction as reported by Real Temp. This is less that the 100°C TJ max that the tool also reports, but a bit hotter than I think I recall this running before. This is a far cry from a 24-hour burn test but no errors were reported and I haven't noticed stability problems so it seems the CPU hasn't degraded. Nevertheless I should probably give everything a good cleaning and replace/add a fan or two. If I remember to get that done I'll do a proper 24-hour burn and let you know how it goes. – Mr.Wizard Apr 29 '15 at 03:22
  • Interesting. 82°C junction temperature is nothing to be concerned about, in my opinion; I had expected it would be closer to 95°C. What sort of stress testing software do you use? Part of the problem, I think, is that hardly anything can actually produce the maximum thermal power, so one always tests under less than peak load. The exception would be something like Intel's LINPACK tests, as they're optimized to hell and back for absolutely maximal FLOPS. You can use the LinX shell along with ... – Oleksandr R. Apr 29 '15 at 22:04
  • the executables from Intel's latest LINPACK build. This is still not necessarily a peak load as it solves a large linear system rather than just doing useless operations in a tight loop, but it is as close as any real workload will come and is self-verifying at least to some extent. It is important to choose a large enough problem size, however; I'd suggest half of your installed memory as a minimum. – Oleksandr R. Apr 29 '15 at 22:10
  • @Oleksandr As stated above I am using Prime95; I used four processes since the 2500K is not "hyperthreading" enabled. If/when I clean the case and add a fan (right now there isn't even a dedicated exhaust fan on the case; air from the HSF is merely directed toward a vent) I'll also try a LINPACK test, but for the very reason you mention I don't personally consider this necessary; if it takes special tools to achieve this load I don't expect to encounter it in normal use. – Mr.Wizard Apr 30 '15 at 02:13
8

I have been using Mathematica on a Mac since late 2006 and have enjoyed the experience. Recently, I had my older Macbook Pro (mid 2009 model) replaced due to graphics card failure. Mathematica ran perfectly fine on the older hardware. I now have a 15" Macbook Pro with Intel Core i7, 2.8 GHz, 16 Gb RAM running Yosemite. I also have a NVIDIA GeForce GT 750M graphics card, because I use the Mathematica GPU capabilities quite a lot. I must say I like the performance on the new system.

These are my benchmark results... enter image description here

Based on a comment made by @Mr.Wizard, I ran the benchmarks three more times using a single kernel and got the same result each time (2.22). I may not be answering @Mr.Wizard's question directly, because I will need to generate code to run tests for shorter durations and limited threads counts.

So, I am sticking with the internal Mathematica benchmark routines. I ran the tests using more kernels to take advantage of the intrinsic parallelization of Mathematica. This most likely is not a good Apple to Apple comparison to the other systems listed...

Results using two kernels (LaunchKernels[2] prior to running the BenchmarkReport[]). I got the following results (2.87): enter image description here

To follow up I ran the same benchmarks using 4 kernels ( LaunchKernels[4] ). The results are (4.51): enter image description here

Joseph
  • 1,306
  • 11
  • 19
  • 1
    BTW, nice gravatar! – Yves Klett Dec 24 '14 at 16:41
  • That high a benchmark from only 2.8GHz surprises me! Does this chip actually run higher than that under short loads or with a limited number of threads? – Mr.Wizard Dec 24 '14 at 20:13
  • Thank you @YvesKlett, I found it somewhere from some post or example using the ListPointPlot3D. Seemed good for the MMA SE. ListPointPlot3D[ Table[Table[(4 Pi - t) {Cos[t + s Pi/2], Sin[t + s Pi/2], 0} + {0, 0, 2 t}, {t, 0, 4 Pi, .01}], {s, 4}], Filling -> Bottom, ColorFunction -> Function[{x, y, z}, Hue[z]], BoxRatios -> Automatic, FillingStyle -> Directive[LightGreen, Thick, Opacity[.1]], Axes -> None, Boxed -> False] – Joseph Dec 24 '14 at 20:14
  • @Mr.Wizard I am not certain, I will check it out and report back. – Joseph Dec 24 '14 at 20:17
  • @Mr.Wizard: By 2.8GHz I think Joseph means i7 4900MQ. It can turbo boost up to 3.8GHz. My 4800MQ get similar results and I know it boosts to highest frequency (3.7GHz for me) under full load. Whether and how long the CPU can stay at highest frequency depends on the heat dissipation of the laptop. – Yi Wang Dec 24 '14 at 22:30