NVIDIA / NVIDIA/cuda-python

cuda.core: VirtualMemoryResource.deallocate() unmaps without ordering on the stream

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

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

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

説明

Summary

VirtualMemoryResource.deallocate() validates its stream argument and then calls cuMemUnmap at once. The VMM unmap does not synchronize, so work still in flight on the buffer accesses an unmapped range.

Buffer.close() documents stream-ordered deallocation, and the two synchronous resources (_SynchronousMemoryResource, LegacyPinnedMemoryResource) call stream.sync() before they free. VirtualMemoryResource is the only synchronous resource that skips this.

Suggested fix

Sync the stream before cuMemUnmap, as the siblings do. After #2880 the slow-path grow closes the old buffer through deallocate(), so a grow will sync once; that is the correct cost for a synchronous resource.

Refs: found while analyzing #2882.

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

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

はじめの一歩

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

調査の方向性

VirtualMemoryResource.deallocate() から始め、ストリームの検証と cuMemUnmap の処理を _SynchronousMemoryResource および LegacyPinnedMemoryResource と比較してください。次に、Buffer.close() のストリーム順序に関するドキュメントを確認し、解放時にアンマッピングの前にストリームが同期されること、また slow-path での拡張動作が引き続き正しいことを検証してください。

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

評価

技術スタック
python
領域
backend-api-design, performance
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
活発
明瞭さ
明確に書かれている
初心者へのやさしさ
76/100

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

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