Skip to content

Commit 6bbfe9a

Browse files
authored
[Feat] Rebase intel-xla to jax 0.4.24 and upgrade PJRT API from 0.33 to 0.40 (#2691)
1 parent 44c85da commit 6bbfe9a

File tree

25 files changed

+47
-93
lines changed

25 files changed

+47
-93
lines changed

.bazelrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ build:cpu --define=device=cpu
1515
# build:cpu --define=build_with_tbb=true
1616

1717
# This config option is used for GPU backend. (Deprecated)
18-
build:gpu --crosstool_top=@local_config_sycl//crosstool_sycl:toolchain
18+
build:gpu --crosstool_top=@itex_local_config_sycl//crosstool_sycl:toolchain
1919
build:gpu --define=using_sycl=true --define=build_with_sycl=true --define=using_xetla=true --define=using_nextpluggable=true
2020
build:gpu --define=build_with_onednn_graph=true
2121
build:gpu --define=device=gpu
@@ -24,15 +24,15 @@ build:gpu --repo_env TF_NEED_SYCL=1
2424

2525
# This config option is used for GPU backend.
2626
# xpu will replace gpu as default config option for GPU only backend.
27-
build:xpu --crosstool_top=@local_config_sycl//crosstool_sycl:toolchain
27+
build:xpu --crosstool_top=@itex_local_config_sycl//crosstool_sycl:toolchain
2828
build:xpu --define=using_sycl=true --define=build_with_sycl=true --define=using_xetla=true --define=using_nextpluggable=true
2929
build:xpu --define=build_with_onednn_graph=true
3030
build:xpu --define=device=gpu
3131
build:xpu --define=tensorflow_mkldnn_contraction_kernel=0
3232
build:gpu --repo_env TF_NEED_SYCL=1
3333

3434
# This config option is used for XPU backend (CPU + GPU). (Disabled)
35-
# build:xpu --crosstool_top=@local_config_sycl//crosstool_sycl:toolchain
35+
# build:xpu --crosstool_top=@itex_local_config_sycl//crosstool_sycl:toolchain
3636
# build:xpu --define=using_xetla=true
3737
# build:xpu --define=build_as_xpu=true
3838
# build:xpu --define=build_with_onednn_graph=true

WORKSPACE

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ load(
3232
# curl -L https://github.com/openxla/xla/archive/<git hash>.tar.gz | sha256sum
3333
# and update XLA_SHA256 with the result.
3434

35-
XLA_COMMIT = "cf3c9138f9052e7a7761344693b2c677a6161f6d"
35+
XLA_COMMIT = "98bf412acc77c515ed7b40cff26ac1f1decf8f5b"
3636

3737
new_git_repository(
38-
name = "intel_xla",
39-
build_file = clean_dep("//third_party/intel_xla:intel_xla.BUILD"),
38+
name = "intel_extension_for_openxla",
39+
build_file = clean_dep("//third_party/intel_extension_for_openxla:intel_extension_for_openxla.BUILD"),
4040
commit = XLA_COMMIT,
4141
remote = "https://github.com/intel/intel-extension-for-openxla.git",
4242
verbose = True,
@@ -55,10 +55,6 @@ new_git_repository(
5555
# path = "/path/to/xla",
5656
# )
5757

58-
load("@intel_xla//xla:workspace.bzl", "workspace")
59-
60-
workspace()
61-
6258
# To update XLA to a new revision,
6359
# a) update URL and strip_prefix to the new git commit hash
6460
# b) get the sha256 hash of the commit by running:
@@ -67,11 +63,11 @@ workspace()
6763
http_archive(
6864
name = "xla",
6965
patch_args = ["-p1"],
70-
patches = ["//third_party:openxla.patch"],
71-
sha256 = "637acdfce5a406bd929bca052863be8200afbaac0daecbc547e9aff1967d7c00",
72-
strip_prefix = "xla-a5a30f7b34b69b7cada6deb4b39f77788e28369c",
66+
patches = ["@intel_extension_for_openxla//third_party:openxla.patch"],
67+
sha256 = "db007b6628cfe108c63f45d611c6de910abe3ee827e55f08314ce143c4887d66",
68+
strip_prefix = "xla-12eee889e1f2ad41e27d7b0e970cb92d282d3ec5",
7369
urls = [
74-
"https://github.com/openxla/xla/archive/a5a30f7b34b69b7cada6deb4b39f77788e28369c.tar.gz",
70+
"https://github.com/openxla/xla/archive/12eee889e1f2ad41e27d7b0e970cb92d282d3ec5.tar.gz",
7571
],
7672
)
7773

@@ -87,6 +83,10 @@ http_archive(
8783
# path = "/path/to/xla",
8884
# )
8985

86+
load("@intel_extension_for_openxla//xla:workspace.bzl", "workspace")
87+
88+
workspace()
89+
9090
load("@xla//:workspace4.bzl", "xla_workspace4")
9191

9292
xla_workspace4()

itex/BUILD

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package(default_visibility = ["//visibility:public"])
22

33
load("//itex:itex.bzl", "cc_binary", "if_using_nextpluggable_device", "itex_xpu_binary", "itex_xpu_library", "tf_copts")
44
load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
5-
load("@local_config_sycl//sycl:build_defs.bzl", "if_sycl")
5+
load("@itex_local_config_sycl//sycl:build_defs.bzl", "if_sycl")
66
load("@bazel_skylib//lib:selects.bzl", "selects")
77

88
string_flag(
@@ -69,7 +69,7 @@ selects.config_setting_group(
6969
selects.config_setting_group(
7070
name = "if_using_sycl",
7171
match_any = [
72-
"@local_config_sycl//sycl:using_sycl",
72+
"@itex_local_config_sycl//sycl:using_sycl",
7373
":gpu_build",
7474
],
7575
)
@@ -78,7 +78,7 @@ selects.config_setting_group(
7878
name = "gpu_with_nextpluggable_device_build",
7979
match_all = [
8080
"@intel_extension_for_tensorflow//itex:gpu_build",
81-
"@local_config_sycl//sycl:using_nextpluggable",
81+
"@itex_local_config_sycl//sycl:using_nextpluggable",
8282
],
8383
)
8484

@@ -94,7 +94,7 @@ cc_binary(
9494
"//itex/core/wrapper:itex_gpu_wrapper",
9595
],
9696
copts = select({
97-
"@local_config_sycl//sycl:using_nextpluggable": ["-DUSING_NEXTPLUGGABLE_DEVICE"],
97+
"@itex_local_config_sycl//sycl:using_nextpluggable": ["-DUSING_NEXTPLUGGABLE_DEVICE"],
9898
"//conditions:default": [],
9999
}),
100100
linkopts = ["-Wl,-rpath,$$ORIGIN/../intel_extension_for_tensorflow"],
@@ -131,7 +131,7 @@ itex_xpu_binary(
131131
"//itex/core/kernels:libitex_common",
132132
"@local_config_tf//:_pywrap_tensorflow_internal",
133133
] + if_using_nextpluggable_device([
134-
"//itex/core/utils:libintel_xla",
134+
"//itex/core/utils:libintel_extension_for_openxla",
135135
]),
136136
)
137137

@@ -152,7 +152,7 @@ itex_xpu_binary(
152152
"//itex/core:protos_all_cc",
153153
"//itex/core/kernels:itex_common_cc",
154154
] + if_using_nextpluggable_device([
155-
"//itex/core/utils:libintel_xla",
155+
"//itex/core/utils:libintel_extension_for_openxla",
156156
]),
157157
)
158158

itex/core/devices/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package(default_visibility = ["//visibility:public"])
22

33
load("//itex:itex.bzl", "cc_library", "if_using_nextpluggable_device")
4-
load("@local_config_sycl//sycl:build_defs.bzl", "if_sycl")
4+
load("@itex_local_config_sycl//sycl:build_defs.bzl", "if_sycl")
55

66
cc_library(
77
name = "xpu_device_util",

itex/core/devices/next_pluggable_device/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ cc_library(
1010
visibility = ["//visibility:public"],
1111
deps = [
1212
"//itex/core/devices/gpu:itex_gpu_runtime_imp",
13-
"//itex/core/utils:libintel_xla",
13+
"//itex/core/utils:libintel_extension_for_openxla",
1414
"//third_party/build_option/sycl:itex_gpu_header",
1515
],
1616
alwayslink = True,

itex/core/graph/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("//itex:itex.bzl", "cc_library")
2-
load("@local_config_sycl//sycl:build_defs.bzl", "if_sycl")
2+
load("@itex_local_config_sycl//sycl:build_defs.bzl", "if_sycl")
33

44
cc_library(
55
name = "xpu_optimizer",

itex/core/kernels/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("//itex:itex.bzl", "cc_binary", "cc_library", "if_using_nextpluggable_device", "itex_xpu_library", "tf_copts")
2-
load("@local_config_sycl//sycl:build_defs.bzl", "if_sycl", "if_xetla")
2+
load("@itex_local_config_sycl//sycl:build_defs.bzl", "if_sycl", "if_xetla")
33

44
XPU_KERNEL_DEPS = [
55
"//itex/core/devices:device_backend_util_hdr",

itex/core/kernels/onednn/block/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("//itex:itex.bzl", "itex_xpu_library", "tf_copts")
2-
load("@local_config_sycl//sycl:build_defs.bzl", "if_sycl")
2+
load("@itex_local_config_sycl//sycl:build_defs.bzl", "if_sycl")
33

44
# List all kernels here.
55
itex_xpu_library(

itex/core/kernels/onednn_graph/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ cc_library(
1010
"//itex:core",
1111
"//itex/core/utils/onednn:onednn_graph_util",
1212
] + if_using_nextpluggable_device([
13-
"//itex/core/utils:libintel_xla",
13+
"//itex/core/utils:libintel_extension_for_openxla",
1414
]),
1515
alwayslink = True,
1616
)

itex/core/utils/BUILD

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ load(
33
"//itex/core/utils:build_config.bzl",
44
"tf_protobuf_deps",
55
)
6-
load("@local_config_sycl//sycl:build_defs.bzl", "if_sycl")
6+
load("@itex_local_config_sycl//sycl:build_defs.bzl", "if_sycl")
77

88
package(
99
default_visibility = [
@@ -102,7 +102,7 @@ cc_library(
102102
"@nsync//:nsync_cpp",
103103
] + if_using_nextpluggable_device([
104104
"//third_party/build_option/sycl:itex_gpu_header",
105-
":libintel_xla",
105+
":libintel_extension_for_openxla",
106106
]),
107107
)
108108

@@ -422,18 +422,18 @@ cc_library(
422422
)
423423

424424
cc_import(
425-
name = "libintel_xla",
426-
shared_library = ":intel_xla",
425+
name = "libintel_extension_for_openxla",
426+
shared_library = ":intel_extension_for_openxla",
427427
visibility = ["//visibility:public"],
428428
)
429429

430430
itex_xpu_binary(
431-
name = "libintel_xla.so",
431+
name = "libintel_extension_for_openxla.so",
432432
linkshared = True,
433433
set_target = "gpu_orig_backend",
434434
visibility = ["//visibility:public"],
435435
deps = [
436-
"@intel_xla//xla/pjrt:tf_pjrt_helper",
436+
"@intel_extension_for_openxla//xla/pjrt:tf_pjrt_helper",
437437
"@onednn_gpu",
438438
] + select({
439439
"//third_party/onednn:build_with_onednn_graph": ["@onednn_gpu//:onednn_graph_gpu"],

0 commit comments

Comments
 (0)