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

Upgrade to Bazel 8.0.0 #3035

Merged
merged 74 commits into from
Mar 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
2a9eecf
Changes for MODULE.bazel
KateBlueSky Dec 17, 2024
0c2d795
Fixed workspace.
KateBlueSky Dec 18, 2024
8180488
Fixed issues with bazel.
KateBlueSky Dec 18, 2024
534d0ed
Fixed some bazel upgrade.
KateBlueSky Dec 18, 2024
0a3fcb2
Updating Module.bazel.
KateBlueSky Jan 2, 2025
3b7a19c
Added extensions for the registering of the toolchains.
KateBlueSky Jan 3, 2025
4d318ef
Some misc. updates.
KateBlueSky Jan 3, 2025
f51c249
removed the enable bazel mod needed for 7.0.0.
KateBlueSky Jan 3, 2025
3e3de12
Updated license.
KateBlueSky Jan 3, 2025
58071b1
Added the noincompatible_disallow_empty_glob flag.
KateBlueSky Jan 3, 2025
25e88fa
Reverted kmeans build.
KateBlueSky Jan 3, 2025
88f68f8
Reverted changes.
KateBlueSky Jan 3, 2025
d72e1a8
Reverted changes.
KateBlueSky Jan 3, 2025
f79bd2b
Reverted commented line for testing.
KateBlueSky Jan 3, 2025
1a66821
Updated license dates.
KateBlueSky Jan 3, 2025
6536db2
Updated formate.
KateBlueSky Jan 3, 2025
d8467fa
Updated fmt depependency to 11.1.1
KateBlueSky Jan 3, 2025
2e3a067
Merged upstream changes.
KateBlueSky Jan 3, 2025
5ee0ce0
Updated the plateforms version.
KateBlueSky Jan 6, 2025
36d49ca
Changes from main.
KateBlueSky Jan 6, 2025
558c6e3
Merged changes from workspace.
KateBlueSky Jan 6, 2025
718f096
updated the tojson was deprecated on struct.
KateBlueSky Jan 6, 2025
684b59d
Fixed the JSON statements.
KateBlueSky Jan 6, 2025
c0b886e
debuging ci process.
KateBlueSky Jan 6, 2025
f1fea0b
debuging ci process.
KateBlueSky Jan 6, 2025
b058717
rolled back debug changes.
KateBlueSky Jan 6, 2025
c7350d8
Updated directory structure.
KateBlueSky Jan 6, 2025
d6f17b8
Updated path for json file.
KateBlueSky Jan 6, 2025
d16e5e3
Updated template statement.
KateBlueSky Jan 7, 2025
b612526
more debugging.
KateBlueSky Jan 7, 2025
de99630
Added some debuging.
KateBlueSky Jan 7, 2025
0eb3c36
Updated the ubuntu version.
KateBlueSky Jan 7, 2025
91022ff
reverted debug stuff
KateBlueSky Jan 7, 2025
e458d31
Added Kmeans back in.
KateBlueSky Jan 8, 2025
a0bc98e
added the Wno-dangling-reference for gnu.
KateBlueSky Jan 8, 2025
66733d5
Updated bazel version 8.0.1
KateBlueSky Jan 8, 2025
229a2f4
Added line before eof.
KateBlueSky Jan 8, 2025
d605a2f
Changed back to 8.0.0 for testing.
KateBlueSky Jan 8, 2025
fe71f56
Merged updates on main.
KateBlueSky Jan 13, 2025
f5e9584
Merged updates on main.
KateBlueSky Jan 13, 2025
28b0dcb
Merge branch 'uxlfoundation:main' into retry_bazel_up_grade
KateBlueSky Jan 21, 2025
f9b2808
Updated bazzel version.
KateBlueSky Jan 21, 2025
4b0e979
updated license to new format.
KateBlueSky Jan 21, 2025
d8bbe96
Merge branch 'uxlfoundation:main' into retry_bazel_up_grade
KateBlueSky Jan 24, 2025
3fca50f
Merged from main.
KateBlueSky Feb 22, 2025
316f5b1
Merge branch 'uxlfoundation:main' into retry_bazel_up_grade
KateBlueSky Feb 24, 2025
09ee3c1
Test with ubuntu 22.04.
KateBlueSky Feb 24, 2025
a4db9fa
Rolled back to ubuntu 24.04 noble.
KateBlueSky Feb 24, 2025
e1533f1
One more test with 22.04
KateBlueSky Feb 25, 2025
02d498a
Changed bacck to 24.04 noble.
KateBlueSky Feb 25, 2025
5c413a0
reverting flag for testing.
KateBlueSky Feb 25, 2025
c1d5983
Removed dangling-reference.
KateBlueSky Feb 25, 2025
42c6cd6
Revert "Removed dangling-reference."
KateBlueSky Feb 25, 2025
6ddb05c
Merge branch 'uxlfoundation:main' into retry_bazel_up_grade
KateBlueSky Feb 26, 2025
5bece6a
Added flag back in.
KateBlueSky Feb 26, 2025
6b307ce
Merge branch 'retry_bazel_up_grade' of https://github.com/KateBlueSky…
KateBlueSky Feb 26, 2025
9947776
Removed the dangling reference.
KateBlueSky Feb 26, 2025
c28e4de
Removed the gcc dangling point flag.
KateBlueSky Feb 26, 2025
039bf3a
Check for null.
KateBlueSky Feb 27, 2025
c397443
Added back in the static.
KateBlueSky Feb 27, 2025
57f0081
Merge remote-tracking branch 'origin/main' into retry_bazel_up_grade
KateBlueSky Feb 27, 2025
8a12ddd
Checked for dangling pointer.
KateBlueSky Feb 27, 2025
2238fad
fixed possibly dangling reference to a temporary for gcc.
KateBlueSky Mar 3, 2025
62ab9e0
fixed possibly dangling reference to a temporary for gcc.
KateBlueSky Mar 3, 2025
cf2b432
fixed formatting.
KateBlueSky Mar 3, 2025
d763d67
Deleted commented out code.
KateBlueSky Mar 3, 2025
787f43d
Fixed possibly dangling reference to a temporary.
KateBlueSky Mar 3, 2025
985109b
fixed possibly dangling reference to a temporary for gcc.
KateBlueSky Mar 3, 2025
a7540a7
fixed possibly dangling reference to a temporary for gcc.
KateBlueSky Mar 4, 2025
59a306e
fixed possibly dangling reference to a temporary for gcc.
KateBlueSky Mar 4, 2025
f0a261c
Merge branch 'uxlfoundation:main' into retry_bazel_up_grade
KateBlueSky Mar 4, 2025
548d6e4
Updated fmt version to what is on main for merge.
KateBlueSky Mar 4, 2025
e7de49c
Merge branch 'main' of https://github.com/KateBlueSky/oneDAL into ret…
KateBlueSky Mar 4, 2025
3007df0
Merge branch 'retry_bazel_up_grade' of https://github.com/KateBlueSky…
KateBlueSky Mar 4, 2025
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
5 changes: 4 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Global options

