Zum Inhalt springen
Kitbay
Skill

cuda-streams

NOASSERTIONAktualisiert am 11. Nov. 2026105.390GitHub-Sterne

A contributor skill in the PyTorch repository about tensor lifetimes when a tensor is used on a CUDA stream other than the one that allocated it.

Was der Skill vermittelt

A contributor skill in the PyTorch repository about tensor lifetimes when a tensor is used on a CUDA stream other than the one that allocated it. Because PyTorch's caching allocator only reuses memory on the allocating stream, cross-stream use needs either an explicit sync back to that stream, which is predictable and preferred, or record_stream, which ties memory reuse to GPU progress and can raise memory use. The skill sorts cases into avoidable, unavoidable with the current API, worth a redesign and hard to avoid, and asks that every record_stream call carry a comment explaining why the free point cannot be controlled.

Funktionen

In der Dokumentation nicht angegeben