Add MUSA graph-safe op overrides and torch.load map_location translation - #105
Open
froststeam wants to merge 4 commits into
Open
Add MUSA graph-safe op overrides and torch.load map_location translation#105froststeam wants to merge 4 commits into
froststeam wants to merge 4 commits into
Conversation
yeahdongcn
reviewed
Aug 21, 2026
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.
Summary
torch.load(..., map_location=...)to MUSA devices on MUSA platformsaten::multinomial,aten::log, andaten::log_0.1.83to0.1.84Notes
map_locationdict source keys are kept unchanged so serialized CUDA storage tags still match; only target devices are translated.TORCHADA_DISABLE_OP_OVERRIDE_<OP_NAME>=1mechanism.torch.musa.is_available()becausetorch.cuda.is_available()remains false in this torchada CUDA-compatible setup, while CUDA device strings still map to MUSA tensors.MUSA Test
Environment:
10.20.35.93, GPU:2(MUSA_VISIBLE_DEVICES=2,MTHREADS_VISIBLE_DEVICES=2)registry.mthreads.com/mcconline/inference/sglang:v0.5.12.post1-ph1-4.3.5-torch2.9.0-latest2.9.0403052.9.0+571893f0.1.84torchada.is_musa_platform() == Truetorch.musa.is_available() == True,torch.musa.device_count() == 1torch.empty(1, device="cuda").device == musa:0Command:
cd /tmp/torchada-pr105 MUSA_VISIBLE_DEVICES=2 MTHREADS_VISIBLE_DEVICES=2 PYTHONPATH=src \ pytest -q tests/test_device_strings.py tests/test_log.py tests/test_multinomial.pyResult:
Local Check
git diff --check