1
- workspace (name = "Reactant" )
1
+ load ("@bazel_tools//tools/build_defs/repo:http.bzl" , "http_archive" )
2
+
3
+ NSYNC_COMMIT = "82b118aa7ace3132e517e2c467f8732978cf4023"
4
+ NSYNC_SHA256 = ""
5
+ http_archive (
6
+ name = "nsync" ,
7
+ sha256 = NSYNC_SHA256 ,
8
+ strip_prefix = "nsync-" + NSYNC_COMMIT ,
9
+ urls = ["https://github.com/wsmoses/nsync/archive/{commit}.tar.gz" .format (commit = NSYNC_COMMIT )],
10
+ )
11
+
12
+ ENZYMEXLA_COMMIT = "74046d05089c02946058f8fd94ed23efd0bf3ccc"
13
+ ENZYMEXLA_SHA256 = ""
14
+
15
+ http_archive (
16
+ name = "enzyme_ad" ,
17
+ sha256 = ENZYMEXLA_SHA256 ,
18
+ strip_prefix = "Enzyme-JAX-" + ENZYMEXLA_COMMIT ,
19
+ urls = ["https://github.com/EnzymeAD/Enzyme-JAX/archive/{commit}.tar.gz" .format (commit = ENZYMEXLA_COMMIT )],
20
+ )
21
+
22
+
23
+ http_archive (
24
+ name = "rules_python" ,
25
+ sha256 = "778aaeab3e6cfd56d681c89f5c10d7ad6bf8d2f1a72de9de55b23081b2d31618" ,
26
+ strip_prefix = "rules_python-0.34.0" ,
27
+ url = "https://github.com/bazelbuild/rules_python/releases/download/0.34.0/rules_python-0.34.0.tar.gz" ,
28
+ )
2
29
3
- load ("//third_party/nsync:workspace.bzl" , nsync_workspace = "repo" )
4
- nsync_workspace ()
30
+ # Hedron's Compile Commands Extractor for Bazel
31
+ # https://github.com/hedronvision/bazel-compile-commands-extractor
32
+ http_archive (
33
+ name = "hedron_compile_commands" ,
5
34
6
- load ("//third_party/rules_python:workspace.bzl" , rules_python_workspace = "repo" )
7
- rules_python_workspace ()
35
+ # Replace the commit hash (0e990032f3c5a866e72615cf67e5ce22186dcb97) in both places (below) with the latest (https://github.com/hedronvision/bazel-compile-commands-extractor/commits/main), rather than using the stale one here.
36
+ # Even better, set up Renovate and let it do the work for you (see "Suggestion: Updates" in the README).
37
+ url = "https://github.com/hedronvision/bazel-compile-commands-extractor/archive/4f28899228fb3ad0126897876f147ca15026151e.tar.gz" ,
38
+ strip_prefix = "bazel-compile-commands-extractor-4f28899228fb3ad0126897876f147ca15026151e" ,
39
+ # When you first run this tool, it'll recommend a sha256 hash to put here with a message like: "DEBUG: Rule 'hedron_compile_commands' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = ..."
40
+ )
41
+ load ("@hedron_compile_commands//:workspace_setup.bzl" , "hedron_compile_commands_setup" )
42
+ hedron_compile_commands_setup ()
43
+ load ("@hedron_compile_commands//:workspace_setup_transitive.bzl" , "hedron_compile_commands_setup_transitive" )
44
+ hedron_compile_commands_setup_transitive ()
45
+ load ("@hedron_compile_commands//:workspace_setup_transitive_transitive.bzl" , "hedron_compile_commands_setup_transitive_transitive" )
46
+ hedron_compile_commands_setup_transitive_transitive ()
47
+ load ("@hedron_compile_commands//:workspace_setup_transitive_transitive_transitive.bzl" , "hedron_compile_commands_setup_transitive_transitive_transitive" )
48
+ hedron_compile_commands_setup_transitive_transitive_transitive ()
8
49
9
- load ("//third_party/enzyme_ad:workspace.bzl" , enzyme_ad_workspace = "repo" )
10
- enzyme_ad_workspace ()
50
+ load ("@enzyme_ad//:workspace.bzl" , "JAX_COMMIT" , "JAX_SHA256" , "ENZYME_COMMIT" , "ENZYME_SHA256" , "XLA_PATCHES" )
51
+
52
+ XLA_PATCHES = XLA_PATCHES + [
53
+ """
54
+ sed -i.bak0 "s/__cpp_lib_hardware_interference_size/HW_INTERFERENCE_SIZE/g" xla/backends/cpu/runtime/thunk_executor.h
55
+ """ ,
56
+ """
57
+ sed -i.bak0 "s/__cpp_lib_hardware_interference_size/HW_INTERFERENCE_SIZE/g" xla/stream_executor/host/host_kernel.cc
58
+ """ ,
59
+ """
60
+ sed -i.bak0 "s/__cpp_lib_hardware_interference_size/HW_INTERFERENCE_SIZE/g" xla/tsl/concurrency/async_value_ref.h
61
+ """ ,
62
+ """
63
+ sed -i.bak0 "s/patch_cmds = \\ [/patch_cmds = \\ [\\ \" find . -type f -name config.bzl -exec sed -i.bak0 's\\ /HAVE_LINK_H=1\\ /HAVE_LINK_H=0\\ /g' {} +\\ \" ,/g" third_party/llvm/workspace.bzl
64
+ """ ,
65
+ """
66
+ sed -i.bak0 "s/patch_cmds = \\ [/patch_cmds = \\ [\\ \" find . -type f -name config.bzl -exec sed -i.bak0 's\\ /LLVM_ENABLE_THREADS=1\\ /LLVM_ENABLE_THREADS=0\\ /g' {} +\\ \" ,/g" third_party/llvm/workspace.bzl
67
+ """ ,
68
+ """
69
+ sed -i.bak0 "s/patch_cmds = \\ [/patch_cmds = \\ [\\ \" find . -type f -name config.bzl -exec sed -i.bak0 's\\ /HAVE_MALLINFO=1\\ /DONT_HAVE_ANY_MALLINFO=0\\ /g' {} +\\ \" ,/g" third_party/llvm/workspace.bzl
70
+ """ ,
71
+ """
72
+ sed -i.bak0 "s/patch_cmds = \\ [/patch_cmds = \\ [\\ \" find . -type f -name config.bzl -exec sed -i.bak0 's\\ /HAVE_PTHREAD_GETNAME_NP=1\\ /FAKE_HAVE_PTHREAD_GETNAME_NP=0\\ /g' {} +\\ \" ,/g" third_party/llvm/workspace.bzl
73
+ """ ,
74
+ """
75
+ sed -i.bak0 "s/patch_cmds = \\ [/patch_cmds = \\ [\\ \" find . -type f -name config.bzl -exec sed -i.bak0 's\\ /HAVE_PTHREAD_SETNAME_NP=1\\ /FAKE_HAVE_PTHREAD_SETNAME_NP=0\\ /g' {} +\\ \" ,/g" third_party/llvm/workspace.bzl
76
+ """ ,
77
+ """
78
+ sed -i.bak0 "s/patch_cmds = \\ [/patch_cmds = \\ [\\ \" find . -type f -name config.h -exec sed -i.bak0 's\\ /ENABLE_CRASH_OVERRIDES 1\\ /ENABLE_CRASH_OVERRIDES 0\\ /g' {} +\\ \" ,/g" third_party/llvm/workspace.bzl
79
+ """ ,
80
+ """
81
+ sed -i.bak0 "s/patch_cmds = \\ [/patch_cmds = \\ [\\ \" find . -type f -name config.h -exec sed -i.bak0 's\\ /HAVE_PTHREAD_GETNAME_NP\\ /FAKE_HAVE_PTHREAD_GETNAME_NP\\ /g' {} +\\ \" ,/g" third_party/llvm/workspace.bzl
82
+ """ ,
83
+ """
84
+ sed -i.bak0 "s/patch_cmds = \\ [/patch_cmds = \\ [\\ \" find . -type f -name config.h -exec sed -i.bak0 's\\ /HAVE_PTHREAD_SETNAME_NP\\ /FAKE_HAVE_PTHREAD_SETNAME_NP\\ /g' {} +\\ \" ,/g" third_party/llvm/workspace.bzl
85
+ """ ,
86
+ # """
87
+ # sed -i.bak0 "s/patch_cmds = \\[/patch_cmds = \\['find . -type f -name BUILD.bazel -exec sed -i.bak0 \\\\\\'s\\/\\\"CAPIIR\\\",\\/\\\"CAPIIR\\\",alwayslink=1,\\/g\\\\\\\\' {} +',/g" third_party/llvm/workspace.bzl
88
+ # """,
89
+ ]
11
90
12
- load ("//third_party/rules_cc:workspace.bzl" , rules_cc_workspace = "repo" )
13
- rules_cc_workspace ()
91
+ LLVM_TARGETS = select ({
92
+ "@bazel_tools//src/conditions:windows" : ["AMDGPU" , "NVPTX" ],
93
+ "@bazel_tools//src/conditions:darwin" : [],
94
+ "//conditions:default" : ["AMDGPU" , "NVPTX" ],
95
+ }) + ["AArch64" , "X86" , "ARM" ]
14
96
15
- load ("@rules_cc//cc:repositories.bzl" , "rules_cc_dependencies" )
16
- rules_cc_dependencies ()
97
+ http_archive (
98
+ name = "jax" ,
99
+ sha256 = JAX_SHA256 ,
100
+ strip_prefix = "jax-" + JAX_COMMIT ,
101
+ urls = ["https://github.com/google/jax/archive/{commit}.tar.gz" .format (commit = JAX_COMMIT )],
102
+ patch_args = ["-p1" ],
103
+ patches = ["@enzyme_ad//:patches/jax.patch" ],
104
+ )
17
105
18
- load ("//third_party/jax:workspace.bzl" , jax_workspace = "repo" )
19
- jax_workspace ()
106
+ load ("@jax//third_party/xla:workspace.bzl" , "XLA_COMMIT" , "XLA_SHA256" )
20
107
21
- load ("//third_party/xla:workspace.bzl" , xla_workspace = "repo" )
22
- xla_workspace ()
108
+ http_archive (
109
+ name = "xla" ,
110
+ sha256 = XLA_SHA256 ,
111
+ strip_prefix = "xla-" + XLA_COMMIT ,
112
+ urls = ["https://github.com/wsmoses/xla/archive/{commit}.tar.gz" .format (commit = XLA_COMMIT )],
113
+ patch_cmds = XLA_PATCHES
114
+ )
23
115
24
116
load ("@xla//third_party/py:python_init_rules.bzl" , "python_init_rules" )
25
117
python_init_rules ()
26
-
118
+
27
119
load ("@xla//third_party/py:python_init_repositories.bzl" , "python_init_repositories" )
28
120
python_init_repositories (
29
121
requirements = {
@@ -34,7 +126,7 @@ python_init_repositories(
34
126
"3.13" : "//build:requirements_lock_3_13.txt" ,
35
127
},
36
128
)
37
-
129
+
38
130
load ("@xla//third_party/py:python_init_toolchains.bzl" , "python_init_toolchains" )
39
131
python_init_toolchains ()
40
132
#
@@ -52,24 +144,42 @@ python_init_toolchains()
52
144
#
53
145
# pip_install_dependencies()
54
146
55
- load ("//third_party/enzyme:workspace.bzl" , enzyme_workspace = "repo" )
56
- enzyme_workspace ()
147
+ http_archive (
148
+ name = "enzyme" ,
149
+ sha256 = ENZYME_SHA256 ,
150
+ strip_prefix = "Enzyme-" + ENZYME_COMMIT + "/enzyme" ,
151
+ urls = ["https://github.com/EnzymeAD/Enzyme/archive/{commit}.tar.gz" .format (commit = ENZYME_COMMIT )],
152
+ )
57
153
58
- load ("//third_party/build_bazel_rules_apple:workspace.bzl" , build_bazel_rules_apple_workspace = "repo" )
59
- build_bazel_rules_apple_workspace ()
154
+ http_archive (
155
+ name = "build_bazel_rules_apple" ,
156
+ sha256 = "34c41bfb59cdaea29ac2df5a2fa79e5add609c71bb303b2ebb10985f93fa20e7" ,
157
+ url = "https://github.com/bazelbuild/rules_apple/releases/download/3.1.1/rules_apple.3.1.1.tar.gz" ,
158
+ )
60
159
61
160
load (
62
161
"@build_bazel_rules_apple//apple:repositories.bzl" ,
63
162
"apple_rules_dependencies" ,
64
163
)
164
+
65
165
apple_rules_dependencies ()
66
166
67
- load ("//third_party/upb:workspace.bzl" , upb_workspace = "repo" )
68
- upb_workspace ()
167
+
168
+ http_archive (
169
+ name = "upb" ,
170
+ sha256 = "61d0417abd60e65ed589c9deee7c124fe76a4106831f6ad39464e1525cef1454" ,
171
+ strip_prefix = "upb-9effcbcb27f0a665f9f345030188c0b291e32482" ,
172
+ patch_cmds = [
173
+ "sed -i.bak0 's/@bazel_tools\\ /\\ /platforms:windows/@platforms\\ /\\ /os:windows/g' BUILD" ,
174
+ "sed -i.bak0 's/-Werror//g' BUILD"
175
+ ],
176
+ url = "https://github.com/protocolbuffers/upb/archive/9effcbcb27f0a665f9f345030188c0b291e32482.tar.gz"
177
+ )
69
178
70
179
load ("@jax//third_party/xla:workspace.bzl" , jax_xla_workspace = "repo" )
71
180
jax_xla_workspace ()
72
181
182
+
73
183
load ("@xla//:workspace4.bzl" , "xla_workspace4" )
74
184
xla_workspace4 ()
75
185
@@ -78,12 +188,6 @@ xla_workspace3()
78
188
79
189
load ("@xla//:workspace2.bzl" , "xla_workspace2" )
80
190
81
- LLVM_TARGETS = select ({
82
- "@bazel_tools//src/conditions:windows" : ["AMDGPU" , "NVPTX" ],
83
- "@bazel_tools//src/conditions:darwin" : [],
84
- "//conditions:default" : ["AMDGPU" , "NVPTX" ],
85
- }) + ["AArch64" , "X86" , "ARM" ]
86
-
87
191
load ("@llvm-raw//utils/bazel:configure.bzl" , "llvm_configure" )
88
192
llvm_configure (name = "llvm-project" , targets = LLVM_TARGETS )
89
193
xla_workspace2 ()
@@ -101,6 +205,7 @@ load(
101
205
"@tsl//third_party/gpus/cuda/hermetic:cuda_json_init_repository.bzl" ,
102
206
"cuda_json_init_repository" ,
103
207
)
208
+
104
209
cuda_json_init_repository ()
105
210
106
211
load (
@@ -113,9 +218,11 @@ load(
113
218
"cuda_redist_init_repositories" ,
114
219
"cudnn_redist_init_repository" ,
115
220
)
221
+
116
222
cuda_redist_init_repositories (
117
223
cuda_redistributions = CUDA_REDISTRIBUTIONS ,
118
224
)
225
+
119
226
cudnn_redist_init_repository (
120
227
cudnn_redistributions = CUDNN_REDISTRIBUTIONS ,
121
228
)
@@ -124,31 +231,19 @@ load(
124
231
"@tsl//third_party/gpus/cuda/hermetic:cuda_configure.bzl" ,
125
232
"cuda_configure" ,
126
233
)
234
+
127
235
cuda_configure (name = "local_config_cuda" )
128
236
129
237
load (
130
238
"@tsl//third_party/nccl/hermetic:nccl_redist_init_repository.bzl" ,
131
239
"nccl_redist_init_repository" ,
132
240
)
241
+
133
242
nccl_redist_init_repository ()
134
243
135
244
load (
136
245
"@tsl//third_party/nccl/hermetic:nccl_configure.bzl" ,
137
246
"nccl_configure" ,
138
247
)
139
- nccl_configure (name = "local_config_nccl" )
140
-
141
- load ("@enzyme_ad//third_party/hedron_compile_commands:workspace.bzl" , hedron_compile_commands_workspace = "repo" )
142
- hedron_compile_commands_workspace ()
143
-
144
- load ("@hedron_compile_commands//:workspace_setup.bzl" , "hedron_compile_commands_setup" )
145
- hedron_compile_commands_setup ()
146
-
147
- load ("@hedron_compile_commands//:workspace_setup_transitive.bzl" , "hedron_compile_commands_setup_transitive" )
148
- hedron_compile_commands_setup_transitive ()
149
-
150
- load ("@hedron_compile_commands//:workspace_setup_transitive_transitive.bzl" , "hedron_compile_commands_setup_transitive_transitive" )
151
- hedron_compile_commands_setup_transitive_transitive ()
152
248
153
- load ("@hedron_compile_commands//:workspace_setup_transitive_transitive_transitive.bzl" , "hedron_compile_commands_setup_transitive_transitive_transitive" )
154
- hedron_compile_commands_setup_transitive_transitive_transitive ()
249
+ nccl_configure (name = "local_config_nccl" )
0 commit comments