Skip to content
Open
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
1 change: 1 addition & 0 deletions xla/pjrt/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,7 @@ cc_library(
hdrs = ["mlir_to_hlo.h"],
visibility = internal_visibility([":friends"]),
deps = [
"//xla:debug_options_flags",
"//xla:util",
"//xla/client:executable_build_options",
"//xla/hlo/builder:xla_computation",
Expand Down
9 changes: 4 additions & 5 deletions xla/pjrt/mlir_to_hlo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ limitations under the License.
#include "stablehlo/dialect/Version.h"
#include "stablehlo/transforms/Passes.h"
#include "xla/client/executable_build_options.h"
#include "xla/debug_options_flags.h"
#include "xla/hlo/builder/xla_computation.h"
#include "xla/hlo/translate/stablehlo.h"
#include "xla/mlir/utils/error_util.h"
Expand Down Expand Up @@ -122,11 +123,9 @@ absl::Status MlirToXlaComputation(
// no-op if the module is already pure StableHLO.
// NOTE: we don't use `use_shardy` because it isn't guaranteed to be true if
// the module has Shardy artifacts.
bool enable_hlo_sharding_v3 =
exec_build_options && exec_build_options->has_debug_options() &&
exec_build_options->debug_options().xla_enable_hlo_sharding_v3();
xla::sdy::addSdyRoundTripExportPipeline(pm, /*keepMeshesInlined=*/false,
enable_hlo_sharding_v3);
xla::sdy::addSdyRoundTripExportPipeline(
pm, /*keepMeshesInlined=*/false,
GetDebugOptionsFromFlags().xla_enable_hlo_sharding_v3());

// CHLO -> MHLO for high level ops (TopK, Erf, RaggedDot, etc.)
// CHLO -> StableHLO otherwise
Expand Down
Loading