Skip to content

Commit ec1f2b2

Browse files
authored
[FIX] Refine getting backend info logic to reduce time (#400)
1 parent 59b8274 commit ec1f2b2

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

third_party/openxla.patch

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4617,10 +4617,10 @@ index 05f230088..b4154971e 100644
46174617
// This API doesn't have a corresponding API in NCCL and implemented as
46184618
diff --git a/xla/service/gpu/spir_compiler.cc b/xla/service/gpu/spir_compiler.cc
46194619
new file mode 100644
4620-
index 000000000..1c33d7e50
4620+
index 000000000..bffa2d412
46214621
--- /dev/null
46224622
+++ b/xla/service/gpu/spir_compiler.cc
4623-
@@ -0,0 +1,290 @@
4623+
@@ -0,0 +1,289 @@
46244624
+/* Copyright (c) 2023 Intel Corporation
46254625
+
46264626
+Licensed under the Apache License, Version 2.0 (the "License");
@@ -4797,16 +4797,15 @@ index 000000000..1c33d7e50
47974797
+
47984798
+ // For frontend debugging.
47994799
+ FrontendAttributes frontend_attributes;
4800-
+ if (IsXeHPC(nullptr)) {
4801-
+ frontend_attributes.mutable_map()->emplace("IsXeHPC", "True");
4802-
+ }
4803-
+ if (HasXMX(nullptr)) {
4804-
+ frontend_attributes.mutable_map()->emplace("HasXMX", "True");
4800+
+ bool is_xetla_hardware_support = IsXetlaHardwareSupport();
4801+
+ if (is_xetla_hardware_support) {
4802+
+ frontend_attributes.mutable_map()->emplace("is_xetla_hardware_support",
4803+
+ "True");
48054804
+ }
48064805
+ hlo_module->add_frontend_attributes(frontend_attributes);
48074806
+ bool use_mha = true;
48084807
+ TF_CHECK_OK(tsl::ReadBoolFromEnvVar("MHA", true, &use_mha));
4809-
+ if (use_mha && IsXetlaHardwareSupport()) {
4808+
+ if (use_mha && is_xetla_hardware_support) {
48104809
+ HloPassPipeline mha_fusion_pipeline("multi-headed attention fusion");
48114810
+ const DebugOptions& debug_options = hlo_module->config().debug_options();
48124811
+ // The LayoutAssignment pass may leave behind kCopy instructions which are

0 commit comments

Comments
 (0)