Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.025 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'subject:Python': 0.06; 'arrays': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'behave': 0.16; 'integers.': 0.16; 'pointers.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'vectors': 0.16; 'vertex': 0.16; 'language': 0.16; 'wrote:': 0.18; 'thu,': 0.19; '(the': 0.22; 'header:User-Agent:1': 0.23; 'references': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In- Reply-To:1': 0.27; 'idea': 0.28; 'point': 0.28; 'array': 0.29; 'work.': 0.31; 'there.': 0.32; 'regular': 0.32; 'limitation': 0.33; 'computing': 0.35; 'but': 0.35; 'science,': 0.36; 'subject:?': 0.36; 'should': 0.36; 'jason': 0.38; 'to:addr:python- list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'great': 0.65; 'charset:windows-1252': 0.65; 'biggest': 0.67; 'acts': 0.74; 'manner.': 0.74; 'comparable': 0.84; 'cpu.': 0.84; 'fragment': 0.84; 'gpgpu': 0.84; 'laid': 0.84; 'mistake': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Sturla Molden Subject: Re: Parallelization of Python on GPU? Date: Thu, 26 Feb 2015 22:10:42 +0100 References: <82642f3a-49e8-4982-b135-66ffc04d67d9@googlegroups.com> <54ee8ce2$0$11109$c3e8da3@news.astraweb.com> <1424963166.30927.73.camel@gmail.com> <1915907417446661989.682673sturla.molden-gmail.com@news.gmane.org> <1424972883.30927.138.camel@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 50-72-11.connect.netcom.no User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 In-Reply-To: <1424972883.30927.138.camel@gmail.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 32 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1424985028 news.xs4all.nl 2944 [2001:888:2000:d::a6]:37377 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:86545 On 26/02/15 18:48, Jason Swails wrote: > On Thu, 2015-02-26 at 16:53 +0000, Sturla Molden wrote: >> GPU computing is great if you have the following: >> >> 1. Your data structures are arrays floating point numbers. > > It actually works equally great, if not better, for integers. Right, but not complicated data structures with a lot of references or pointers. It requires data are laid out in regular arrays, and then it acts on these arrays in a data-parallel manner. It is designed to process vertices in parallel for computer graphics, and that is a limitation which is always there. It is not a CPU with 1024 cores. It is a "floating point monster" which can process 1024 vectors in parallel. You write a tiny kernel in a C-like language (CUDA, OpenCL) to process one vector, and then it will apply the kernel to all the vectors in an array of vectors. It is very comparable to how GLSL and Direct3D vertex and fragment shaders work. (The reason for which should be obvious.) The GPU is actually great for a lot of things in science, but it is not a CPU. The biggest mistake in the GPGPU hype is the idea that the GPU will behave like a CPU with many cores. Sturla