From 27a9a7979a5b5bef903f14dcab1c1149458e9c1c Mon Sep 17 00:00:00 2001 From: christopherngutierrez Date: Wed, 2 Jul 2025 11:05:44 -0700 Subject: [PATCH 1/2] added support for legecy mode output --- p-isa_tools/kerngen/kerngraph.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/p-isa_tools/kerngen/kerngraph.py b/p-isa_tools/kerngen/kerngraph.py index e7343281..522dae8a 100755 --- a/p-isa_tools/kerngen/kerngraph.py +++ b/p-isa_tools/kerngen/kerngraph.py @@ -36,12 +36,16 @@ from kernel_optimization.loops import loop_interchange from const.options import LoopKey from pisa_generators.basic import mixed_to_pisa_ops +from high_parser.config import Config def parse_args(): """Parse arguments from the commandline""" parser = argparse.ArgumentParser(description="Kernel Graph Parser") parser.add_argument("-d", "--debug", action="store_true", help="Enable Debug Print") + parser.add_argument( + "-l", "--legacy", action="store_true", help="Enable Legacy Mode" + ) parser.add_argument( "-t", "--target", @@ -85,6 +89,7 @@ def main(args): """Main function to read input and parse each line with KernelParser.""" input_lines = sys.stdin.read().strip().splitlines() valid_kernels = [] + Config.legacy_mode = args.legacy for line in input_lines: try: From be355c8ef58c49798b05590bd080a04290b61b88 Mon Sep 17 00:00:00 2001 From: Christopher Noe Gutierrez <54914522+christopherngutierrez@users.noreply.github.com> Date: Wed, 2 Jul 2025 12:16:37 -0700 Subject: [PATCH 2/2] Bug Fix - Context Label not always set as a string (#98) --- p-isa_tools/kerngen/high_parser/parser.py | 4 ++-- p-isa_tools/kerngen/kernel_parser/parser.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/p-isa_tools/kerngen/high_parser/parser.py b/p-isa_tools/kerngen/high_parser/parser.py index 0df064df..c4d2e5b6 100644 --- a/p-isa_tools/kerngen/high_parser/parser.py +++ b/p-isa_tools/kerngen/high_parser/parser.py @@ -1,4 +1,4 @@ -# Copyright (C) 2024 Intel Corporation +# Copyright (C) 2025 Intel Corporation # SPDX-License-Identifier: Apache-2.0 """Module for parsing isa commands""" @@ -68,7 +68,7 @@ def get_pisa_ops(self) -> Iterator[list[PIsaOp] | None]: if Config.legacy_mode is True: for command in commands: if isinstance(command, HighOp) and hasattr(command, "context"): - command.context.label = self.context.ntt_stages + command.context.label = str(self.context.ntt_stages) return ( command.to_pisa() if isinstance(command, HighOp) else None diff --git a/p-isa_tools/kerngen/kernel_parser/parser.py b/p-isa_tools/kerngen/kernel_parser/parser.py index 1821ca56..a99c3d46 100644 --- a/p-isa_tools/kerngen/kernel_parser/parser.py +++ b/p-isa_tools/kerngen/kernel_parser/parser.py @@ -54,7 +54,7 @@ def parse_context(context_str: str) -> KernelContext: current_rns=int(context_match.group("current_rns")), max_rns=int(context_match.group("key_rns")) - 1, ), - label=context_match.group("label"), + label=str(context_match.group("label")), ) @staticmethod