Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve binary sizes by not globing MLIR dialects/passes #2414

Merged
merged 2 commits into from
Nov 28, 2024

Conversation

boschmitt
Copy link
Collaborator

Description

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.

This PR is part of a series that address the long standing need to refactor the build system.

@boschmitt boschmitt force-pushed the improve_bin_sizes branch 3 times, most recently from e17b1c3 to fe760c2 Compare November 26, 2024 19:13
Copy link
Collaborator

@schweitzpgi schweitzpgi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

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]>
@bmhowe23 bmhowe23 enabled auto-merge (squash) November 28, 2024 03:59
@bmhowe23 bmhowe23 merged commit 58433ca into NVIDIA:main Nov 28, 2024
212 of 213 checks passed
@bettinaheim bettinaheim changed the title [nvq++][rt] Improve binary sizes by not globing MLIR dialects/passes. Improve binary sizes by not globing MLIR dialects/passes Dec 10, 2024
@bettinaheim bettinaheim added the release notes Changes need to be captured in the release notes label Dec 10, 2024
@bettinaheim bettinaheim added this to the release 0.9.1 milestone Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release notes Changes need to be captured in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants