KEMBAR78
Create an OpInfo test for CPU vs CUDA consistency · Issue #58294 · pytorch/pytorch · GitHub
Skip to content

Create an OpInfo test for CPU vs CUDA consistency #58294

@mruberry

Description

@mruberry

Updated 6/7/2021

PyTorch once had "tensor_op_tests", but they were removed in #55558. These tests would run a method once on the CPU and once on a CUDA or XLA device and compare the results. What these tests did and how they should be used was confusing, however, and they were often added when it was unnecessary to do so or removed as OpInfos were created for them, even though the OpInfo tests do not yet cover the same cases.

After some discussion (see below), instead of using the CPU as the source of truth, we would like to generalize the OpInfo architecture to support references. UnaryUfuncInfos already support references, but the OpInfo base class does not. This reference can then be compared against PyTorch's implementation of the operation on its sample inputs.

cc @mruberry @VitalyFedyunin @walterddr @kshitij12345 @krshrimali -- maybe an interesting task for @krshrimali's onboarding?

Metadata

Metadata

Assignees

Labels

module: testsIssues related to tests (not the torch.testing module)triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions