Skip to content

Commit

Permalink
[ET-VK] Set export log level INFO
Browse files Browse the repository at this point in the history
Differential Revision: D61723563

Pull Request resolved: pytorch#4870
  • Loading branch information
jorgep31415 authored Aug 23, 2024
1 parent bc66ff2 commit d8be9b1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
9 changes: 6 additions & 3 deletions backends/vulkan/partitioner/vulkan_partitioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
torch.ops.aten.upsample_nearest2d.vec,
]

logger: logging.Logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)


class VulkanSupportedOperators(OperatorSupportBase):
_ops: OpList = enumerate_supported_ops()
Expand Down Expand Up @@ -110,7 +113,7 @@ def is_node_supported(
) -> bool:
r = self._is_node_supported(submodules, node)
if not r and node.op == "call_function":
logging.info(f"Skipping node in Vulkan partitioning: {node.format_node()}")
logger.info(f"Skipping node in Vulkan partitioning: {node.format_node()}")
return r

def _is_node_supported(
Expand Down Expand Up @@ -179,9 +182,9 @@ def partition(self, exported_program: ExportedProgram) -> PartitionResult:

pl = len(partition_list)
if pl == 0:
logging.warning("No Vulkan subgraphs can be partitioned!")
logger.warning("No Vulkan subgraphs can be partitioned!")
else:
logging.info(f"Found {pl} Vulkan subgraphs to be partitioned.")
logger.info(f"Found {pl} Vulkan subgraphs to be partitioned.")

tag_constant_data(exported_program)

Expand Down
7 changes: 5 additions & 2 deletions backends/vulkan/serialization/vulkan_graph_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
Node, NoneType, _ScalarType, TensorSpec, List[_ScalarType], List[Node], str
]

logger: logging.Logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)


class VkGraphBuilder:
def __init__(
Expand Down Expand Up @@ -351,9 +354,9 @@ def build_graph(self) -> vk_graph_schema.VkGraph:
self.process_node(node, call_node_debug_hdl)
call_node_debug_hdl += 1

logging.info("Operators included in this Vulkan partition: ")
logger.info("Operators included in this Vulkan partition: ")
for op in self.seen_ops:
logging.info(f" {op.__name__}")
logger.info(f" {op.__name__}")

return vk_graph_schema.VkGraph(
version="0",
Expand Down

0 comments on commit d8be9b1

Please sign in to comment.