-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[nvq++][rt] Improve binary sizes by not globing MLIR dialects/passes.
By not globing all MLIR dialects/passes, many of which CUDAQ does not use, we can significantly improve binary sizes: ``` Filename Size (old) Size (new) Improvement -------- ----------- ----------- ----------- cudaq-opt 161.9 MB 39.6 MB -122.2 MB cudaq-quake 187.6 MB 108.6 MB -79.0 MB cudaq-translate 138.2 MB 76.1 MB -62.0 MB libcudaq-mlir-runtime.so 179.9 MB 111.8 MB -68.1 MB ``` This change also improves compilation time when building `llvm` along with CUDAQ, instead of using a pre-built version for llvm. It also improves the `--help` output for the `cudaq-*` tools, as they won't be "polluted" with many passes/options that are not relevant in the context of `nvq++`. Improving the python bindings situation, which can possibly profit from a similar change, will be left to a later commit. Signed-off-by: boschmitt <[email protected]>
- Loading branch information
Showing
15 changed files
with
99 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/****************************************************************-*- C++ -*-**** | ||
* Copyright (c) 2022 - 2024 NVIDIA Corporation & Affiliates. * | ||
* All rights reserved. * | ||
* * | ||
* This source code and the accompanying materials are made available under * | ||
* the terms of the Apache License 2.0 which accompanies this distribution. * | ||
******************************************************************************/ | ||
|
||
#pragma once | ||
|
||
#include "cudaq/Optimizer/CodeGen/Passes.h" | ||
#include "cudaq/Optimizer/Transforms/Passes.h" | ||
#include "mlir/Transforms/Passes.h" | ||
|
||
namespace cudaq { | ||
|
||
inline void registerAllPasses() { | ||
// General MLIR passes | ||
mlir::registerTransformsPasses(); | ||
|
||
// NVQPP passes | ||
opt::registerOptCodeGenPasses(); | ||
opt::registerOptTransformsPasses(); | ||
opt::registerAggressiveEarlyInlining(); | ||
|
||
// Pipelines | ||
opt::registerUnrollingPipeline(); | ||
opt::registerToExecutionManagerCCPipeline(); | ||
opt::registerTargetPipelines(); | ||
opt::registerWireSetToProfileQIRPipeline(); | ||
opt::registerMappingPipeline(); | ||
} | ||
|
||
} // namespace cudaq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ add_mlir_dialect_library(OptimBuilder | |
|
||
LINK_LIBS PUBLIC | ||
MLIRIR | ||
MLIRParser | ||
CCDialect | ||
QuakeDialect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.