From a4bdb2127ad68de7e16e6eab685a12e4991f1cc4 Mon Sep 17 00:00:00 2001 From: Aleksandar Zecevic Date: Mon, 10 Feb 2025 16:47:41 +0100 Subject: [PATCH] Skip op verification in opDebugString (#2157) ### Ticket https://github.com/tenstorrent/tt-mlir/issues/2156 ### Problem description As described here https://github.com/tenstorrent/tt-mlir/pull/1782 `getOpDebugString` was taking more than 99% of the time of `ttmlir-translate -ttnn-to-flatbuffer` execution. From that time, 99% was spent on op verification. ### What's changed - added `assumeVefied()` to `printFlags` that are used for printing ops (the way we are running our pipelines I believe this is a safe assumption) - greatly lowers TTNN->Flatbuffer compile time (on LlamaPrefill example from https://github.com/tenstorrent/tt-mlir/pull/2144) compile time was lowered from ~70s -> ~1.5s (around 0.8s was spent on op printing) --- include/ttmlir/Target/Utils/FuncOpToProgram.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/ttmlir/Target/Utils/FuncOpToProgram.h b/include/ttmlir/Target/Utils/FuncOpToProgram.h index 8072ed0cad..d78efa4658 100644 --- a/include/ttmlir/Target/Utils/FuncOpToProgram.h +++ b/include/ttmlir/Target/Utils/FuncOpToProgram.h @@ -68,7 +68,8 @@ Program funcOpToProgram(FlatbufferObjectCache &cache, func::FuncOp entry, printFlags = printFlags.elideLargeElementsAttrs() .elideLargeResourceString() .skipRegions() - .enableDebugInfo(); + .enableDebugInfo() + .assumeVerified(); Program program; program.name = entry.getSymName().data();