Skip to content

Commit

Permalink
Modify the --lower-linalg-to-func option in aircc to take in the obj …
Browse files Browse the repository at this point in the history
…file name as str
  • Loading branch information
erwei-xilinx committed Feb 24, 2025
1 parent 7d91fa0 commit f4fe32b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion python/air/backend/xrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(
verbose: bool = False,
omit_while_true_loop: bool = False,
omit_pingpong: bool = False,
lower_linalg_to_func: bool = False,
lower_linalg_to_func: str = None,
air_loop_fusion: bool = False,
runtime_loop_tiling_sizes: list[int] = [4, 4],
omit_auto_broadcast: bool = False,
Expand Down Expand Up @@ -137,6 +137,7 @@ def compile(

if self.lower_linalg_to_func:
aircc_options += ["--lower-linalg-to-func"]
aircc_options += [self.lower_linalg_to_func]

if self.air_loop_fusion:
aircc_options += ["--air-loop-fusion"]
Expand Down
6 changes: 3 additions & 3 deletions python/air/compiler/aircc/cl_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ def parse_args(args=None):
)
parser.add_argument(
"--lower-linalg-to-func",
type=str,
dest="lower_linalg_to_func",
default=False,
action="store_true",
help="Whether to run pass which lowers linalg.generic ops to function calls. If False, then they lower to loops.",
default=None,
help="Whether to run pass which lowers linalg.generic ops to function calls. If a string is passed in, then register the string value as the object file name to link with.",
)
parser.add_argument(
"--air-loop-fusion",
Expand Down
6 changes: 3 additions & 3 deletions python/air/compiler/aircc/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def get_L2_splitting_analysis_pass():
def get_air_optimization_pass(
device,
omit_pingpong=False,
lower_linalg_to_func=False,
lower_linalg_to_func=None,
air_loop_fusion=False,
omit_auto_broadcast=False,
channel_multiplexing=[],
Expand Down Expand Up @@ -96,9 +96,9 @@ def get_air_optimization_pass(
"canonicalize",
"cse",
]
if lower_linalg_to_func:
if lower_linalg_to_func != None:
OPTIMIZATION_PASSES += [
"air-linalg-to-func",
"air-linalg-to-func{link-with=" + f"{lower_linalg_to_func}" + "}",
]
else:
OPTIMIZATION_PASSES += [
Expand Down

0 comments on commit f4fe32b

Please sign in to comment.