SciDAC abstract / cl.egans

2 views
Skip to first unread message

Cyrus Omar

unread,
Jun 11, 2010, 6:26:17 PM6/11/10
to ahh-d...@googlegroups.com, hpc-neuro
Hello folks,

My abstract for the SciDAC conference is below, for reference.

The (spiking circuit) simulation package, called cl.egans (get it?), is progressing nicely. I have working spiking networks now atop cl.oquence at about the level my previous hackyish CUDA code was and just need to cross some i's and dot some t's (or is it the other way around?) before building some models using it, running benchmarks, putting in an MPI layer, implementing STDP, and whatnot.

--
cl.oquence: Embedding an annotation-free statically-typed language targeting OpenCL into Python

Dynamic languages such as MATAB and Python have emerged as workhorses of science largely because they eliminate type annotations. This is accomplished through the use of a dynamic type system, but entails sometimes severe computational costs. Statically-typed languages like OpenCL, on the other hand, produce fast code by forcing the user to settle on a particular type for all variables explicitly, which introduces verbosity and prevents the user from writing type-generic code. Approaches such as template metaprogramming, source code generation and native code interoperability from these dynamic languages can alleviate the latter issue at the expense of additional verbosity and often unacceptable complexity when integrating with dynamic code.

I will demonstrate an alternative approach, whereby a statically typed language, cl.oquence, is directly embedded as a library within a dynamically typed language, Python. By employing automatic type inference, cl.oquence does not require explicit type annotations, and thus all functions are implicitly generic. The generic code is typed and compiled to OpenCL source code just-in-time, with caching. cl.oquence statements map essentially one-to-one onto OpenCL statements and cl.oquence uses Python's own parser, so its syntax and semantics are both familiar and clean. Because of the close mapping between the cl.oquence and OpenCL semantics, cl.oquence code will run precisely as fast as OpenCL code after the short additional JIT compilation phase, which need only be run once. In addition, cl.oquence adds support for higher-order functions at compile-time, enabling programming in a more functional style should the user choose.

cl.oquence comes with a set of convenience functions which build upon the low-level PyOpenCL package. These simplify tasks such as OpenCL context creation and memory transfer to and from OpenCL devices, integrating better with numpy. A growing library of data analysis functions built atop cl.oquence, called cl.ements, and a simulation framework currently focused on neurobiological circuit simulations, cl.egans, are also distributed with cl.oquence and serve as demonstrations of its expressive power and speed.

cl.oquence and its companion libraries are licensed under the open source LGPLv3 license and are well-documented and developed openly within the atomic-hedgehog project at http://ahh.bitbucket.org/. The project is looking for contributors to provide feedback, contribute analysis codes or take on larger tasks such as CUDA and C backends or automatic source code transformations.
Reply all
Reply to author
Forward
0 new messages