pytorch/torch/_dynamo/variables
Shangdi Yu cfb9ccab6c [export] Filter errors by exception type, add case name (#131327)
Summary:
-  Log export errors to Scuba and mark them with "classified" and "unclassified"
- Classify errors by exception type (ALLOW_LIST) and a `case_name` attribute
- Add `case_name` for some exceptions.

Test Plan:
Running the code below logs a classified error to `torch_export_usage` table in Scuba.

```
import torch

from torch._export.db.case import SupportLevel

class TorchSymMin(torch.nn.Module):
    """
    torch.sym_min operator is not supported in export.
    """

    def forward(self, x):
        return x.sum() + torch.sym_min(x.size(0), 100)

example_args = (torch.randn(3, 2),)
tags = {"torch.operator"}
support_level = SupportLevel.NOT_SUPPORTED_YET
model = TorchSymMin()

torch.export.export(model, example_args)
``

Differential Revision: D59981459

Pull Request resolved: https://github.com/pytorch/pytorch/pull/131327
Approved by: https://github.com/zhxchen17
2024-07-23 18:01:13 +00:00
..
__init__.py [dynamo] Revert https://github.com/pytorch/pytorch/pull/130416 (#131058) 2024-07-19 17:26:24 +00:00
base.py [BE][Easy] apply autofix for ruff rules unnecessary-collection-call (C408): list() / tuple() / dict() (#130199) 2024-07-11 17:30:28 +00:00
builder.py [export] Filter errors by exception type, add case name (#131327) 2024-07-23 18:01:13 +00:00
builtin.py [dynamo] Support set on KeysView (#131389) 2024-07-23 14:15:26 +00:00
constant.py Fix #121334: graph break on constant method call (#130158) 2024-07-12 17:34:46 +00:00
ctx_manager.py Revert "Relax constraints for creating a GenericContextWrappingVariable (#129091)" 2024-07-17 20:59:40 +00:00
dicts.py dynamo add support for defaultdict(set) (#130745) 2024-07-15 22:23:33 +00:00
distributed.py support as_python_constant on PlacementClassVariable (#124398) 2024-05-01 21:56:01 +00:00
functions.py [dynamo] Delete wrong assertion in bind_args (#131405) 2024-07-23 17:28:05 +00:00
higher_order_ops.py [Inductor] FlexAttention supports partial masking (#130415) (#130626) 2024-07-14 00:37:26 +00:00
iter.py [dynamo] Improve constant-prop for regex/torch.__version__ (#123705) 2024-04-12 19:03:13 +00:00
lazy.py [BE][Easy] apply autofix for ruff rules unnecessary-collection-call (C408): list() / tuple() / dict() (#130199) 2024-07-11 17:30:28 +00:00
lists.py Add python type for list iterators (#130511) 2024-07-12 01:14:18 +00:00
misc.py [dynamo] Support __contains__ on __dict__ on UserDefinedClassVariable (#131378) 2024-07-23 14:15:26 +00:00
nn_module.py [dynamo] Revert https://github.com/pytorch/pytorch/pull/130416 (#131058) 2024-07-19 17:26:24 +00:00
optimizer.py [BE][Easy] apply autofix for ruff rules unnecessary-collection-call (C408): list() / tuple() / dict() (#130199) 2024-07-11 17:30:28 +00:00
script_object.py Flip default value for mypy disallow_untyped_defs [1/11] (#127838) 2024-06-08 18:16:33 +00:00
sdpa.py [3.13, dynamo] codegen PUSH_NULL when callable is codegen'd (#129172) 2024-06-22 17:25:23 +00:00
tensor.py Add hasattr for tensor variable (#131008) 2024-07-19 12:43:27 +00:00
torch_function.py [Dynamo x torch_function] fix incorrect source (#128980) 2024-06-20 14:54:00 +00:00
torch.py [dynamo][dynamic-shapes] Graph break if out shape changes on out= variants (#130074) 2024-07-04 08:36:12 +00:00
user_defined.py [dynamo] Support __contains__ on __dict__ on UserDefinedClassVariable (#131378) 2024-07-23 14:15:26 +00:00