common
build -c opt \
--incompatible_enable_cc_toolchain_resolution \
--incompatible_require_linker_input_cc_api
--incompatible_require_linker_input_cc_api \
--noincompatible_disallow_empty_glob
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs on this aren't super clear to me - what would happen if this flag is not added?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Bazel 8.0, the flag --incompatible_disallow_empty_glob will default to true. This means that the allow_empty argument defaults to False on all glob calls. In Bazel 7.0 --incompatible_disallow_empty_glob defaulted to False and the allow_empty argument defaults to True on all glob calls. Some of the glob calls in the project return empty list, so in bazel 8.0 those glob calls that return empty list error out without setting allow_empty set to true.


# Aliases for user-defined flags
build --flag_alias=backend_config=@config//:backend_config
Expand Down
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.4.1
8.0.1
6 changes: 3 additions & 3 deletions .ci/pipeline/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ pr:
variables:
OPENBLAS_VERSION : 'v0.3.27'
TBB_VERSION : 'v2021.10.0'
VM_IMAGE : 'ubuntu-22.04'
SYSROOT_OS: 'jammy'
VM_IMAGE : 'ubuntu-24.04'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to update just bazel public ci step? just a question

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what you mean by this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean may be it makes sense to separate like:
VM_IMAGE : 'ubuntu-22.04'
VM_IMAGE_BAZEL: 'ubuntu-24.04' and use 24.04 only for bazel

