The language-integrated cost semantics for nested data parallelism pioneered by NESL provides an intuitive, high-level model for predicting performance and scalability of parallel algorithms with reasonable accuracy. However, this predictability, obtained through a uniform, parallelism-flattening execution strategy, comes at the price of potentially prohibitive space usage in the common case of computations with an excess of available parallelism, such as dense-matrix multiplication.
We present a simple nested data-parallel functional language and associated cost semantics that retains NESL's intuitive work--depth model for time complexity, but also allows highly parallel computations to be expressed in a space-efficient way, in the sense that memory usage on a single (or a few) processors is of the same order as for a sequential formulation of the algorithm, and in general scales smoothly with the actually realized degree of parallelism, not the potential parallelism.
The refined semantics is based on distinguishing formally between fully materialized (i.e., explicitly allocated in memory all at once) "vectors" and potentially ephemeral "sequences" of values, with the latter being bulk-processable in a streaming fashion. This semantics is directly compatible with previously proposed piecewise execution models for nested data parallelism, but allows the expected space usage to be reasoned about directly at the source-language level.
The language definition and implementation are still very much work in progress, but we do present some preliminary examples and timings, suggesting that the streaming model has practical potential.
[1]
Manuel M. T. Chakravarty,et al.
Accelerating Haskell array codes with multicore GPUs
,
2011,
DAMP '11.
[2]
Simon L. Peyton Jones,et al.
Work efficient higher-order vectorisation
,
2012,
ICFP '12.
[3]
Thomas J. Sheffler,et al.
Implementing the multiprefix operation on parallel and vector computers
,
1993,
SPAA '93.
[4]
Guy E. Blelloch,et al.
Implementation of a portable nested data-parallel language
,
1993,
PPOPP '93.
[5]
Lars Bergstrom,et al.
Nested data-parallelism on the gpu
,
2012,
ICFP 2012.
[6]
Sven-Bodo Scholz,et al.
Single Assignment C: efficient support for high-level array operations in a functional setting
,
2003,
Journal of Functional Programming.
[7]
E BlellochGuy,et al.
Implementation of a portable nested data-parallel language
,
1993
.
[8]
Daniel W. Palmer,et al.
Work-efficient nested data-parallelism
,
1995,
Proceedings Frontiers '95. The Fifth Symposium on the Frontiers of Massively Parallel Computation.
[9]
Guy E. Blelloch,et al.
A provable time and space efficient implementation of NESL
,
1996,
ICFP '96.
[10]
Daniel W. Palmer,et al.
Piecewise Execution of Nested Data-Parallel Programs
,
1995,
LCPC.
[11]
Guy E. Blelloch,et al.
Space profiling for parallel functional programs
,
2008,
ICFP.
[12]
Guy E. Blelloch,et al.
NESL: A Nested Data-Parallel Language
,
1992
.
[13]
Frank Mueller,et al.
CuNesl: Compiling Nested Data-Parallel Languages for SIMT Architectures
,
2012,
2012 41st International Conference on Parallel Processing.