Repository navigation
[Device] synchronizeDevice as a no-op, and eager abs over every real dtype and layout - #538
Closed
student-Jungmin wants to merge 2 commits into
Closed
student-Jungmin wants to merge 2 commits into
student-Jungmin wants to merge 2 commits into
Conversation
… event The device runs synchronously, so the guard already answers synchronizeStream and synchronizeEvent with nothing to wait for, but not synchronizeDevice: torch's default raised "Backend doesn't support synchronizing all streams on device" from torch.accelerator.synchronize() (seen in TritonBench).
The abs stub accepted Float only and refused a non-contiguous input, so bf16/fp16 abs on npu failed (TritonBench fp8_gemm). It now dispatches over AT_DISPATCH_ALL_TYPES_AND2(Half, BFloat16), computing in opmath, and a non-contiguous iteration runs on a contiguous copy of the input before copying the result back. tests/system/test_device_runtime_ops.py checks f32/f16/bf16/i32/i64 on a contiguous tensor, a transpose and a strided slice against the CPU.
Collaborator
Author
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.
Stacked on #537 (branch pending-1116). Two eager device fixes, found while running TritonBench on npu.
Test: tests/system/test_device_runtime_ops.py covers sync plus abs on 5 dtypes x 3 layouts against CPU. Before: synchronize fails and 13/15 abs cases fail. After: 16/16 pass. It was run in the torchsim_base-77eac17860ce image with PTB pending-1116 overlaid.