Skip to content

Test cpu ops with non-default memory layouts #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions test/specdb/test_specdb_cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,37 @@ def test_all_ops_cpu_half(self):
config = TensorConfig(device="cpu", half_precision=True)
self._run_all_ops(config=config, skip_ops=skip_ops)

def test_all_ops_cpu_transposed(self):
skip_ops = self.SKIP_OPS.copy()
# Expected X.is_contiguous(memory_format) to be true, but got false.
skip_ops += ["native_group_norm.default"]
# _pdist_forward requires contiguous input
skip_ops += ["_pdist_forward.default"]
config = TensorConfig(device="cpu", transposed=True)
self._run_all_ops(config=config, skip_ops=skip_ops)

def test_all_ops_cpu_permuted(self):
skip_ops = self.SKIP_OPS.copy()
# Expected X.is_contiguous(memory_format) to be true, but got false.
skip_ops += ["native_group_norm.default"]
# _pdist_forward requires contiguous input
skip_ops += ["_pdist_forward.default"]
# Unsupported memory format. Supports only ChannelsLast3d, Contiguous
skip_ops += ["max_pool3d_with_indices.default"]
# Unsupported memory format. Supports only ChannelsLast, Contiguous
skip_ops += ["pixel_shuffle.default"]
config = TensorConfig(device="cpu", permuted=True)
self._run_all_ops(config=config, skip_ops=skip_ops)

def test_all_ops_cpu_strided(self):
skip_ops = self.SKIP_OPS.copy()
# Expected X.is_contiguous(memory_format) to be true, but got false.
skip_ops += ["native_group_norm.default"]
# _pdist_forward requires contiguous input
skip_ops += ["_pdist_forward.default"]
config = TensorConfig(device="cpu", strided=True)
self._run_all_ops(config=config, skip_ops=skip_ops)


if __name__ == "__main__":
unittest.main()