Skip to content

Commit

Permalink
chore: change debug to warning if the graph does not have metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
peri044 committed Jan 27, 2024
1 parent 19c3fad commit ed48551
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions py/torch_tensorrt/dynamo/_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from typing import Any, Collection, List, Optional, Sequence, Set, Tuple, Union

import torch
import torch_tensorrt
from torch.export import ExportedProgram
from torch.fx.node import Target
from torch_tensorrt import _enums
Expand Down Expand Up @@ -66,8 +67,6 @@
to_torch_tensorrt_device,
)

import torch_tensorrt

logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -305,8 +304,8 @@ def compile_module(
def contains_metadata(gm: torch.fx.GraphModule) -> bool:
for node in gm.graph.nodes:
if node.op != "output" and (not node.meta) and "val" not in node.meta:
logger.debug(
f"Node {node.name} of op type {node.op} does not have metadata"
logger.warning(
f"Node {node.name} of op type {node.op} does not have metadata. This could sometimes lead to undefined behavior."
)
return False
return True
Expand Down

0 comments on commit ed48551

Please sign in to comment.