Skip to content
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

Update generic operator tests to run for primtorch ops #107335

Closed
5 of 8 tasks
ekamiti opened this issue Aug 16, 2023 · 1 comment
Closed
5 of 8 tasks

Update generic operator tests to run for primtorch ops #107335

ekamiti opened this issue Aug 16, 2023 · 1 comment
Labels
module: primTorch module: testing Issues related to the torch.testing module (not tests) triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@ekamiti
Copy link
Contributor

ekamiti commented Aug 16, 2023

Issue description

Currently most of the operator groupings in common_method_invocations don't include the reference operators and this could lead to unintended mismatch in operator functionality between eager ops and primtorch ops slipping through. Some cases have already been seen of this while creating #104489. This is issue is being created in order to track and breakdown the changes to multiple pull requests for more manageable pieces for review. The sparse_* groupings cannot be currently updated as it seems that sparse tensor support for primtorch is is not yet complete.

# Common operator groupings
ops_and_refs = op_db + python_ref_db
unary_ufuncs = [op for op in op_db if isinstance(op, UnaryUfuncInfo)]
binary_ufuncs = [op for op in op_db if isinstance(op, BinaryUfuncInfo)]
binary_ufuncs_and_refs = tuple(op for op in ops_and_refs if isinstance(op, BinaryUfuncInfo))
spectral_funcs = [op for op in op_db if isinstance(op, SpectralFuncInfo)]
sparse_unary_ufuncs = [op for op in op_db if isinstance(op, UnaryUfuncInfo) and op.supports_sparse]
sparse_csr_unary_ufuncs = [op for op in op_db if isinstance(op, UnaryUfuncInfo) and op.supports_sparse_csr]
sparse_reduction_ops = [op for op in op_db if isinstance(op, ReductionOpInfo) and op.supports_sparse]
shape_funcs = [op for op in op_db if isinstance(op, ShapeFuncInfo)]
reduction_ops = [op for op in op_db if isinstance(op, ReductionOpInfo)]
reference_filtered_ops = [op for op in reduction_ops if op.ref is not None]
reference_masked_ops = [op for op in reference_filtered_ops if op.name.startswith('masked.')]
sparse_masked_reduction_ops = [op for op in sparse_reduction_ops if op.name.startswith('masked.')]

  • Update unary_ufuncs groupings
  • Update binary_ufuncs groupings
  • Update spectral_funcs groupings
  • Update sparse_unary_ufuncs groupings
  • Update sparse_csr_unary_ufuncs groupings
  • Update sparse_reduction_ops groupings
  • Update shape_funcs groupings
  • Update reduction_ops groupings

cc @ezyang @mruberry @lezcano @peterbell10

@ezyang
Copy link
Contributor

ezyang commented Aug 18, 2023

Hi, I chatted about this with @ngimel and avoiding refs being tested this way was partially about avoiding inflating test time. So it would be good to make sure we aren't making test times a lot worse.

pytorchmergebot pushed a commit that referenced this issue Aug 18, 2023
Fixes #107335. Part of breakdown of #104489.

Pull Request resolved: #107336
Approved by: https://github.com/ezyang
pytorchmergebot pushed a commit that referenced this issue Aug 19, 2023
Fixes #107335. The skips were updated for the _ref ops to match those for eager mode where necessary. Part of breakdown of #104489.

Pull Request resolved: #107338
Approved by: https://github.com/ezyang
pytorchmergebot pushed a commit to wenzhe-nrv/pytorch that referenced this issue Aug 19, 2023
…7338)

Fixes pytorch#107335. The skips were updated for the _ref ops to match those for eager mode where necessary. Part of breakdown of pytorch#104489.

Pull Request resolved: pytorch#107338
Approved by: https://github.com/ezyang
pytorchmergebot pushed a commit that referenced this issue Aug 23, 2023
Fixes #107335. The skips were updated for the _ref ops to match those for eager mode where necessary. Part of breakdown of #104489.

Pull Request resolved: #107345
Approved by: https://github.com/ezyang
pytorchmergebot pushed a commit that referenced this issue Sep 5, 2023
Fixes #107335.

A few issues have been identified while enabling this test and filed:
#105986
#108204
#108205

Pull Request resolved: #107421
Approved by: https://github.com/ezyang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: primTorch module: testing Issues related to the torch.testing module (not tests) triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
2 participants