diff --git a/.gitignore b/.gitignore index 918b69b27c..c8dd4c5308 100644 --- a/.gitignore +++ b/.gitignore @@ -69,3 +69,8 @@ bazel-tensorrt bazel-project build/ wheelhouse/ +*_status.json +tests/py/dynamo/models/*.ts +tests/py/dynamo/models/*.ep +*.deb +*.tar.xz \ No newline at end of file diff --git a/py/torch_tensorrt/dynamo/tools/opset_coverage.py b/py/torch_tensorrt/dynamo/tools/opset_coverage.py index bfa57d3ed8..c5c3075ec1 100644 --- a/py/torch_tensorrt/dynamo/tools/opset_coverage.py +++ b/py/torch_tensorrt/dynamo/tools/opset_coverage.py @@ -206,6 +206,15 @@ def opset_coverage( ) +def get_coverage_status(opset: List[Tuple[str, str]], name: str) -> OpsetCoverage: + coverage = opset_coverage(opset) + return coverage + + +ATEN_COVERAGE = get_coverage_status(ATEN_OPS, "ATen") +PRIMS_COVERAGE = get_coverage_status(PRIM_OPS, "prim") +PY_OVERLOAD_COVERAGE = get_coverage_status(OVERLOADED_PY_OPS, "py_overload") + if __name__ == "__main__": def find_coverage_status(opset: List[Tuple[str, str]], name: str) -> None: diff --git a/tools/opset_coverage.ipynb b/tools/opset_coverage.ipynb new file mode 100644 index 0000000000..5cbc802138 --- /dev/null +++ b/tools/opset_coverage.ipynb @@ -0,0 +1,92 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import torch_tensorrt\n", + "from torch_tensorrt.dynamo.tools.opset_coverage import ATEN_COVERAGE, PRIMS_COVERAGE, PY_OVERLOAD_COVERAGE, SupportStatus, OpsetCoverage" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "unsupported_ops = {}\n", + "backwards_ops = {}\n", + "\n", + "for target, info in ATEN_COVERAGE.support_status.items():\n", + " if info[\"status\"] == \"FALLBACK\":\n", + " if \"backward\" not in target:\n", + " unsupported_ops.update({target : info[\"schema\"]})\n", + " else:\n", + " backwards_ops.update({target : info[\"schema\"]})\n", + "\n", + "print(\"Unsupported Ops:\")\n", + "for _, schema in unsupported_ops.items():\n", + " print(schema)\n", + "\n", + "print(\"\\nBackwards Ops:\")\n", + "for _, schema in backwards_ops.items():\n", + " print(schema)\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "unsupported_ops = {}\n", + "backwards_ops = {}\n", + "\n", + "for target, info in PRIMS_COVERAGE.support_status.items():\n", + " if info[\"status\"] == \"FALLBACK\":\n", + " if \"backward\" not in target:\n", + " unsupported_ops.update({target : info[\"schema\"]})\n", + " else:\n", + " backwards_ops.update({target : info[\"schema\"]})\n", + "\n", + "print(\"Unsupported Ops:\")\n", + "for _, schema in unsupported_ops.items():\n", + " print(schema)\n", + "\n", + "print(\"\\nBackwards Ops:\")\n", + "for _, schema in backwards_ops.items():\n", + " print(schema)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "torch230cu121py311", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.7" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +}