Upgrade to Pro — share decks privately, control downloads, hide ads and more …

DyND.pdf

Irwin Zaid
September 18, 2015
12k

 DyND.pdf

Irwin Zaid

September 18, 2015
Tweet

Transcript

  1. This Talk • Discussion at a high level – No

    implementation details • Code examples
  2. Principles of DyND • Store data in its native layout

    • Enable computation with generic patterns • Be a cross-language intermediary (C++, Python, R?, Julia?, JavaScript?, …)
  3. Types, Metadata, and Data • Types are instances of simple

    classes – Write a class, get a type • Types expose dynamic features to arrays – Either properties, like .real() or .imag(), or behavior, like .conj() • Types can be kinds, patterns, or constraints – Int, Scalar, Fixed, or Any; Fixed * T or (N * T, T) -> T; C[3 * 2 * float64] • Array metadata can describe data other than strided – Offset (tuple or struct), indirect (pointer), ragged (variable-sized dimensions) • Array data is poolable or allocatable in custom memory spaces – Variable-sized strings or dimensions; CUDA
  4. Callables and Functionals • Share functions alongside data – Callables

    are first-class objects that can be dynamically published • Enable user-defined functions with generic patterns – Functionals like apply, elwise, reduction, multidispatch, outer, neighborhood, and rolling transform one callable into another • Built-in callables are overloadable – Users can define +, -, *, /, … for custom types • Write once, retarget later – Capture LLVM IR from C++ at compile-time
  5. Just-in-Time and Ahead-of-Time • JITing happens automatically with Numba if

    it is importable – Previous examples of user-defined functions can then drop the return type, it will be deduced at runtime • AOT planned, it will work by specifying the argument types of user-defined functions