yobx.torch.coverage.op_coverage#

Op-db coverage data for PyTorch-to-ONNX operator export.

Defines the sets of ops that have no converter, are known to fail, or are excluded for specific dtypes when tested via unittests.torch.coverage.test_onnx_export_common_methods and unittests.torch.coverage.test_onnx_export_common_methods_tracing.

NO_CONVERTER_OPS - ops whose aten decomposition uses a function for which no ONNX converter has been implemented yet.

XFAIL_OPS, XFAIL_OPS_FLOAT16, XFAIL_OPS_BFLOAT16, XFAIL_OPS_INT32, XFAIL_OPS_INT64 - dicts mapping export-path name ("default" or "tracing") to a frozenset of op keys that are expected to fail on that path. The "default" entry covers the standard export path; the "tracing" entry lists additional ops that fail specifically under ExportOptions(tracing=True). The dtype-specific dicts contain only the extra exclusions beyond the dtype-agnostic XFAIL_OPS.

ATOL_OPS_FLOAT32, ATOL_OPS_FLOAT16, ATOL_OPS_BFLOAT16 - per-op absolute tolerance overrides for float16 and bfloat16, for ops whose reduced-precision errors exceed the global dtype tolerance.

These sets are consumed by the op-db test modules unittests.torch.coverage.test_onnx_export_common_methods, unittests.torch.coverage.test_onnx_export_common_methods_tracing, and by get_op_coverage_rst() which builds a documentation coverage table.

yobx.torch.coverage.op_coverage.get_op_coverage_float32_comparison_rst() str[source]#

Returns an RST table comparing float32 op support across all export paths.

Queries torch.testing._internal.common_methods_invocations.op_db and builds a single grid showing, for every op that supports float32, the export status for three paths side by side:

  • - converter exists and the test passes for float32.

  • xfail - converter exists but the test is a known failure.

  • no converter - no ONNX converter has been implemented for this op.

Returns:

RST source string with one list-table directive, ready to be printed inside a .. runpython:: block with :rst: enabled.

yobx.torch.coverage.op_coverage.get_op_coverage_rst(tracing_method: str) str[source]#

Returns an RST table showing op-db coverage for one export path.

Queries torch.testing._internal.common_methods_invocations.op_db and builds one grid (default export path, torch tracing path, or new-tracing path) showing, for every op and dtype combination, whether the

  • - in the tested set (converter exists, no known failure for that dtype).

  • xfail - converter exists, but this dtype is a known failing case.

  • no converter - no ONNX converter has been implemented for this op.

  • - this op does not support this dtype.

Parameters:

tracing_method – Export path key. Supported values are "default", "tracing", and "new-tracing".

Returns:

RST source string with one list-table directive, ready to be printed inside a .. runpython:: block with :rst: enabled.

Raises:

ValueError – If tracing_method is not one of the supported values.