From 6a7b66388f69239e771481951a2df29121358c71 Mon Sep 17 00:00:00 2001 From: Tapasvi Patel Date: Mon, 22 Jul 2024 17:55:01 -0400 Subject: [PATCH] #132: Added ability to load system desc file into mlir tests or default to original parameters --- include/ttmlir/Dialect/TT/IR/TTOpsTypes.td | 1 + .../ttmlir/Dialect/TTIR/Transforms/Passes.td | 11 +++ lib/Dialect/TT/IR/TTOpsTypes.cpp | 77 +++++++++++++++++++ lib/Dialect/TTIR/Transforms/Passes.cpp | 20 +++++ test/ttmlir/Dialect/TTIR/test_allocate.mlir | 2 +- test/ttmlir/Dialect/TTIR/test_generic.mlir | 2 +- test/ttmlir/Dialect/TTIR/test_grid_set.mlir | 4 +- test/ttmlir/Dialect/TTIR/test_layout.mlir | 2 +- .../Dialect/TTIR/tosa_to_ttir_multiply.mlir | 2 +- .../Dialect/TTMetal/simple_multiply.mlir | 2 +- test/ttmlir/Dialect/TTMetal/to_layout.mlir | 2 +- .../Dialect/TTNN/multiple_add_with_loc.mlir | 4 +- .../multiple_add_with_loc_grid_override.mlir | 4 +- test/ttmlir/Dialect/TTNN/simple_ge.mlir | 4 +- test/ttmlir/Dialect/TTNN/simple_matmul.mlir | 4 +- test/ttmlir/Dialect/TTNN/simple_multiply.mlir | 4 +- test/ttmlir/Dialect/TTNN/simple_relu.mlir | 4 +- test/ttmlir/Dialect/TTNN/simple_subtract.mlir | 4 +- test/ttmlir/Dialect/TTNN/simple_sum.mlir | 4 +- .../Dialect/TTNN/softmax/simple_softmax.mlir | 4 +- .../TTNN/softmax/softmax_negative_1.mlir | 4 +- .../TTNN/softmax/softmax_negative_2.mlir | 4 +- .../Dialect/TTNN/ttir_to_ttnn_pipeline.mlir | 4 +- .../ttir_to_ttnn_pipeline_custom_opt.mlir | 4 +- .../Silicon/TTNN/multiple_add_with_loc.mlir | 4 +- .../multiple_add_with_loc_grid_override.mlir | 4 +- test/ttmlir/Silicon/TTNN/simple_ge.mlir | 4 +- test/ttmlir/Silicon/TTNN/simple_matmul.mlir | 4 +- test/ttmlir/Silicon/TTNN/simple_multiply.mlir | 4 +- test/ttmlir/Silicon/TTNN/simple_relu.mlir | 4 +- test/ttmlir/Silicon/TTNN/simple_subtract.mlir | 4 +- test/ttmlir/Silicon/TTNN/simple_sum.mlir | 4 +- .../Silicon/TTNN/ttir_to_ttnn_pipeline.mlir | 4 +- .../ttir_to_ttnn_pipeline_custom_opt.mlir | 4 +- 34 files changed, 163 insertions(+), 54 deletions(-) diff --git a/include/ttmlir/Dialect/TT/IR/TTOpsTypes.td b/include/ttmlir/Dialect/TT/IR/TTOpsTypes.td index a111c13124..27a64d7861 100644 --- a/include/ttmlir/Dialect/TT/IR/TTOpsTypes.td +++ b/include/ttmlir/Dialect/TT/IR/TTOpsTypes.td @@ -100,6 +100,7 @@ def TT_SystemDescAttr : TT_Attr<"SystemDesc", "system_desc"> { let extraClassDeclaration = [{ static tt::SystemDescAttr getDefault(MLIRContext *context); + static tt::SystemDescAttr getFromPath(MLIRContext *context, std::string& path); }]; } diff --git a/include/ttmlir/Dialect/TTIR/Transforms/Passes.td b/include/ttmlir/Dialect/TTIR/Transforms/Passes.td index 9863b77413..8c1391af64 100644 --- a/include/ttmlir/Dialect/TTIR/Transforms/Passes.td +++ b/include/ttmlir/Dialect/TTIR/Transforms/Passes.td @@ -57,4 +57,15 @@ def TTIRGridSet: Pass<"ttir-grid-set", "::mlir::ModuleOp"> { ]; } +def TTIRLoadSystemDesc: Pass<"ttir-load-system-desc", "::mlir::ModuleOp"> { + let summary = "Load system desc."; + let description = [{ + Load system descriptor as a compiler pass. + }]; + + list