SYSROOT_OS: 'noble'
WINDOWS_BASEKIT_URL: 'https://registrationcenter-download.intel.com/akdlm/IRC_NAS/b380d914-366b-4b77-a74a-05e3c38b3514/intel-oneapi-base-toolkit-2025.0.0.882_offline.exe'
WINDOWS_DPCPP_COMPONENTS: 'intel.oneapi.win.mkl.devel:intel.oneapi.win.tbb.devel'

Expand Down Expand Up @@ -420,7 +420,7 @@ jobs:
# Display oneDAL build configuration
bazel build @config//:dump
echo
cat bazel-bin/external/config/config.json
cat bazel-bin/external/+_repo_rules+config/config.json
echo
displayName: 'bazel-configure'
- script: |
Expand Down
132 changes: 132 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,135 @@
#
# Copyright contributors to the oneDAL project
#
# 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 = "onedal")

bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "rules_cc", version = "0.0.17")

declare_onedal_config = use_repo_rule("@onedal//dev/bazel/config:config.bzl", "declare_onedal_config")
declare_onedal_config(name = "config",)

sh_config_ext = use_extension("@onedal//dev/bazel/toolchains:cc_toolchain_extension.bzl", "cc_toolchain_extension")
use_repo(sh_config_ext, "onedal_cc_toolchain")
register_toolchains("@{}//:all".format("onedal_cc_toolchain"))


extra_toolchain_ext = use_extension("@onedal//dev/bazel/toolchains:extra_toolchain_extension.bzl", "onedal_extra_toolchain_extension")
use_repo(extra_toolchain_ext, "onedal_extra_toolchain")
register_toolchains("@{}//:all".format("onedal_extra_toolchain"))


opencl_repo = use_repo_rule("@onedal//dev/bazel/deps:opencl.bzl", "opencl_repo")
opencl_repo(name = "opencl")

openblas_repo = use_repo_rule("@onedal//dev/bazel/deps:openblas.bzl", "openblas_repo")
openblas_repo(name = "openblas", root_env_var = "OPENBLASROOT",)

tbb_repo = use_repo_rule("@onedal//dev/bazel/deps:tbb.bzl", "tbb_repo")
tbb_repo(
name = "tbb",
root_env_var = "TBBROOT",
urls = [
"https://files.pythonhosted.org/packages/93/4b/2e29f4266be5a66f21fc2dadcde48f9acea86119d6fb1bb2d2a451222ff7/tbb-2022.0.0-py2.py3-none-manylinux_2_28_x86_64.whl",
"https://files.pythonhosted.org/packages/ff/8c/1eb1f856a7a328242d524f1bf64f2a212d46ce5651168e7c8bc7aeaf0f44/tbb_devel-2022.0.0-py2.py3-none-manylinux_2_28_x86_64.whl",
],
sha256s = [
"15a15a4e3ea4c3f3198bdb3c55fac75c589e15ed2ad0bbb080900d355c5b017e",
"474e4ed1dce2efeea1d3652e295a97713df5d0ed854c937ee7d0464c38353c36",
],
strip_prefixes = [
"tbb-2022.0.0.data/data",
"tbb_devel-2022.0.0.data/data",
]
)

mpi_repo = use_repo_rule("@onedal//dev/bazel/deps:mpi.bzl", "mpi_repo")
mpi_repo(
name = "mpi",
root_env_var = "MPIROOT",
urls = [
"https://files.pythonhosted.org/packages/0a/7c/0f4de62a3463e4ebcf232352b231427f3b34c6a0a1b102a94da3246cad76/impi_rt-2021.14.0-py2.py3-none-manylinux_2_28_x86_64.whl",
"https://files.pythonhosted.org/packages/10/9f/4ee3244c078b9e9e8f65ec51760e7a6e52988abba92a285ab8b0c4dbafff/impi_devel-2021.14.0-py2.py3-none-manylinux_2_28_x86_64.whl",
],
sha256s = [
"f06ac9eba3de9609fb257d714e3041f82334ccfe27a9bec0f90007d6381dd52e",
"6a6ec66719ac4884a40a0504f4f186f51ee4169bece5f4486c31138ed6bcc87d",
],
strip_prefixes = [
"impi_rt-2021.14.0.data/data",
"impi_devel-2021.14.0.data/data",
]
)

