Skip to content

Commit 584f349

Browse files
author
Bowen Fu
committed
chore(annotation): defer _layer_metadata and AnnotationMetadata to follow-up PR
Address PR review comments pytorch#4147: - Comment 4: Remove AnnotationMetadata / attach_annotation_metadata / get_annotation_metadata from _specs.py and __init__.py — unused in this PR (designed for @tta.export_as which is deferred). - Comment 5: Remove _layer_metadata.py and its set_tta_layer_metadata call in lower_custom_plugin_descriptor — diagnostic-only (TRT engine inspector), non-fatal by design, out of scope for this PR. Both modules are preserved in the backup branch and will be reintroduced in a higher-level diagnostics / export_as PR.
1 parent b7bf7b9 commit 584f349

6 files changed

Lines changed: 0 additions & 989 deletions

File tree

py/torch_tensorrt/annotation/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
from ._errors import TTADiagnosticError
3131

3232
from ._specs import (
33-
AnnotationMetadata,
3433
KernelImplSpec,
3534
CuTeDSLSpec,
3635
CuTileSpec,
@@ -47,7 +46,6 @@
4746
# Error types
4847
"TTADiagnosticError",
4948
# Descriptor types
50-
"AnnotationMetadata",
5149
"KernelImplSpec",
5250
"TritonSpec",
5351
"CuTileSpec",

py/torch_tensorrt/annotation/_custom_plugin/_descriptor.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
make_td_from_meta_using_template,
4545
make_td_from_meta_using_template_symbolic,
4646
)
47-
from .._layer_metadata import set_tta_layer_metadata
4847
from .._specs import CuTeDSLSpec, CuTileSpec, TritonSpec
4948
from ._symbolic import SymbolicTensor, TensorRole
5049

@@ -1250,26 +1249,6 @@ class docstring). It:
12501249
# float(np.array([v])) fails in NumPy 1.25+).
12511250
plugin_layer = ctx.net.add_plugin(plugin_fn(*trt_inputs), aot=True)
12521251
plugin_layer.name = name
1253-
_first_spec = descriptor.specs[0] if descriptor.specs else None
1254-
if isinstance(_first_spec, TritonSpec):
1255-
_backend = "triton"
1256-
elif isinstance(_first_spec, CuTileSpec):
1257-
_backend = "cutile"
1258-
elif isinstance(_first_spec, CuTeDSLSpec):
1259-
_backend = "cutedsl"
1260-
else:
1261-
_backend = "custom_plugin"
1262-
_fn_specs = []
1263-
for _s in descriptor.specs:
1264-
_fn = getattr(getattr(_s, "launch_fn", None), "__name__", None)
1265-
if _fn:
1266-
_cfgs = _s.configs if getattr(_s, "configs", None) else [{}]
1267-
for _cfg in _cfgs:
1268-
_fn_specs.append((_fn, _cfg))
1269-
set_tta_layer_metadata(plugin_layer, _backend, plugin_name, name,
1270-
attrs=descriptor.attrs or None,
1271-
fn_specs=_fn_specs or None)
1272-
12731252
if plugin_layer.num_outputs == 1:
12741253
return plugin_layer.get_output(0)
12751254
return tuple(

0 commit comments

Comments
 (0)