Skip to content

Commit

Permalink
Rename *2chakra_converter to *_converter
Browse files Browse the repository at this point in the history
  • Loading branch information
TaekyungHeo committed May 9, 2024
1 parent 705e00c commit 95afc4f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
10 changes: 4 additions & 6 deletions src/converter/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from .pytorch_node import PyTorchNode, PyTorchNodeType


class PyTorch2ChakraConverter:
class PyTorchConverter:
"""
Converter class for transforming PyTorch execution traces into Chakra format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 95afc4f

Please sign in to comment.