Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions py/torch_tensorrt/_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"dynamo_frontend",
"fx_frontend",
"refit",
"tensorrt_plugin",
],
)

Expand All @@ -39,14 +40,27 @@
_FX_FE_AVAIL = True
_REFIT_AVAIL = True

try:
import tensorrt.plugin as trtp

assert trtp
_TENSORRT_PLUGIN_AVAIL = True
except ImportError:
_TENSORRT_PLUGIN_AVAIL = False

ENABLED_FEATURES = FeatureSet(
_TS_FE_AVAIL, _TORCHTRT_RT_AVAIL, _DYNAMO_FE_AVAIL, _FX_FE_AVAIL, _REFIT_AVAIL
_TS_FE_AVAIL,
_TORCHTRT_RT_AVAIL,
_DYNAMO_FE_AVAIL,
_FX_FE_AVAIL,
_REFIT_AVAIL,
_TENSORRT_PLUGIN_AVAIL,
)


def _enabled_features_str() -> str:
enabled = lambda x: "ENABLED" if x else "DISABLED"
out_str: str = f"Enabled Features:\n - Dynamo Frontend: {enabled(_DYNAMO_FE_AVAIL)}\n - Torch-TensorRT Runtime: {enabled(_TORCHTRT_RT_AVAIL)}\n - FX Frontend: {enabled(_FX_FE_AVAIL)}\n - TorchScript Frontend: {enabled(_TS_FE_AVAIL)}\n" # type: ignore[no-untyped-call]
out_str: str = f"Enabled Features:\n - Dynamo Frontend: {enabled(_DYNAMO_FE_AVAIL)}\n - Torch-TensorRT Runtime: {enabled(_TORCHTRT_RT_AVAIL)}\n - FX Frontend: {enabled(_FX_FE_AVAIL)}\n - TorchScript Frontend: {enabled(_TS_FE_AVAIL)}\n - TensorRT Plugin: {enabled(_TENSORRT_PLUGIN_AVAIL)}\n" # type: ignore[no-untyped-call]
return out_str


Expand Down
Loading
Loading