-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[cmake] Fix CMake target dependencies for C++ layer #3325
Merged
Merged
Conversation
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 commit wires up some missing dependencies when we are not turning `TRITON_BUILD_PYTHON_MODULE` on: - Still include third_party CodeGen backends - Properly query `triton_libs`, `dialect_libs`, `conversion_libs` - Exclude third_party python directories if not building Python This enables a development flow where the focus is on the lower C++ layer. For such cases we can iterate fast with normal CMake and ninja. It also makes it easier to leverage CMake to generate `compile_commands.json` for workflows where we use Clangd in editors in terminals. With this, the following commands fully works: ``` cmake -GNinja -S . -B build-debug \ -DTRITON_BUILD_PYTHON_MODULE=OFF \ -DTRITON_CODEGEN_BACKENDS="amd;nvidia" \ -DCMAKE_BUILD_TYPE=Debug \ -DLLVM_INCLUDE_DIRS=$HOME/llvm/build-mlir/include \ -DLLVM_LIBRARY_DIR=$HOME/llvm/build-mlir/lib \ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \ -DCMAKE_LINKER=lld \ -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld \ -DCMAKE_MODULE_LINKER_FLAGS=-fuse-ld=lld \ -DCMAKE_SHARED_LINKER_FLAGS=-fuse-ld=lld \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON cmake --build build-debug ```
antiagainst
force-pushed
the
cmake-compilation
branch
from
March 8, 2024 08:18
71a7119
to
b1822c5
Compare
ThomasRaoux
approved these changes
Mar 8, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Lei!
htyu
pushed a commit
to htyu/triton
that referenced
this pull request
Mar 20, 2024
This commit wires up some missing dependencies when we are not turning `TRITON_BUILD_PYTHON_MODULE` on: - Still include third_party CodeGen backends - Properly query `triton_libs`, `dialect_libs`, `conversion_libs` - Exclude third_party python directories if not building Python This enables a development flow where the focus is on the lower C++ layer. For such cases we can iterate fast with normal CMake and ninja. It also makes it easier to leverage CMake to generate `compile_commands.json` for workflows where we use Clangd in editors in terminals. With this, the following commands fully works: ``` cmake -GNinja -S . -B build-debug \ -DTRITON_BUILD_PYTHON_MODULE=OFF \ -DTRITON_CODEGEN_BACKENDS="amd;nvidia" \ -DCMAKE_BUILD_TYPE=Debug \ -DLLVM_INCLUDE_DIRS=$HOME/llvm/build-mlir/include \ -DLLVM_LIBRARY_DIR=$HOME/llvm/build-mlir/lib \ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \ -DCMAKE_LINKER=lld \ -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld \ -DCMAKE_MODULE_LINKER_FLAGS=-fuse-ld=lld \ -DCMAKE_SHARED_LINKER_FLAGS=-fuse-ld=lld \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON cmake --build build-debug ```
karupayun
pushed a commit
to openxla/triton
that referenced
this pull request
Apr 3, 2024
This commit wires up some missing dependencies when we are not turning `TRITON_BUILD_PYTHON_MODULE` on: - Still include third_party CodeGen backends - Properly query `triton_libs`, `dialect_libs`, `conversion_libs` - Exclude third_party python directories if not building Python This enables a development flow where the focus is on the lower C++ layer. For such cases we can iterate fast with normal CMake and ninja. It also makes it easier to leverage CMake to generate `compile_commands.json` for workflows where we use Clangd in editors in terminals. With this, the following commands fully works: ``` cmake -GNinja -S . -B build-debug \ -DTRITON_BUILD_PYTHON_MODULE=OFF \ -DTRITON_CODEGEN_BACKENDS="amd;nvidia" \ -DCMAKE_BUILD_TYPE=Debug \ -DLLVM_INCLUDE_DIRS=$HOME/llvm/build-mlir/include \ -DLLVM_LIBRARY_DIR=$HOME/llvm/build-mlir/lib \ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \ -DCMAKE_LINKER=lld \ -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld \ -DCMAKE_MODULE_LINKER_FLAGS=-fuse-ld=lld \ -DCMAKE_SHARED_LINKER_FLAGS=-fuse-ld=lld \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON cmake --build build-debug ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit wires up some missing dependencies when we are not turning
TRITON_BUILD_PYTHON_MODULE
on:triton_libs
,dialect_libs
,conversion_libs
This enables a development flow where the focus is on the lower C++ layer. For such cases we can iterate fast with normal CMake and ninja. It also makes it easier to leverage CMake to generate
compile_commands.json
for workflows where we use Clangd in editors in terminals.With this, the following commands fully works: