diff --git a/build_tools/ci/run_matmul_test.sh b/build_tools/ci/run_matmul_test.sh index 32fcac59f..5328eb8d3 100755 --- a/build_tools/ci/run_matmul_test.sh +++ b/build_tools/ci/run_matmul_test.sh @@ -759,6 +759,18 @@ if [ -d "$VITIS" ]; then --num_repeat_runs "10" \ --use_ukernel "1" + run_matmul_test \ + --name_prefix "chess_i32_matmul_multi_core" \ + --lower_to_aie_pipeline "objectFifo" \ + --tile_pipeline "pack-peel" \ + --lhs_rhs_type "i32" \ + --acc_type "i32" \ + --m "32" \ + --n "32" \ + --k "32" \ + --use_chess "1" \ + --num_repeat_runs "10" + fi echo "\n\n" diff --git a/compiler/plugins/target/AMD-AIE/iree-amd-aie/Target/XCLBinGen.cpp b/compiler/plugins/target/AMD-AIE/iree-amd-aie/Target/XCLBinGen.cpp index 1cfd6bd3d..5de16906f 100644 --- a/compiler/plugins/target/AMD-AIE/iree-amd-aie/Target/XCLBinGen.cpp +++ b/compiler/plugins/target/AMD-AIE/iree-amd-aie/Target/XCLBinGen.cpp @@ -603,45 +603,46 @@ static LogicalResult generateCoreElfFiles( chessArgs.emplace_back("-o"); chessArgs.emplace_back(elfFile.string()); std::vector env = makeChessEnv(*vitisDir, npuVersion); - return runTool(xChessCCExe, chessArgs, verbose, env); - } + if (failed(runTool(xChessCCExe, chessArgs, verbose, env))) { + return deviceOp.emitOpError() << "failed to generate elf for core: (" + << col << ", " << row << ")"; + } + } else { + Path ldscriptPath = tempDir / (elfFileName + ".ld"); + { + auto ldscriptOutput = + openOutputFile(ldscriptPath.string(), &errorMessage); + if (!ldscriptOutput) { + llvm::errs() << "Failed to open ldscript file because: " + << errorMessage; + return failure(); + } + if (failed(mlir::iree_compiler::AMDAIE::AIETranslateToLdScript( + deviceOp, ldscriptOutput->os(), col, row))) { + return failure(); + } + ldscriptOutput->keep(); + } - Path ldscriptPath = tempDir / (elfFileName + ".ld"); - { - auto ldscriptOutput = - openOutputFile(ldscriptPath.string(), &errorMessage); - if (!ldscriptOutput) { - llvm::errs() << "Failed to open ldscript file because: " - << errorMessage; - return failure(); + std::string targetLower = StringRef(targetArch).lower(); + std::vector flags; + flags.emplace_back(objFile); + if (ukernel && (ukernel == "mm" || ukernel == "all")) { + flags.emplace_back(mmObjectFilePath->string()); } - if (failed(mlir::iree_compiler::AMDAIE::AIETranslateToLdScript( - deviceOp, ldscriptOutput->os(), col, row))) { - llvm::errs() << "failed to generate ld script for core (" << col << "," - << row << ")\n"; + flags.emplace_back("--target=" + targetLower + "-none-unknown-elf"); + flags.emplace_back("-Wl,--gc-sections"); + flags.emplace_back("-Wl,--orphan-handling=error"); + flags.emplace_back("-Wl,-T," + ldscriptPath.string()); + flags.emplace_back("-o"); + flags.emplace_back(elfFile.string()); + if (verbose) flags.emplace_back("-v"); + // we run clang (ie cc) so that libc, libm, crt0/1 paths are injected + // automatically into the ld.lld invocation + if (failed( + runTool((peanoDir / "bin" / "clang").string(), flags, verbose))) { return failure(); } - ldscriptOutput->keep(); - } - - std::string targetLower = StringRef(targetArch).lower(); - std::vector flags; - flags.emplace_back(objFile); - if (ukernel && (ukernel == "mm" || ukernel == "all")) { - flags.emplace_back(mmObjectFilePath->string()); - } - flags.emplace_back("--target=" + targetLower + "-none-unknown-elf"); - flags.emplace_back("-Wl,--gc-sections"); - flags.emplace_back("-Wl,--orphan-handling=error"); - flags.emplace_back("-Wl,-T," + ldscriptPath.string()); - flags.emplace_back("-o"); - flags.emplace_back(elfFile.string()); - if (verbose) flags.emplace_back("-v"); - // we run clang (ie cc) so that libc, libm, crt0/1 paths are injected - // automatically into the ld.lld invocation - if (failed( - runTool((peanoDir / "bin" / "clang").string(), flags, verbose))) { - return failure(); } } return success(); @@ -1149,7 +1150,6 @@ LogicalResult aie2xclbin( const std::string &xclBinInstanceName, const std::string &amdAIEInstallDir, const std::optional &InputXCLBin, const std::optional &ukernel) { - FailureOr> maybeNpuInstructions = getNpuInstructions(deviceOp); if (failed(maybeNpuInstructions)) {