[FEA]: Support inheritance from Buffer

オープン 初心者向け
#2,435 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
62/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
python
領域
api

調査の方向性

まず cuda.core の Buffer 実装とその from_handle() および _reduce_helper() メソッドを見つけ、次に返されるインスタンスがどのように構築されるかを確認します。関連する issue #750 と Buffer の関連する動作を確認し、サブクラスが両方のメソッドを継承し、既存の Buffer の動作を壊すことなくサブクラスのインスタンスを受け取れば完了です。

索引モデルが issue の本文から書いたものです。

説明

cuda.core triage
Is this a duplicate?
Area

cuda.core

Is your feature request related to a problem? Please describe.

nvmath-python is considering creating a subclass of Buffer specific to NVSHMEM because we want to mostly follow cuda.core's semantics for Buffer/MemoryResource, but need some different behavior regarding garbage collection.

Describe the solution you'd like

Buffer should use classmethod instead of staticmethod for all methods that return an instance of the class. i.e. from_handle() and _reduce_helper()

Describe alternatives you've considered

Composing Buffer with our Buffer.
Replicating the Buffer protocol with an unrelated class.
Rolling our own MemoryResource/Buffer abstraction that is unique to nvmath's distributed APIs.

Additional context

Related to: https://github.com/NVIDIA/cuda-python/issues/750

主要言語
Cython
スター
3.4k
フォーク
329
平均マージ
1日 21時間
マージ済み PR(30日)
113

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NVIDIA/cuda-python のほかの issue

NVIDIA/cuda-python の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。