Forgive me if I'm asking something that should be obvious, my experience is with software development, not computer science. I've glanced at some articles on hyperthreading and parallel processing, but it seems like those implementations are primarily for consumer devices to persist multiple apps at the same time (listen to a music app while browsing the internet) but for non consumer implementations where there is only one primary process, like a VM exclusively used for tensorflow, would there be any benefit to the VM having additional CPU's? There may be other OS processes going on with the VM, but the only way to calculate tensorflow faster would be to use a different hardware, like a GPU or a TPU, right?


As Wikipedia states,

The improvement in performance gained by the use of a multi-core processor depends very much on the software algorithms used and their implementation. In particular, possible gains are limited by the fraction of the software that can run in parallel simultaneously on multiple cores; this effect is described by Amdahl's law. In the best case, so-called embarrassingly parallel problems may realize speedup factors near the number of cores, or even more if the problem is split up enough to fit within each core's cache(s), avoiding use of much slower main-system memory. Most applications, however, are not accelerated so much unless programmers invest a prohibitive amount of effort in re-factoring the whole problem.

Whether you'll see an improvement when running a particular software application depends upon how that software application is built, and whether it can make use of threads to parallelize computation. Some can; others can't.

I don't know what the situation is for Tensorflow, but my impression is that Tensorflow tries to use your GPU if possible, because the GPU is far faster than the CPU at the kinds of tasks Tensorflow is designed for. And, if Tensorflow is using your GPU, then there's little or no benefit to having a multiple-core CPU or multiple threads.

Parallelization can be useful for some tasks. For instance, some video processing applications are designed to make use of multiple cores, so even if you're running only one application (the video editor application), it still runs faster with multiple cores than with a single core. It's not just for running multiple applications at the same time.

See also https://superuser.com/q/153833/93541, https://superuser.com/q/2489/93541, https://superuser.com/q/453799/93541, and https://superuser.com/q/949030/93541 for more background.

Hyperthreading is best ignored until you understand the fundamentals of multi-core procoessors and multi-threaded applications.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.