In order for an ndarray system to interact with a variety of frameworks, a stable in-memory data structure is needed.
DLPack is one such data structure that allows exchange between major frameworks. It is developed with inputs from many deep learning system core developers. Highlights include:
- Minimum and stable: simple header
- The spec has stayed roughly unchanged for more than four years.
- Designed for cross hardware: CPU, CUDA, OpenCL, Vulkan, ROCm, Hexagon
- Already a "standard" with wide community adoption and support, ones that I am aware of:
- Frameworks, tensorflow/jax, pytorch, mxnet
- Libraries: dgl, spaCy etc.
- Compilers: TVM
- Clean C ABI compatible
- Means you can create and access it from any language
- It is also essential for building JIT and AOT compilers to support these data types.
- High performance consideration
- Data field mandatory aligns to 256 bytes(for aligned load), allow byte_offset to offset the array if necessary
The main design rationale of DLPack is the minimalism. DLPack drops the consideration of allocator, device API and focus on the minimum data structure. While still considering the need for cross hardware support(e.g. the data field is opaque for platforms that does not support normal addressing).
It also simplifies some of the design to remove legacy issues(e.g. everything assumes to be row major, strides can be used to support other case, and avoid the complexity to consider more layouts)
After building the frameworks around the related data structures for a while, and see ecosystem grows around it, I am quite convinced that DLPack should be one important candidate, if not the best one for the C ABI array data structure.
Given that array exchange is one goal of the consortium, it would be great to see if dlpack can be used as the stable C ABI structure for array exchange.
If the proposal receives positive response from the community. We would be more than happy to explore options to build a neutral, open governance(e.g. like the apache model) that continues to oversees the evolution of the spec -- for example, donate the dlpack to the data-api consortium or host it in a clean github org.