Skip to content

fix: generalize stable ABI extension porting for MUSA - #100

Merged
yeahdongcn merged 1 commit into
MooreThreads:mainfrom
xuezhaojiang:xzj/mapping
Aug 15, 2026
Merged

fix: generalize stable ABI extension porting for MUSA#100
yeahdongcn merged 1 commit into
MooreThreads:mainfrom
xuezhaojiang:xzj/mapping

Conversation

@xuezhaojiang

Copy link
Copy Markdown
Contributor
  • rekey STABLE_TORCH_LIBRARY_IMPL CUDA registrations to PrivateUse1 for arbitrary namespaces and multiline macro invocations
  • map stable ABI CUDA stream APIs to their MUSA equivalents
  • map CUDA_VERSION to MUSA_VERSION
  • define USE_MUSA for MUSA CUDAExtension builds
  • cover in-place porting, non-CUDA dispatch keys, and generic namespaces

Comment thread src/torchada/_mappings/cuda_runtime.py Outdated
)


def _rekey_stable_library_impl(source_code):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_rekey_stable_library_impl() 在过滤注释前对整个文件执行 regex,因此注释和字符串里的宏文本也会被改写。建议补 comment/string negative tests。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

检测是否是注释,和字符串,比较麻烦,而且感觉没必要。

Comment thread src/torchada/utils/cpp_extension.py Outdated
Comment thread tests/test_cpp_extension.py Outdated
@xuezhaojiang
xuezhaojiang force-pushed the xzj/mapping branch 2 times, most recently from 639e92e to c9abd08 Compare August 14, 2026 09:16
  - rekey STABLE_TORCH_LIBRARY_IMPL CUDA registrations to PrivateUse1
    for arbitrary namespaces and multiline macro invocations
  - map stable ABI CUDA stream APIs to their MUSA equivalents
  - cover in-place porting, non-CUDA dispatch keys, and generic namespaces
  - update version to 0.1.80.
@yeahdongcn
yeahdongcn merged commit b680e80 into MooreThreads:main Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants