Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 7 additions & 7 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ use_repo(pybind11_internal_configure, "pybind11")
##############################################################
# CUDA

cuda_configure_ext = use_extension("//third_party/extensions:cuda_configure.bzl", "cuda_configure_ext")
cuda_configure_ext = use_extension("//extensions:cuda_configure.bzl", "cuda_configure_ext")
use_repo(cuda_configure_ext, "local_config_cuda")

cuda_json_ext = use_extension("//third_party/extensions:cuda_json.bzl", "cuda_json_ext")
cuda_json_ext = use_extension("//extensions:cuda_json.bzl", "cuda_json_ext")
use_repo(cuda_json_ext, "cuda_redist_json")

cuda_redist_init_ext = use_extension("//third_party/extensions:cuda_redist_init.bzl", "cuda_redist_init_ext")
cuda_redist_init_ext = use_extension("//extensions:cuda_redist_init.bzl", "cuda_redist_init_ext")
use_repo(
cuda_redist_init_ext,
"cuda_cccl",
Expand All @@ -51,22 +51,22 @@ use_repo(
##############################################################
# NCCL configuration

nccl_redist = use_extension("//third_party/extensions:nccl_redist.bzl", "nccl_redist_ext")
nccl_redist = use_extension("//extensions:nccl_redist.bzl", "nccl_redist_ext")
use_repo(nccl_redist, "cuda_nccl")

nccl_configure = use_extension("//third_party/extensions:nccl_configure.bzl", "nccl_configure_ext")
nccl_configure = use_extension("//extensions:nccl_configure.bzl", "nccl_configure_ext")
use_repo(nccl_configure, "local_config_nccl")

##############################################################
# SYCL configuration

sycl_configure = use_extension("//third_party/extensions:sycl_configure.bzl", "sycl_configure_ext")
sycl_configure = use_extension("//extensions:sycl_configure.bzl", "sycl_configure_ext")
use_repo(sycl_configure, "local_config_sycl")

##############################################################
# Hermetic toolchain configuration

toolchain = use_extension("//third_party/extensions:toolchain.bzl", "toolchain_ext")
toolchain = use_extension("//extensions:toolchain.bzl", "toolchain_ext")
use_repo(
toolchain,
"llvm18_linux_aarch64",
Expand Down
2 changes: 1 addition & 1 deletion cc/deps/cc_toolchain_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:local.bzl", "new_local_repository")
load("//common:mirrored_http_archive.bzl", "mirrored_http_archive")
load("//common:tar_extraction_utils.bzl", "tool_archive")
load("//third_party:repo.bzl", "tf_mirror_urls")
load("//common:repo.bzl", "tf_mirror_urls")
load("//cc/llvms:llvm.bzl", "llvm")
load("//cc/sysroots:sysroot.bzl", "sysroot")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ DESCRIPTION:

NOTES:
Changes to the contents of this file must be propagated from
//third_party/gpus/crosstool/crosstool_wrapper_is_not_gcc to
//third_party/gpus/crosstool/v*/*/clang/bin/crosstool_wrapper_is_not_gcc
//gpu/cuda/legacy/crosstool/crosstool_wrapper_is_not_gcc to
//gpu/cuda/legacy/crosstool/v*/*/clang/bin/crosstool_wrapper_is_not_gcc
"""

__author__ = 'keveman@google.com (Manjunath Kudlur)'
Expand Down
4 changes: 2 additions & 2 deletions cc/impls/linux_x86_64_linux_x86_64_cuda/wrappers/nvcc_wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ DESCRIPTION:

NOTES:
Changes to the contents of this file must be propagated from
//third_party/gpus/crosstool/crosstool_wrapper_is_not_gcc to
//third_party/gpus/crosstool/v*/*/clang/bin/crosstool_wrapper_is_not_gcc
//gpu/cuda/legacy/crosstool/crosstool_wrapper_is_not_gcc to
//gpu/cuda/legacy/crosstool/v*/*/clang/bin/crosstool_wrapper_is_not_gcc
"""

__author__ = 'keveman@google.com (Manjunath Kudlur)'
Expand Down
2 changes: 1 addition & 1 deletion cc/llvms/llvm.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# ==============================================================================

load(
"//third_party/remote_config:common.bzl",
"//common:common.bzl",
"get_host_environ",
)

Expand Down
2 changes: 1 addition & 1 deletion cc/sysroots/sysroot.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# ==============================================================================

load(
"//third_party/remote_config:common.bzl",
"//common:common.bzl",
"get_host_environ",
)

Expand Down
35 changes: 35 additions & 0 deletions common/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ config_setting(
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
visibility = ["//visibility:public"],
)

config_setting(
Expand All @@ -83,6 +84,27 @@ config_setting(
"@platforms//os:linux",
"@platforms//cpu:aarch64",
],
visibility = ["//visibility:public"],
)

config_setting(
name = "is_linux_armhf",
constraint_values =
[
"@platforms//cpu:armv7e-mf",
"@platforms//os:linux",
],
visibility = ["//visibility:public"],
)

config_setting(
name = "is_linux_ppc64le",
constraint_values =
[
"@platforms//cpu:ppc64le",
"@platforms//os:linux",
],
visibility = ["//visibility:public"],
)

#######################################################
Expand Down Expand Up @@ -137,6 +159,19 @@ config_setting(
flag_values = {":enable_cuda": "False"},
)

# Config setting for CUDA stub rpaths.
bool_flag(
name = "cuda_rpath",
build_setting_default = True,
)

config_setting(
name = "enable_cuda_rpath",
flag_values = {
":cuda_rpath": "True",
"@local_config_cuda//:enable_cuda": "True"
},
)
#######################################################
# Enable SYCL support flags

Expand Down
File renamed without changes.
File renamed without changes.
19 changes: 0 additions & 19 deletions third_party/repo.bzl → common/repo.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -139,22 +139,3 @@ def tf_http_archive(name, sha256, urls, **kwargs):
urls = urls,
**kwargs
)

def _tf_vendored_impl(repository_ctx):
parent_path = repository_ctx.path(repository_ctx.attr.parent).dirname

# get_child doesn't allow slashes. Yes this is silly. bazel_skylib paths
# doesn't work with path objects.
relpath_parts = repository_ctx.attr.relpath.split("/")
vendored_path = parent_path
for part in relpath_parts:
vendored_path = vendored_path.get_child(part)
repository_ctx.symlink(vendored_path, ".")

tf_vendored = repository_rule(
implementation = _tf_vendored_impl,
attrs = {
"parent": attr.label(default = "//:WORKSPACE"),
"relpath": attr.string(),
},
)
2 changes: 1 addition & 1 deletion common/tar_extraction_utils.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# ==============================================================================

load(
"//third_party/remote_config:common.bzl",
"//common:common.bzl",
"execute",
"get_bash_bin",
)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"""CUDA module extension."""

load(
"//third_party/gpus/cuda/hermetic:cuda_configure.bzl",
"//gpu/cuda:cuda_configure.bzl",
"cuda_configure",
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Common compiler functions. """

load(
"//third_party/remote_config:common.bzl",
"//common:common.bzl",
"err_out",
"raw_exec",
"realpath",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
licenses(["restricted"]) # NVIDIA proprietary license
load(
"@rules_ml_toolchain//third_party/gpus:nvidia_common_rules.bzl",
"@rules_ml_toolchain//gpu:nvidia_common_rules.bzl",
"cuda_lib_header_prefix"
)
load("@cuda_cudart//:version.bzl", _cudart_version = "VERSION")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ load(
"if_cuda_newer_than",
)
load(
"@rules_ml_toolchain//third_party/gpus:nvidia_common_rules.bzl",
"@rules_ml_toolchain//gpu:nvidia_common_rules.bzl",
"cuda_rpath_flags",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ load(
"if_cuda_newer_than",
)
load(
"@rules_ml_toolchain//third_party/gpus:nvidia_common_rules.bzl",
"@rules_ml_toolchain//gpu:nvidia_common_rules.bzl",
"cuda_rpath_flags",
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
licenses(["restricted"]) # NVIDIA proprietary license
load(
"@rules_ml_toolchain//third_party/gpus:nvidia_common_rules.bzl",
"@rules_ml_toolchain//gpu:nvidia_common_rules.bzl",
"cuda_rpath_flags",
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
licenses(["restricted"]) # NVIDIA proprietary license
load(
"@rules_ml_toolchain//third_party/gpus:nvidia_common_rules.bzl",
"@rules_ml_toolchain//gpu:nvidia_common_rules.bzl",
"cuda_rpath_flags",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ load(
"if_cuda_newer_than",
)
load(
"@rules_ml_toolchain//third_party/gpus:nvidia_common_rules.bzl",
"@rules_ml_toolchain//gpu:nvidia_common_rules.bzl",
"cuda_rpath_flags",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load(
"if_version_equal_or_greater_than",
)
load(
"@rules_ml_toolchain//third_party/gpus:nvidia_common_rules.bzl",
"@rules_ml_toolchain//gpu:nvidia_common_rules.bzl",
"cuda_rpath_flags",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ load(
"if_cuda_newer_than",
)
load(
"@rules_ml_toolchain//third_party/gpus:nvidia_common_rules.bzl",
"@rules_ml_toolchain//gpu:nvidia_common_rules.bzl",
"cuda_rpath_flags",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ load(
"if_cuda_newer_than",
)
load(
"@rules_ml_toolchain//third_party/gpus:nvidia_common_rules.bzl",
"@rules_ml_toolchain//gpu:nvidia_common_rules.bzl",
"cuda_rpath_flags",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ load(
"if_cuda_newer_than",
)
load(
"@rules_ml_toolchain//third_party/gpus:nvidia_common_rules.bzl",
"@rules_ml_toolchain//gpu:nvidia_common_rules.bzl",
"cuda_rpath_flags",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ load(
"if_cuda_newer_than",
)
load(
"@rules_ml_toolchain//third_party/gpus:nvidia_common_rules.bzl",
"@rules_ml_toolchain//gpu:nvidia_common_rules.bzl",
"cuda_rpath_flags",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ load(
"if_cuda_newer_than",
)
load(
"@rules_ml_toolchain//third_party/gpus:nvidia_common_rules.bzl",
"@rules_ml_toolchain//gpu:nvidia_common_rules.bzl",
"cuda_rpath_flags",
)

Expand Down
File renamed without changes.
File renamed without changes.
Loading
Loading