Hot answers tagged

37

I'll try to summarize my experiences obtained in the course of developing ViennaCL, where we have CUDA and OpenCL backends with mostly 1:1 translations of a lot of compute kernels. From your question I'll also assume that we are mostly taking about GPUs here. Performance Portability. First of all, there is no such thing as performance-portable kernels in ...


18

The simple example from electromagnetics (EM) would be performing a parallel frequency sweep for a frequency-domain simulation, say, full-wave extraction of network parameters (S, Y, Z, etc) for a device. Since the simulation for each frequency point is highly independent from another, the simulation can be embarrassingly parallelized across different cores, ...


14

DifferentialEquations.jl library is a library for a high level language (Julia) which has tools for automatically transforming the ODE system to an optimized version for parallel solution on GPUs. There are two forms of parallelism that can be employed: array-based parallelism for large ODE systems and parameter parallelism for parameter studies on ...


13

tl;dr: My general impression from the literature is that speedups are modest (if they exist). The main kernel you'll see in these methods is a sparse-direct method (e.g., sparse LU, sparse LDLT), and memory accesses are irregular; these characteristics don't favor use of GPUs. Also, parallel IPMs are in their infancy. I still suspect people will work on GPU ...


12

Ultimately, naive brute-force KNN is an $O(n^2)$ algorithm, while kd-tree is $O(n \log n)$, so at least in theory, kd-tree will eventually win out for a large enough $n$. In practice, the leading constants for a GPU implementation may be vastly different --- we may be comparing $0.0001n^2$ vs $1000n\log n$ --- so it may indeed be the case that the former ...


11

High-quality video encoding is something like this. The search space is so huge that it requires branching to prune it rapidly, but GPUs are terrible at that. Modern CPU short-vector SIMD works well for this, working on contiguous chunks of 16 to 64 bytes of data. And while still being tightly coupled to the CPU core which can branch efficiently on SIMD ...


9

What am I missing here? Most of the broader issues with your proposal are covered in What are the current obstacles to reaching exascale computing?. I think the cost and power analysis you've done is a lower bound at best: you've calculated the cost it would take to buy 100,000 GPUs, and you can't run anything on a GPU that isn't plugged into anything. ...


9

In broad terms, algorithms that run faster on the GPU are ones where you are doing the same type of instruction on many different data points. An easy example to illustrate this is with matrix multiplication. Suppose we are doing the matrix computation $A \times B = C$ A simple CPU algorithm might look something like //starting with C = 0 for (...


9

One issue that you should be aware of is that NVIDIA has a market segmentation strategy in which it sells relatively inexpensive GPU's to the gaming and graphics workstation markets (GeForce and Quadro) and different higher-priced models (Tesla) to the high-performance computing market. The GPU's sold for use in gaming and graphics have limited double-...


9

GPUs work with the model SIMD (single instruction multiple data) i.e. they execute an instruction over multiple data. To give an idea: under CUDA technology when you have got an if-then-else condition the two branches are executed in sequence over the respective data. In your question, the condition to favor a CPU suggests a MISD or MIMD model, i.e. ...


8

For [CU]BLAS, there is a wrapper called 'thunking' in the CUDA toolkit (src/fortran_thunking.{c,h}) that takes pointers from CPU memory and does all the GPU allocation/copying for you. You can plug it into your code with a preprocessor statements like #define ZGEMV CUBLAS_ZGEMV #define ZGEMM CUBLAS_ZGEMM ... For LAPACK, Magma has CPU-side interfaces for ...


8

This may have gone unnoticed in the comments under the original question, but computing $10^9!$ yields a number with 8.5 billion digits, that is it is on the order of $10^{9\cdot 10^9}$. Given that $10^{9\cdot 10^9}=1000^{3\cdot 10^9} \approx 1024^{3\cdot 10^9}=(2^{10})^{3\cdot 10^9}=2^{3\cdot 10^{10}}$, you need approximately $3\cdot 10^{10}$ bits, or ...


7

In addition to Geoff's great points: Single versus double precision The Radeon's quoted performance is single precision, but HPC benchmarks generally measure double precision (including the Tianhe-2 number). The Radeon has poor double precision performance, but if you buy a card focusing on double precision, expect to take at least a factor of 3 hit on ...


7

Several points I want to mention (with an encouragement to other CompSci users that are more familiar with Java specifics to give additional, more Java related answers): The solution of a system of linear equations and inversion of the matrix are two very different things. You almost never should explicitly invert the matrix. One should use one form of the ...


7

