Add CUDA memory pool allocation function aliases for MUSA compatibility#61
Merged
yeahdongcn merged 4 commits intoMooreThreads:mainfrom May 7, 2026
Merged
Conversation
🤖 Augment PR SummarySummary: This PR improves CUDA-API compatibility on MUSA by exposing CUDA-named memory pool allocation helpers through torchada’s C++ extension. Changes:
Technical Notes: Injection happens after the extension is successfully built/loaded and marked as loaded, and is intended to make downstream CUDA memory pool API calls operate transparently on MUSA. 🤖 Was this summary useful? React with 👍 or 👎 |
0fb07bb to
28d1545
Compare
yeahdongcn
requested changes
May 7, 2026
…or MUSA compatibility
Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
yeahdongcn
approved these changes
May 7, 2026
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
_cuda_beginAllocateCurrentThreadToPool,_cuda_endAllocateToPool,_cuda_releasePool) in the C++ extension, backed by MUSA allocator APIs, to supportfrom torch.cuda.memory import ...usage on MUSA devices_musa_beginAllocateCurrentThreadToPoolto match CUDA semantics (instead of the stream-based fallback from_patch.py)torch.musa.memoryat C++ extension load time, so downstream code using CUDA memory pool APIs works transparently on MUSA