Musa support native kernels - #376
Draft
Arlo-mt wants to merge 6 commits into
Draft
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
added 2 commits
September 2, 2026 17:02
Signed-off-by: mt <mt@mt.localdomain>
Signed-off-by: mt <mt@mt.localdomain>
zhangj1an
requested changes
Sep 3, 2026
zhangj1an
left a comment
Collaborator
There was a problem hiding this comment.
Thanks! It is already almost there, after addressing the following we can merge it.
Please refer to PR 204 (#204) as an example when adding new kernels.
- Test breakage: tests/test_rms_norm.py calls torch.musa.is_available() unguarded and fails with AttributeError on non-MUSA platforms (verified). Use device_ctx.is_musa or a hasattr guard.
- Please register musa kernels in rl_engine/kernels/gtest/operator_specs.py ("musa" candidates), docs/operators/*.md Backends rows, rl_engine/_C.pyi stubs for the new symbols, and a benchmark script.
- Bitwise evidence: for copy/elementwise ops (embedding/rope/silu/swiglu) add torch.equal bitwise tests vs the same-dtype PyTorch reference (fp32 internally, single cast at the end); for reductions (logp/lm_head/rmsnorm/attention/det_gemm) add bitwise batch-invariance tests + contract-tolerance accuracy tests, mirroring tests/test_batch_invariant_logp.py.
- Please rebase your branch on the test branch and change the PR base to test. Also update TestMusaPlatform expectations (the native-first musa map conflicts with the current assertions on both main and test), and coordinate the musa priority map with #375 (decide merge order / final native-first + triton-fallback map).
- Fix DCO sign-off and the unreachable device_ctx.is_musa branch in tests/test_logp.py.
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.
No description provided.