You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ab907e0
Browse filesBrowse the repository at this point in the historyBrowse files
Move the CUDA allocator into extension/cuda so other delegates can share it (pytorch#23447)
Other CUDA delegates need ExecuTorch's allocator without compiling a
second copy of its singleton. This moves the allocator into the shared
CUDA extension and ships its public headers in the wheel.
The class lives in `executorch::extension::cuda`. The old namespace,
header and Buck target remain as compatibility aliases. CMake exports
the required C10 definition and supplies CUDA toolkit headers when a
toolkit is installed. The allocator header requires a CUDA development
toolkit; `CUDAToolkit_ROOT` can select it. The stream and device guard
headers remain usable without one.
Allocation and registration behavior are unchanged by the move: the CUDA
backend still registers the allocator, and linking only the extension
does not. Delegates share the async pool and its retention policy. A
cache trim can release unused blocks cached by another delegate, but
does not invalidate live allocations. The library initializes its
platform state before logging allocator errors. Buck no longer forces
the whole library into every binary: it has no static registrar, and its
one static initializer comes in with the allocator code that uses it.
The allocator accepts any power of two alignment. Requests above 256
bytes use checked padding and pointer rounding. Deallocation frees the
original pointer, and the move preserves this behavior.
Validation: built and ran five CUDA C++ suites on Linux x86_64 with H100
and CUDA 12.8. All 76 cases passed without skips, including 21 allocator
cases covering alignment, overflow, concurrency and the legacy alias.
Allocator memory checking reported no errors or leaks, with reporting
disabled for intentional invalid device API errors. Pinned formatting
checks passed. Added checks for required wheel headers and a CMake
allocator consumer.
Windows CUDA with MSVC and ROCm were not built or run. Those jobs skip
on fork pull requests. Buck linkage was not built; an executable
target-contract check is not a Buck build.
0 commit comments