ccl_repo = use_repo_rule("@onedal//dev/bazel/deps:ccl.bzl", "ccl_repo")
ccl_repo(
name = "ccl",
root_env_var = "CCL_ROOT",
urls = [
"https://files.pythonhosted.org/packages/c4/34/84fcf891faabfcd88e1e054a9268cdbefac8c22ab37d7eea2d9a3bda0f52/oneccl_devel-2021.14.0-py2.py3-none-manylinux_2_28_x86_64.whl",
],
sha256s = [
"580641c9d296b673d225ed3ca740b3356d7408a5c792de596a8836fde7d6c79e",
],
strip_prefixes = [
"oneccl_devel-2021.14.0.data/data",
]
)

mkl_repo = use_repo_rule("@onedal//dev/bazel/deps:mkl.bzl", "mkl_repo")
mkl_repo(
name = "mkl",
root_env_var = "MKLROOT",
urls = [
"https://files.pythonhosted.org/packages/95/d8/76f53cde7c1df06fcd153b4f6fdf0516aafbfc3239ba8d5a8c354e20bbb2/mkl_static-2025.0.0-py2.py3-none-manylinux_2_28_x86_64.whl",
"https://files.pythonhosted.org/packages/b1/91/b76ab204c03f90d5ce008ba7cf6efd77168059866e96b70277fec959b940/mkl_include-2025.0.0-py2.py3-none-manylinux_2_28_x86_64.whl",
"https://files.pythonhosted.org/packages/b8/d7/ea82194db165d83e22dfedee4d45423477441202e2c321b9e96809d36e63/mkl_devel_dpcpp-2025.0.0-py2.py3-none-manylinux_2_28_x86_64.whl",
],
sha256s = [
"706f92fcd6e00cc94155097a87528da52b4c3dda4616c8c334963251773a0d13",
"cf19e274bdd1449ef7285671576c545510bebff669363ee1926779192f618cdd",
"455281a590920fb58628dbc06ac007f2618c7315e4c04748c2a1b62efa01afb3",
],
strip_prefixes = [
"mkl_static-2025.0.0.data/data",
"mkl_include-2025.0.0.data/data",
"mkl_devel_dpcpp-2025.0.0.data/data",
],
)

onedal_repo = use_repo_rule("@onedal//dev/bazel/deps:onedal.bzl", "onedal_repo")
onedal_repo(
name = "onedal_release",
root_env_var = "DALROOT",
)

http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "catch2",
url = "https://github.com/catchorg/Catch2/archive/v3.8.0.tar.gz",
sha256 = "1ab2de20460d4641553addfdfe6acd4109d871d5531f8f519a52ea4926303087",
strip_prefix = "Catch2-3.8.0",
)

