2022-09-22 12:26:48 -07:00
|
|
|
# Copyright 2018 The JAX Authors.
|
2018-11-26 12:37:24 -08:00
|
|
|
#
|
|
|
|
# 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
|
|
|
|
#
|
|
|
|
# https://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.
|
|
|
|
|
|
|
|
# JAX is Autograd and XLA
|
|
|
|
|
2022-06-23 21:14:52 +00:00
|
|
|
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
|
2019-11-24 13:06:23 -05:00
|
|
|
load("@local_config_cuda//cuda:build_defs.bzl", "if_cuda")
|
2020-12-05 00:07:04 +01:00
|
|
|
load("@local_config_rocm//rocm:build_defs.bzl", "if_rocm")
|
2022-07-01 12:31:16 -07:00
|
|
|
load("//jaxlib:jax.bzl", "if_windows")
|
2019-08-02 11:16:15 -04:00
|
|
|
|
2018-11-26 12:37:24 -08:00
|
|
|
licenses(["notice"]) # Apache 2
|
|
|
|
|
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
|
2022-06-23 21:14:52 +00:00
|
|
|
bool_flag(
|
|
|
|
name = "enable_remote_tpu",
|
|
|
|
build_setting_default = False,
|
|
|
|
)
|
|
|
|
|
|
|
|
config_setting(
|
|
|
|
name = "remote_tpu_enabled",
|
|
|
|
flag_values = {
|
|
|
|
":enable_remote_tpu": "True",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2020-11-10 00:23:54 +08:00
|
|
|
py_binary(
|
2020-11-20 09:10:02 -05:00
|
|
|
name = "build_wheel",
|
|
|
|
srcs = ["build_wheel.py"],
|
2018-11-26 12:37:24 -08:00
|
|
|
data = [
|
2020-12-11 06:44:45 -08:00
|
|
|
"LICENSE.txt",
|
2019-04-01 08:21:22 -07:00
|
|
|
"//jaxlib",
|
2022-07-13 14:03:32 -07:00
|
|
|
"//jaxlib:README.md",
|
2020-12-11 10:18:52 -05:00
|
|
|
"//jaxlib:setup.py",
|
|
|
|
"//jaxlib:setup.cfg",
|
2022-06-29 12:50:24 -07:00
|
|
|
"@org_tensorflow//tensorflow/compiler/xla/python:xla_client",
|
2021-11-25 00:07:25 +08:00
|
|
|
] + if_windows([
|
|
|
|
"//jaxlib/mlir/_mlir_libs:jaxlib_mlir_capi.dll",
|
2022-06-23 21:14:52 +00:00
|
|
|
]) + select({
|
|
|
|
":remote_tpu_enabled": ["@org_tensorflow//tensorflow/compiler/xla/python/tpu_driver/client:py_tpu_client"],
|
|
|
|
"//conditions:default": [],
|
|
|
|
}) + if_cuda([
|
2022-05-06 13:47:23 -07:00
|
|
|
"//jaxlib/cuda:cuda_gpu_support",
|
2021-04-28 11:43:50 -04:00
|
|
|
"@local_config_cuda//cuda:cuda-nvvm",
|
2020-12-05 00:07:04 +01:00
|
|
|
]) + if_rocm([
|
2022-05-06 13:47:23 -07:00
|
|
|
"//jaxlib/rocm:rocm_gpu_support",
|
2019-08-02 11:16:15 -04:00
|
|
|
]),
|
2020-11-10 00:23:54 +08:00
|
|
|
deps = ["@bazel_tools//tools/python/runfiles"],
|
2018-11-26 12:37:24 -08:00
|
|
|
)
|