Skip to content

Commit

Permalink
Update mlir-aie (nod-ai#112)
Browse files Browse the repository at this point in the history
Transfers the mlir-aie install dir to aie2xclbin, respects the show
commands option.
If you have a wheel made from the updated mlir-aie, it should work as
the mlir-aie install dir.
  • Loading branch information
spaceotter authored Jan 30, 2024
1 parent b811b9a commit 71af32b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 22 deletions.
18 changes: 0 additions & 18 deletions compiler/plugins/target/AMD-AIE/aie/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -274,21 +274,3 @@ iree_cc_library(
::AIEXDialectIR
::AIEXTransformPassHeaders
)

###############################################################################
# AIE Translation passes.
###############################################################################

iree_cc_library(
NAME
AIETranslationPasses
SRCS
"${IREE_MLIR_AIE_SOURCE_DIR}/lib/Targets/AIETargetIPU.cpp"
"${IREE_MLIR_AIE_SOURCE_DIR}/lib/Targets/AIETargetLdScript.cpp"
"${IREE_MLIR_AIE_SOURCE_DIR}/lib/Targets/AIETargetShared.cpp"
"${IREE_MLIR_AIE_SOURCE_DIR}/lib/Targets/AIETargetXAIEV2.cpp"
DEPS
::AIEDialectIR
::AIEXDialectIR
::AIEVecDialectIR
)
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ iree_cc_library(
iree::target::amd-aie::Target
iree::target::amd-aie::Transforms
iree::target::amd-aie::aie::AIEDialectIR
iree::target::amd-aie::aie::AIETransformPasses
iree::target::amd-aie::aie::AIEXDialectIR
iree::target::amd-aie::aie::AIEXTransformPasses
iree::target::amd-aie::air::AIRDialectIR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,12 @@ LogicalResult AIETargetBackend::serializeExecutable(
"--xclbin-kernel-name",
entryPointNames[0],
"--tmpdir",
workDir};
workDir,
"--install-dir",
options.mlirAieInstallDir};
if (options.showInvokedCommands) {
cmdArgs.push_back("-v");
}
// Update the linker search path to find libcdo_driver.so
SmallString<128> libPath(options.vitisInstallDir);
llvm::sys::path::append(libPath, "aietools", "lib", "lnx64.o");
Expand All @@ -220,6 +225,11 @@ LogicalResult AIETargetBackend::serializeExecutable(
newPath = "PATH=" + newPath;
cmdEnv.push_back(newPath);
}
if (options.showInvokedCommands) {
for (auto s : cmdEnv) llvm::dbgs() << s << " ";
for (auto s : cmdArgs) llvm::dbgs() << s << " ";
llvm::dbgs() << "\n";
}
int result = llvm::sys::ExecuteAndWait(cmdArgs[0], cmdArgs, cmdEnv);
if (result != 0) {
return moduleOp.emitOpError(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ iree_cc_library(
DEPS
iree::compiler::Dialect::HAL::Target
iree::target::amd-aie::Transforms
iree::target::amd-aie::aie::AIETranslationPasses
iree::target::amd-aie::aie::AIEXTransformPasses
iree::target::amd-aie::air::AIRDialectIR
PUBLIC
Expand Down

0 comments on commit 71af32b

Please sign in to comment.