http_archive(
name = "fmt",
url = "https://github.com/fmtlib/fmt/archive/11.1.4.tar.gz",
sha256 = "ac366b7b4c2e9f0dde63a59b3feb5ee59b67974b14ee5dc9ea8ad78aa2c1ee1e",
strip_prefix = "fmt-11.1.4",
build_file = "@onedal//dev/bazel/deps:fmt.tpl.BUILD",
)
122 changes: 0 additions & 122 deletions WORKSPACE

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ struct vertex_partitioning_kernel_cpu<method::afforest,
const Allocator& alloc,
const Graph& g) const {
using topology_type = typename graph_traits<Graph>::impl_type::topology_type;
const auto& t = dal::preview::detail::csr_topology_builder<Graph>()(g);
auto topology_builder = dal::preview::detail::csr_topology_builder<Graph>();
const auto& t = topology_builder(g);
alloc_connector<Allocator> alloc_con(alloc);
const auto vertex_count = t.get_vertex_count();
if (vertex_count == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,17 @@ namespace oneapi::dal::preview::jaccard::detail {
template <typename Policy, typename Descriptor, typename Graph>
struct vertex_similarity_ops_dispatcher {
using task_t = typename Descriptor::task_t;

vertex_similarity_result<task_t> operator()(
const Policy &policy,
const Descriptor &descriptor,
vertex_similarity_input<Graph, task_t> &input) const {
const auto &t = dal::preview::detail::csr_topology_builder<Graph>()(input.get_graph());
auto topology_builder = dal::preview::detail::csr_topology_builder<Graph>();
const auto &t = topology_builder(input.get_graph());

// Assume get_backend returns a std::shared_ptr or std::unique_ptr
static auto impl = get_backend<Policy, Descriptor>(descriptor, t);

return (*impl)(policy, descriptor, t, input.get_caching_builder());
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ struct vertex_partitioning_kernel_cpu<Float,
const table &init_partition) const {
using topology_type = typename graph_traits<Graph>::impl_type::topology_type;
using value_type = edge_user_value_type<Graph>;
const auto &t = dal::preview::detail::csr_topology_builder<Graph>()(g);
auto topology_builder = dal::preview::detail::csr_topology_builder<Graph>();
const auto &t = topology_builder(g);
auto init_partition_arr =
oneapi::dal::row_accessor<const std::int32_t>(init_partition).pull();
const auto init_partition_data = init_partition_arr.get_data();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ struct traverse_kernel_cpu<method::delta_stepping, task::one_to_all, Allocator,
const Graph& g) const {
using topology_type = typename graph_traits<Graph>::impl_type::topology_type;
using value_type = edge_user_value_type<Graph>;
const auto& t = dal::preview::detail::csr_topology_builder<Graph>()(g);
auto topology_builder = dal::preview::detail::csr_topology_builder<Graph>();
const auto& t = topology_builder(g);
const auto vals = dal::detail::get_impl(g).get_edge_values().get_data();
alloc_connector<Allocator> alloc_con(alloc);
if (desc.get_optional_results() & optional_results::predecessors) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,14 @@ struct graph_matching_ops_dispatcher {
graph_matching_result<task_t> operator()(const Policy &policy,
const Descriptor &descriptor,
graph_matching_input<Graph, task_t> &input) const {
const auto &csr_target_topology =
dal::preview::detail::csr_topology_builder<Graph>()(input.get_target_graph());
const auto &csr_pattern_topology =
dal::preview::detail::csr_topology_builder<Graph>()(input.get_pattern_graph());
auto topology_builder = dal::preview::detail::csr_topology_builder<Graph>();
const auto &csr_target_topology = topology_builder(input.get_target_graph());
const auto &csr_pattern_topology = topology_builder(input.get_pattern_graph());
const auto &vv_t = dal::detail::get_impl(input.get_target_graph()).get_vertex_values();
const auto &ev_t = dal::detail::get_impl(input.get_target_graph()).get_edge_values();

const auto &vv_p = dal::detail::get_impl(input.get_pattern_graph()).get_vertex_values();
const auto &ev_p = dal::detail::get_impl(input.get_pattern_graph()).get_edge_values();

static auto impl =
get_backend<Policy>(descriptor, csr_target_topology, csr_pattern_topology, vv_t, ev_t);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ struct vertex_ranking_ops_dispatcher {
vertex_ranking_result<task_t> operator()(const Policy &policy,
const Descriptor &descriptor,
vertex_ranking_input<Graph, task_t> &input) const {
const auto &t = dal::preview::detail::csr_topology_builder<Graph>()(input.get_graph());
auto topology_builder = dal::preview::detail::csr_topology_builder<Graph>();

const auto &t = topology_builder(input.get_graph());

static auto impl = get_backend<Policy, Descriptor>(descriptor, t);

return (*impl)(policy, descriptor, t);
}
};
Expand Down
8 changes: 4 additions & 4 deletions dev/bazel/config/config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ def _dump_config_info_impl(ctx):
config_file = ctx.actions.declare_file("config.json")
flags_json = []
for target in ctx.attr.flags:
json = " {}: {},".format(target.label.name, target[ConfigFlagInfo].to_json())
flags_json.append(json)
target_json = " {}: {},".format(target.label.name, json.encode(target[ConfigFlagInfo]))
flags_json.append(target_json)
content = ("{\n" +
" cpu: {},\n".format(ctx.attr.cpu_info[CpuInfo].to_json()) +
" version: {},\n".format(ctx.attr.version_info[VersionInfo].to_json()) +
" cpu: {},\n".format(json.encode(ctx.attr.cpu_info[CpuInfo])) +
" version: {},\n".format(json.encode(ctx.attr.version_info[VersionInfo])) +
" flags: {\n" +
"\n".join(flags_json) + "\n" +
" }\n" +
Expand Down
3 changes: 0 additions & 3 deletions dev/bazel/toolchains/cc_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,3 @@ onedal_cc_toolchain = repository_rule(
],
)

def declare_onedal_cc_toolchain(name):
onedal_cc_toolchain(name = name)
native.register_toolchains("@{}//:all".format(name))
Loading
Loading