From 95afc4fb7ba2707488af39c69cbea816d1a77748 Mon Sep 17 00:00:00 2001 From: Taekyung Heo <7621438+TaekyungHeo@users.noreply.github.com> Date: Thu, 9 May 2024 13:15:00 -0400 Subject: [PATCH] Rename *2chakra_converter to *_converter --- pyproject.toml | 2 +- src/converter/converter.py | 10 ++++------ ...ytorch2chakra_converter.py => pytorch_converter.py} | 2 +- .../{text2chakra_converter.py => text_converter.py} | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) rename src/converter/{pytorch2chakra_converter.py => pytorch_converter.py} (99%) rename src/converter/{text2chakra_converter.py => text_converter.py} (99%) diff --git a/pyproject.toml b/pyproject.toml index 8cb28c8c..a7ce65b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,7 @@ target-version = "py39" line-length = 120 exclude = [ "src/third_party/protolib.py", - "src/converter/text2chakra_converter.py", + "src/converter/text_converter.py", ] [tool.ruff.lint] diff --git a/src/converter/converter.py b/src/converter/converter.py index acc85dab..2fda617f 100644 --- a/src/converter/converter.py +++ b/src/converter/converter.py @@ -6,8 +6,8 @@ import traceback from logging import FileHandler -from .pytorch2chakra_converter import PyTorch2ChakraConverter -from .text2chakra_converter import Text2ChakraConverter +from .pytorch_converter import PyTorchConverter +from .text_converter import TextConverter def get_logger(log_filename: str) -> logging.Logger: @@ -52,12 +52,10 @@ def main() -> None: try: if args.input_type == "Text": - converter = Text2ChakraConverter( - args.input_filename, args.output_filename, args.num_npus, args.num_passes, logger - ) + converter = TextConverter(args.input_filename, args.output_filename, args.num_npus, args.num_passes, logger) converter.convert() elif args.input_type == "PyTorch": - converter = PyTorch2ChakraConverter(args.input_filename, args.output_filename, logger) + converter = PyTorchConverter(args.input_filename, args.output_filename, logger) converter.convert() else: logger.error(f"{args.input_type} unsupported") diff --git a/src/converter/pytorch2chakra_converter.py b/src/converter/pytorch_converter.py similarity index 99% rename from src/converter/pytorch2chakra_converter.py rename to src/converter/pytorch_converter.py index 2c552cff..37224ae6 100644 --- a/src/converter/pytorch2chakra_converter.py +++ b/src/converter/pytorch_converter.py @@ -27,7 +27,7 @@ from .pytorch_node import PyTorchNode, PyTorchNodeType -class PyTorch2ChakraConverter: +class PyTorchConverter: """ Converter class for transforming PyTorch execution traces into Chakra format. diff --git a/src/converter/text2chakra_converter.py b/src/converter/text_converter.py similarity index 99% rename from src/converter/text2chakra_converter.py rename to src/converter/text_converter.py index 3c15c35b..1c229a02 100644 --- a/src/converter/text2chakra_converter.py +++ b/src/converter/text_converter.py @@ -50,7 +50,7 @@ def __init__(self, line: str) -> None: raise ValueError(f'Cannot parse the following layer -- "{line}"') -class Text2ChakraConverter: +class TextConverter: def __init__( self, input_filename: str, output_filename: str, num_npus: int, num_passes: int, logger: logging.Logger ) -> None: