-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMODULE.bazel
More file actions
140 lines (114 loc) · 5.44 KB
/
MODULE.bazel
File metadata and controls
140 lines (114 loc) · 5.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
"""
Copyright 2025 He Jia <mofhejia@163.com>. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================
"""
module(
name = "execution-ucx",
version = "0.0.1",
bazel_compatibility = [">=7.0.0"],
compatibility_level = 0,
)
# setting cuda toolchain
bazel_dep(name = "rules_cuda", version = "0.2.5")
cuda = use_extension("@rules_cuda//cuda:extensions.bzl", "toolchain")
cuda.local_toolchain(
name = "local_cuda",
toolkit_path = "",
# toolkit_path = "/opt/nvidia/hpc_sdk/Linux_x86_64/2024/cuda/", # Specify local CUDA toolkit path
)
use_repo(cuda, "local_cuda")
# # setting Nvidia stdexec as default tensor container for replacing libunifex
# stdexec_deps = use_extension("//third_party/nvidia_stdexec:extensions.bzl", "nvidia_stdexec_dep")
# use_repo(stdexec_deps, "stdexec")
# setting Meta libunifex as default CPP stdexec implement
bazel_dep(name = "liburing", version = "2.10")
unifex_deps = use_extension("//third_party/libunifex:extensions.bzl", "libunifex_dep")
use_repo(unifex_deps, "unifex")
# setting UCX for communication library
ucx_deps = use_extension("//third_party/openucx:extensions.bzl", "openucx_dependencie")
# ucx_deps.ucx_library(name = "ucx", ucx_path = "/opt/nvidia/hpc_sdk/Linux_x86_64/2024/comm_libs/12.5/hpcx/latest/ucx/") # A local UCX path
ucx_deps.ucx_git(
name = "ucx",
tag = "v1.20.0",
)
use_repo(ucx_deps, "ucx")
# setting cista for RPC serialization/deserialization
cista_deps = use_extension("//third_party/cista:extensions.bzl", "cista_dep")
use_repo(cista_deps, "cista")
# setting plf::hive for object hive
hive_deps = use_extension("//third_party/plf_hive:extensions.bzl", "plf_hive_dep")
use_repo(hive_deps, "plf_hive")
# setting dlpack for tensor packaging
dlpack_deps = use_extension("//third_party/dlpack:extensions.bzl", "dlpack_dep")
use_repo(dlpack_deps, "dlpack")
# setting avro for RPC checkpointing convertor
bazel_dep(name = "avro-cpp", version = "1.12.0")
# setting proxy for next generation polymorphism in C++
proxy_deps = use_extension("//third_party/proxy:extensions.bzl", "proxy_dep")
use_repo(proxy_deps, "proxy")
# setting nanobind for Python bindings
bazel_dep(name = "nanobind", version = "2.9.2")
# Override bzip2 for pybind11 project to fix the POSIX compatibility issue
bzip2_deps = use_extension("//third_party/bzip2:extensions.bzl", "bzip2_dep")
use_repo(bzip2_deps, "bzip2")
# setting rules_python for Python test dependencies
# Note: python_version is not specified to allow users to use their preferred Python version
# The package supports Python 3.8+ (compatible with nanobind 2.9.2)
#
# To build wheels for multiple Python versions:
# 1. Use different Python toolchain configurations via --config flags
# 2. Build with: bazel build //axon/python:wheel --config=python38
# 3. Or set HERMETIC_PYTHON_VERSION environment variable:
# HERMETIC_PYTHON_VERSION=3.10 bazel build //axon/python:wheel
#
# For C++ extension modules, each Python version requires a separate build
# because the extension is compiled against a specific Python ABI.
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
# Set default Python version to 3.10
# Users can override this by:
# - Setting HERMETIC_PYTHON_VERSION environment variable
# - Using --config=python38, --config=python39, etc. in .bazelrc
# - Overriding in their own MODULE.bazel
python.toolchain(
python_version = "3.10",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
# Use the same Python version as the toolchain
# This ensures pip dependencies are resolved for the correct Python version
pip.parse(
hub_name = "python_deps",
python_version = "3.10", # Must match python.toolchain python_version
requirements_lock = "//axon/python:requirements_lock.txt",
)
use_repo(pip, "python_deps")
# basic bazel dependencies
bazel_dep(name = "rules_shell", version = "0.6.1")
bazel_dep(name = "rules_cc", version = "0.2.12-rc2")
bazel_dep(name = "rules_foreign_cc", version = "0.12.0")
bazel_dep(name = "rules_python", version = "0.36.0")
# Hedron's Compile Commands Extractor for Bazel
# https://github.com/hedronvision/bazel-compile-commands-extractor
bazel_dep(name = "hedron_compile_commands", dev_dependency = True)
git_override(
module_name = "hedron_compile_commands",
commit = "abb61a688167623088f8768cc9264798df6a9d10",
remote = "https://github.com/hedronvision/bazel-compile-commands-extractor.git",
# Replace the commit hash (above) with the latest (https://github.com/hedronvision/bazel-compile-commands-extractor/commits/main).
# Even better, set up Renovate and let it do the work for you (see "Suggestion: Updates" in the README).
)
bazel_dep(name = "platforms", version = "0.0.11")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "googletest", version = "1.16.0.bcr.1")
register_toolchains(
"@local_cuda//toolchain:nvcc-local-toolchain",
"@local_cuda//toolchain/clang:clang-local-toolchain",
)