You can calculate GFLOP rates this way, but the numbers are pretty meaningless on today's hardware: Floating point operations require a variable number of clock cycles. An addition is generally cheaper than a multiplication, but each generally takes more than one clock cycle of the 2.8 billion cycles you quite. When you have hyperthreading, you have two ...


6

You may want to look into Boost's odeint library and Thrust. They can be combined as discussed here.


6

GPUs are sensitive beasts. Although Nvidia's beefiest card can theoretically execute any of the operations you listed 100x faster than the fastest CPU, about a million things can get in the way of that speedup. Every part of the relevant algorithm, and of the program which runs it, has to be extensively tweaked and optimized in order to get anywhere near ...


6

A 100,0000 by 100,000 symmetric dense matrix in single precision requires 20 gigabytes of memory (storing only the upper triangle) or 40 gigabytes of memory for double precision. Thus it is too large to fit within the memory of available GPU's. In order to solve this problem using GPU acceleration you'd have to develop an algorithm that sends smaller ...


6

In general, the AMD line of GPUs are faster for integer based calculations, whereas NVIDIA are faster for floating point. NVIDIA also has CUDA (like Godric mentioned) which is a bit easier to work with, and has a very good library support, including cuBLAS, cuFFT and Thrust which make many things far easier to code. CUDA is not itself faster than OpenCL, ...


6

CUDA is a non-trivial advantage for NVIDIA. Most of the benchmarks I have seen (ViennaCL Benchmarks for reference) show that CUDA does better than OpenCL by up to an order of magnitude. At the large problem sizes, the two are fairly comparable. Also, NVIDIA has the advantage that no matter whether you end up using OpenCL or CUDA, you can very quickly ...


6

There are plenty of finite element libraries out there that satisfy most of your criteria. In no particular order, I would mention deal.II (my own project), libMesh, and FEniCS. All three are large, are libraries, are well documented, are well established with large user bases. All three are actively maintained and are about as fast as you would a general ...


6

Normally when you invert a sparse matrix the inverse is dense. This imply to have enough memory to store the inverse, in your case the matrix is not so big for nowdays computers. In double precision (1 cell = 8 byte) you have $$ 31000 \times 31000 \times 8 \text{ byte } = 61504000000 \text{ byte } \approx 7.7 \text{ Gygabyte } $$ Another problem is the ...


6

When it comes to playing chess and other complex turn-based games using the MiniMax algorithm, then GPU acceleration is either not viable or only viable for a couple minor sub-problems. Chess engines need to evaluate a very large number of moves to find out which one results in a position which is best for the AI. How does the AI know that one position is ...


5

Short answer: No. You have a number of options here. For your NVIDIA GPU, you will get the best performance by switching to CUDA, rather than OpenCL. You can also upgrade your card, to something like the Geforce Titan, which significanty outperforms the Quadro card for GPU computation. My personal opinion is that CUDA is much nicer to work with, has ...


5

I suppose, you right and your network is not that big to 100%-utilize the GPU. The bottle-neck here seems to be not the GPU itself, but the transfer rate between RAM and VRAM and here the difference between 750 Ti and 780 Ti is not that significant. You can try to improve the training speed by hiding the latency of memory transfer - you have to assure you ...


4

Old question, but I think that this answer from 2014 - related to statistical methods, but generalisable for anyone who knows what a loop is - is particularly illustrative and informative.


4

Karl Rupp, who writes ViennaCL (http://viennacl.sourceforge.net/) and is on Computational Sci StackEx, might be able to chime in here - their library has multiple matrix decompositions including SVD, LU, eigendecomp, etc. It's also a header-only library, and should play well with C++ (not sure about C) code. An example of it in use with LU factorizations - ...


4

While the Kepler card has more cores, the Maxwell ones run at a higher clock speed. This review actually compares the two, although mainly for gaming purposes, and the Maxwell has the Kepler beat in almost all cases. The margins are relatively small however. Looking at the numbers, I would hazard the guess that the Maxwell card will perform better for your ...


4

Those are both marketing words. Either ask NVIDIA what they mean by them, or ignore them. NVIDIA appears to be using them to classify different product lines, at either different cost levels or different levels of parallelism. You can almost certainly ignore these marketing terms safely. They have no definite meaning to me.


4

I assume, that you have a code that works on a standard CPU. I am not particularly familiar with MQL and Metatrader, but I don't think the answer will be different. For compilable languages, the compiler creates an executable that is tailored to use the computational resources available to it for a given architecture (or many architectures). CPUs and GPUs ...


Only top voted, non community-wiki answers of a minimum length are eligible