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

[1/N] Bazel build rules for building TRT-MLIR dialect, running dialect lit tests #298

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e4a3f61
bazel build initial dump
sjain-stanford Oct 8, 2024
8c7d2aa
TensorRTUtils, TensorRTCommonUtils, TensorRTDialect build now; next: …
sjain-stanford Oct 8, 2024
b104ceb
TensorRTAnalysis builds now
sjain-stanford Oct 8, 2024
a30661c
TensorRTGenericClustering builds now
sjain-stanford Oct 8, 2024
13408c6
TensorRTTransforms doesn't build yet due to nvinfer tensorrt dep
sjain-stanford Oct 8, 2024
9c07bcb
TensorRTTransforms minimal working
zezhang Oct 9, 2024
eb28ac8
TensorRTPipelines got refactored into Transforms/Passes.cpp
sjain-stanford Oct 9, 2024
4da4586
TensorRTGeneralTransforms builds now
sjain-stanford Oct 9, 2024
60a8d7d
TensorRTEncodingOpInterface build fails with cuda_runtime_api.h file …
sjain-stanford Oct 9, 2024
cb995cc
rules_cuda working, TensorRTEncodingOpInterface builds now
sjain-stanford Oct 9, 2024
fa7923f
TensorRTEncodingImpl builds now
sjain-stanford Oct 9, 2024
3f07bda
TensorRTDynamicLoader builds now
sjain-stanford Oct 9, 2024
c29e6b6
TensorRTTarget builds now
sjain-stanford Oct 9, 2024
ea67ac2
TensorRTRegistration breaks, seemingly due to dialects not being regi…
sjain-stanford Oct 9, 2024
f627d4c
TensorRTRegistration works now
zezhang Oct 9, 2024
4134f79
add TensorKindOpInterfaceImpl.cpp to TensorRTDialect target
zezhang Oct 9, 2024
210c8f3
add TensorRTTensorKindInterfaces target and update TensorRTAnalysis
zezhang Oct 9, 2024
d5a5644
update TensorRTCommonUtils
zezhang Oct 9, 2024
3a5603b
build RaiseActivations and RaiseNormalizations. mlir-tensorrt-opt now…
zezhang Oct 10, 2024
0fd80af
rpath fixes for error while loading shared libraries - libnvinfer.so
sjain-stanford Oct 10, 2024
dd9e6eb
buildifier
sjain-stanford Oct 10, 2024
efbeeb9
lit tests for Dialects
sjain-stanford Oct 10, 2024
966ac08
WIP: Hermetic python setup + lit test path hacks to get dialect lit t…
sjain-stanford Oct 15, 2024
752e479
docker for bazel
sjain-stanford Oct 15, 2024
a592dab
persist bazel cache between runs
sjain-stanford Oct 15, 2024
d614610
rpath fixes and BASE_IMAGE default
sjain-stanford Oct 17, 2024
cbe09e3
bazel test //tensorrt/test:tensorrt_mlir_dialect_tests
zezhang Oct 21, 2024
375eac7
Changes to build with rebase on HEAD. Lit tests are now broken again.
sjain-stanford Oct 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions mlir-tensorrt/.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.

# TODO: migrate all dependencies from WORKSPACE to MODULE.bazel
# https://bazel.build/external/migration
common --noenable_bzlmod

# Automatically detect host platform to pick config
common --enable_platform_specific_config

###############################################################################
# Options for "generic_clang" builds: these options should generally apply to
# builds using a Clang-based compiler, and default to the `clang` executable on
# the `PATH`. While these are provided for convenience and may serve as a
# reference, it would be preferable for users to configure an explicit C++
# toolchain instead of relying on `.bazelrc` files.
###############################################################################

# Set the default compiler to the `clang` binary on the `PATH`.
build:generic_clang --repo_env=CC=clang

# C++17 standard version is required.
build:generic_clang --cxxopt=-std=c++17 --host_cxxopt=-std=c++17

# Use `-Wall` for Clang.
build:generic_clang --copt=-Wall --host_copt=-Wall

# The Clang available on MacOS has a warning that isn't clean on MLIR code. The
# warning doesn't show up with more recent Clangs, so just disable for now.
build:generic_clang --cxxopt=-Wno-range-loop-analysis --host_cxxopt=-Wno-range-loop-analysis

# Build errors are not a helpful way to enforce deprecation in-repo and it is
# not the point of the Bazel build to catch usage of deprecated APIs.
build:generic_clang --copt=-Wno-deprecated --host_copt=-Wno-deprecated


# lld links faster than other linkers. Assume that anybody using clang on linux
# also has lld available.
build:linux --linkopt=-fuse-ld=lld --host_linkopt=-fuse-ld=lld
build:linux --config=generic_clang

build:macos --config=generic_clang

# Other compilation modes
build:opt --compilation_mode=opt
build:dbg --compilation_mode=dbg

# GDB builds in dbg mode
build:gdb --config=dbg


# Continue running tests for targets that build without having
# AOT compile genrules failing to build from terminating the rest
test --keep_going


# rules_cuda convenience flags
build --flag_alias=enable_cuda=@rules_cuda//cuda:enable
build --flag_alias=cuda_archs=@rules_cuda//cuda:archs
build --flag_alias=cuda_compiler=@rules_cuda//cuda:compiler
build --flag_alias=cuda_copts=@rules_cuda//cuda:copts
build --flag_alias=cuda_host_copts=@rules_cuda//cuda:host_copts
build --flag_alias=cuda_runtime=@rules_cuda//cuda:runtime

build:generic_clang --enable_cuda=True
build:generic_clang --cuda_compiler=clang
Loading