![]() ![]() What I am trying to do is obviously squeeze every single cycle out of the GPU for compute purposes. Sometimes application just crashes for no reason at all. At this time, I settled (through trial and error) on 1024 threads and 64 blocks but it gives me ~95% execution success. I use 780Ti for development work (CUDA 3.5 capable) and have been looking for any indication on how to select optimum values for the block size and thread count for my application. I followed a relatively detailed table collecting information on individual CUDA-enabled GPUs available at: CUDA - Wikipedia (mid-page). I actually had a very similar issue / question. Such classes/presentations can be readily found by searching on e.g. efficient use of the memory subsystem(s).Choosing enough threads to saturate the machine and give the machine the best chance to hide latency.Due to warp granularity, it’s always recommended to choose a size that is a multiple of 32, and powers-of-2 threadblock size choices are also pretty common, but not necessary.Ī good basic sequence of CUDA courses would follow a CUDA 101 type class, which will familiarize with CUDA syntax, followed by an “optimization” class, which will teach the first 2 most important optimization objectives: Usually there are not huge differences in performance for a code between, say, a choice of 128 threads per block and a choice of 256 threads per block. ![]() Threadblock size choices in the range of 128 - 512 are less likely to run into the aforementioned issues. registers per thread usage, or shared memory usage) which prevent 2 threadblocks (in this example of 1024 threads per block) from being resident on a SM Very large block sizes for example 1024 threads per block, may also limit performance, if there are resource limits (e.g. 32 threads per block) may limit performance due to occupancy. And its not desirable to burden the HW design with maintaining state for 64 blocks when 16 blocks will suffice for nearly all purposes - simply make sure to choose at least 128 threads per block for your code, if this aspect of performance/occupancy is an issue. Therefore it’s not possible to create a HW design that supports an infinite number of open blocks per SM. Each open block requires a certain amount of “state” to be maintained for it. a low level of achieved occupancy) might be a factor to consider in the performance of your code. OTOH a really low level of active warps, say less than 32, or less than 16, may be a strong indicator that occupancy (i.e. However, this does not mean necessarily that your code is somehow deficient if you do not have 64 active warps. You want to have as close to 64 active warps as possible, all other factors being equal. The only thing that really matters for occupancy and if performance depends on occupancy is warps.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |