diff --git a/containers/daphne.Dockerfile b/containers/daphne.Dockerfile index 563e26860..96ac02124 100644 --- a/containers/daphne.Dockerfile +++ b/containers/daphne.Dockerfile @@ -64,7 +64,7 @@ LABEL "org.opencontainers.image.version"="$TIMESTAMP" LABEL "org.opencontainers.image.created"="${CREATION_DATE}" LABEL "org.opencontainers.image.revision"="${GIT_HASH}" RUN apt-get -qq -y update && apt-get -y upgrade && apt-get -y --no-install-recommends install \ - libtinfo6 libssl1.1 zlib1g python3-numpy python3-pandas lit\ + libtinfo6 libssl1.1 zlib1g python3-numpy python3-pandas\ && apt-get clean && rm -rf /var/lib/apt/lists/* COPY --from=daphne-build $DAPHNE_DIR/bin/* /usr/local/bin COPY --from=daphne-build $DAPHNE_DIR/lib/* /usr/local/lib diff --git a/doc/Codegen.md b/doc/Codegen.md index 826381a89..8d690c1bc 100644 --- a/doc/Codegen.md +++ b/doc/Codegen.md @@ -47,7 +47,7 @@ lowerings: - LowerAffinePass These passes are added in the `DaphneIrExecutor::buildCodegenPipeline` -function. The `--hybrid` flag disables the `MatMulOpLoweringPass` since the +function. The `--mlir-hybrid-codegen` flag disables the `MatMulOpLoweringPass` since the kernel implementation vastly outperforms the generated code of this pass. diff --git a/doc/GettingStarted.md b/doc/GettingStarted.md index ca8a422a9..20d072d05 100644 --- a/doc/GettingStarted.md +++ b/doc/GettingStarted.md @@ -42,30 +42,30 @@ launching DAPHNE via Docker (see below) should work the same way as in a native ### Software -| tool/lib | version known to work (*) | comment | -|--------------------------------------|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------| -| GCC/G++ | 9.3.0 | Last checked version: 12.2 | -| clang | 10.0.0 | | -| cmake | 3.20 | On Ubuntu 20.04, install by `sudo snap install cmake --classic` to fulfill the version requirement; `apt` provides only version 3.16.3. | -| git | 2.25.1 | | -| libssl-dev | 1.1.1 | Dependency introduced while optimizing grpc build (which used to build ssl unnecessarily) | -| libpfm4-dev | 4.10 | This dependency is needed for profiling support [DAPHNE-#479] | -| lld | 10.0.0 | | -| ninja | 1.10.0 | | -| pkg-config | 0.29.1 | | -| python3 | 3.8.5 | | -| numpy | 1.19.5 | | -| pandas | 0.25.3 | | -| java (e.g. openjdk) | 11 (1.7 should be fine) | | -| gfortran | 9.3.0 | | -| uuid-dev | | | -| lit | 17.0 | Install with pip, `llvm-lit` is installed in thirdparty/build/llvm-project/bin | -| wget | | Used to fetch additional dependencies and other artefacts | -| jq | | json commandline processor used in docker image generation scripts | -| *** | *** | *** | -| CUDA SDK | 11.7.1 | Optional for CUDA ops | -| OneAPI SDK | 2022.x | Optional for OneAPI ops | -| Intel FPGA SDK or OneAPI FPGA Add-On | 2022.x | Optional for FPGAOPENCL ops | +| tool/lib | version known to work (*) | comment | +|--------------------------------------|------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------| +| GCC/G++ | 9.3.0 | Last checked version: 12.2 | +| clang | 10.0.0 | | +| cmake | 3.20 | On Ubuntu 20.04, install by `sudo snap install cmake --classic` to fulfill the version requirement; `apt` provides only version 3.16.3. | +| git | 2.25.1 | | +| libssl-dev | 1.1.1 | Dependency introduced while optimizing grpc build (which used to build ssl unnecessarily) | +| libpfm4-dev | 4.10 | This dependency is needed for profiling support [DAPHNE-#479] | +| lld | 10.0.0 | | +| ninja | 1.10.0 | | +| pkg-config | 0.29.1 | | +| python3 | 3.8.5 | | +| numpy | 1.19.5 | | +| pandas | 0.25.3 | | +| java (e.g. openjdk) | 11 (1.7 should be fine) | | +| gfortran | 9.3.0 | | +| uuid-dev | | | +| llvm-10-tools | 10, 15 | On Ubuntu 22.04 you may need to install a newer `llvm-*-tools` version, such as `llvm-15-tools`. | +| wget | | Used to fetch additional dependencies and other artefacts | +| jq | | json commandline processor used in docker image generation scripts | +| *** | *** | *** | +| CUDA SDK | 11.7.1 | Optional for CUDA ops | +| OneAPI SDK | 2022.x | Optional for OneAPI ops | +| Intel FPGA SDK or OneAPI FPGA Add-On | 2022.x | Optional for FPGAOPENCL ops | ### Hardware diff --git a/install-ubuntu-packages.sh b/install-ubuntu-packages.sh index 19562c392..6644005db 100644 --- a/install-ubuntu-packages.sh +++ b/install-ubuntu-packages.sh @@ -15,5 +15,6 @@ # limitations under the License. # This is a convenience script to install the required packages on Ubuntu 20+ systems to compile DAPHNE +# On Ubuntu 22.04 you may need to change the version of llvm-10-tools to a newer one, such as llvm-15-tools. sudo apt install build-essential clang cmake git libssl-dev libpfm4-dev lld ninja-build pkg-config python3-numpy \ - python3-pandas default-jdk-headless gfortran uuid-dev wget unzip jq lit + python3-pandas default-jdk-headless gfortran uuid-dev wget unzip jq llvm-10-tools diff --git a/src/api/cli/DaphneUserConfig.h b/src/api/cli/DaphneUserConfig.h index 1948b5f56..3b7a2de93 100644 --- a/src/api/cli/DaphneUserConfig.h +++ b/src/api/cli/DaphneUserConfig.h @@ -43,6 +43,7 @@ struct DaphneUserConfig { bool use_ipa_const_propa = true; bool use_phy_op_selection = true; bool use_mlir_codegen = false; + bool use_mlir_hybrid_codegen = false; bool cuda_fuse_any = false; bool vectorized_single_queue = false; bool prePartitionRows = false; @@ -50,7 +51,6 @@ struct DaphneUserConfig { bool hyperthreadingEnabled = false; bool debugMultiThreading = false; bool use_fpgaopencl = false; - bool hybrid = false; bool enable_profiling = false; bool debug_llvm = false; diff --git a/src/api/internal/daphne_internal.cpp b/src/api/internal/daphne_internal.cpp index 05004eb36..5ba81007c 100644 --- a/src/api/internal/daphne_internal.cpp +++ b/src/api/internal/daphne_internal.cpp @@ -261,7 +261,7 @@ int startDAPHNE(int argc, const char** argv, DaphneLibResult* daphneLibRes, int desc("Enables lowering of certain DaphneIR operations on DenseMatrix to low-level MLIR operations.") ); static opt performHybridCodegen( - "hybrid", cat(daphneOptions), + "mlir-hybrid-codegen", cat(daphneOptions), desc("Enables prototypical hybrid code generation combining pre-compiled kernels and MLIR code generation.") ); @@ -378,7 +378,7 @@ int startDAPHNE(int argc, const char** argv, DaphneLibResult* daphneLibRes, int user_config.use_ipa_const_propa = !noIPAConstPropa; user_config.use_phy_op_selection = !noPhyOpSelection; user_config.use_mlir_codegen = mlirCodegen; - user_config.hybrid = performHybridCodegen; + user_config.use_mlir_hybrid_codegen = performHybridCodegen; if(!libDir.getValue().empty()) user_config.libdir = libDir.getValue(); diff --git a/src/compiler/execution/DaphneIrExecutor.cpp b/src/compiler/execution/DaphneIrExecutor.cpp index 64f8d37c7..1c5ab19f5 100644 --- a/src/compiler/execution/DaphneIrExecutor.cpp +++ b/src/compiler/execution/DaphneIrExecutor.cpp @@ -176,7 +176,7 @@ bool DaphneIrExecutor::runPasses(mlir::ModuleOp module) { if (userConfig_.use_distributed) pm.addPass(mlir::daphne::createDistributePipelinesPass()); - if (userConfig_.use_mlir_codegen) buildCodegenPipeline(pm); + if (userConfig_.use_mlir_codegen || userConfig_.use_mlir_hybrid_codegen) buildCodegenPipeline(pm); if (userConfig_.enable_profiling) pm.addNestedPass( @@ -299,7 +299,7 @@ void DaphneIrExecutor::buildCodegenPipeline(mlir::PassManager &pm) { pm.addPass(mlir::daphne::createDaphneOptPass()); - if (!userConfig_.hybrid) { + if (!userConfig_.use_mlir_hybrid_codegen) { pm.addPass(mlir::daphne::createMatMulOpLoweringPass()); } diff --git a/test/codegen/.gitignore b/test/codegen/.gitignore index 65f5566aa..a6e9662a3 100644 --- a/test/codegen/.gitignore +++ b/test/codegen/.gitignore @@ -1,2 +1,2 @@ -Output/ +Output/** .lit_test_times.txt