Skip to content

Commit 3144e1f

Browse files
authored
Add backend info in hlo_module for debugging (#375)
1 parent 271a388 commit 3144e1f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

third_party/openxla.patch

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5148,10 +5148,10 @@ index ca80a7bbd..49138c92a 100644
51485148
int64_t algorithm_idx_;
51495149
diff --git a/xla/service/gpu/spir_compiler.cc b/xla/service/gpu/spir_compiler.cc
51505150
new file mode 100644
5151-
index 000000000..93711c700
5151+
index 000000000..2938a70fe
51525152
--- /dev/null
51535153
+++ b/xla/service/gpu/spir_compiler.cc
5154-
@@ -0,0 +1,281 @@
5154+
@@ -0,0 +1,290 @@
51555155
+/* Copyright (c) 2023 Intel Corporation
51565156
+
51575157
+Licensed under the Apache License, Version 2.0 (the "License");
@@ -5326,6 +5326,15 @@ index 000000000..93711c700
53265326
+ auto cuda_compute_capability = std::get<se::CudaComputeCapability>(
53275327
+ gpu_target_config.device_description.gpu_compute_capability());
53285328
+
5329+
+ // For frontend debugging.
5330+
+ FrontendAttributes frontend_attributes;
5331+
+ if (IsXeHPC(nullptr)) {
5332+
+ frontend_attributes.mutable_map()->emplace("IsXeHPC", "True");
5333+
+ }
5334+
+ if (HasXMX(nullptr)) {
5335+
+ frontend_attributes.mutable_map()->emplace("HasXMX", "True");
5336+
+ }
5337+
+ hlo_module->add_frontend_attributes(frontend_attributes);
53295338
+ bool use_mha = true;
53305339
+ TF_CHECK_OK(tsl::ReadBoolFromEnvVar("MHA", true, &use_mha));
53315340
+ if (use_mha && IsXetlaHardwareSupport()) {

0 commit comments

Comments
 (0)