[RFC]: DLPack C Function for Speed Exchange

未关闭
#973 2 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
c, python
领域
api, performance

调研方向

首先阅读链接的 DLPack issue 175 以及当前的 DLPack 交换上下文。定义提议的字段 mypackage.Tensor.__dlpack_c_exchange_api__ 应如何针对数组库进行标准化,包括它与现有 Python 交换机制及回退行为之间的关系;当 RFC 形成了经一致同意的规范时,这项工作即告完成。

由索引模型根据 Issue 内容生成。

描述

API extension Needs Discussion RFC topic: Device Handling topic: DLPack

This is a cross ref RFC on DLPack based exchange. As of now, DLPack exchange relies on python functions such as tensor.__dlpack__(). While they works well for common cases, the general overhead of such exchange is at the level of 0.2-0.3 us for very well optimized version, and can go up to 0.4-1 us for less optimized implementation.

For a function that takes three arguments f(a, b, c), assume we run DLPack exchange for each argument, the general conversion overhead usually gets to around 0.7us - 3us.

While such overhead can be acceptable in many settings, in GPU applications the extra 1-3us overhead can still be significant. For a kernel that takes 2us to finish, 0.7 us means 30% additional overhead in execution

Recently, we propose to develop a set of specific C functions to help DLPack based exchange for array libraries that works on C extensions, please see more context here

https://github.com/dmlc/dlpack/issues/175

In the context of array-api, it would be useful to help standardize the specific field for such speed exchange

  • mypackage.Tensor.__dlpack_c_exchange_api__

Note that the proposed speed exchange function can be used in conjunction with the current DLPack exchange, to gracefully handle fallback cases.

主要语言
Python
星标
281
派生
52
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

data-apis/array-api 的其他 Issue

查看 data-apis/array-api 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。