From 95ab10cd73f0dc4f5489d30e349a1d3bb2dbc1cd Mon Sep 17 00:00:00 2001 From: Erick Ochoa Lopez Date: Thu, 9 Jan 2025 16:43:14 -0500 Subject: [PATCH] String description at the top --- frontend/catalyst/passes/pass_api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/catalyst/passes/pass_api.py b/frontend/catalyst/passes/pass_api.py index 09784ce7be..cab5d5750f 100644 --- a/frontend/catalyst/passes/pass_api.py +++ b/frontend/catalyst/passes/pass_api.py @@ -271,6 +271,8 @@ def __init__(self, name: str, *options: list[str], **valued_options: dict[str, s def get_options(self): """ + Stringify options according to what mlir-opt expects. + ApplyRegisteredPassOp expects options to be a single StringAttr which follows the same format as the one used with mlir-opt. @@ -281,7 +283,7 @@ def get_options(self): https://mlir.llvm.org/docs/Tutorials/MlirOpt/#running-a-pass-with-options - However, experimentally we found that single-options also work without values. + Experimentally we found that single-options also work without values. """ retval = " ".join(f"{str(option)}" for option in self.options) retval2 = " ".join(f"{str(key)}={str(value)}" for key, value in self.valued_options.items())