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

[xla:multihost_hlo_runner] Add an SpmdMode to enable use_shardy_partitioner. #17220

Merged
merged 1 commit into from
Sep 17, 2024
Merged
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
8 changes: 7 additions & 1 deletion xla/tools/multihost_hlo_runner/functional_hlo_runner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,12 @@ absl::StatusOr<CompileOptions> FunctionalHloRunner::CreateCompileOptions(
build_options.set_process_index(task_id);
build_options.set_process_count(num_nodes);
build_options.set_key_value_store(kv_store);
if (raw_options.spmd_mode == SpmdMode::kUseSpmdPartitioning) {
if (raw_options.spmd_mode == SpmdMode::kUseSpmdPartitioning ||
raw_options.spmd_mode == SpmdMode::kUseShardyPartitioning) {
build_options.set_use_spmd_partitioning(true);
if (raw_options.spmd_mode == SpmdMode::kUseShardyPartitioning) {
build_options.set_use_shardy_partitioner(true);
}
}
if (!build_options.has_device_assignment() &&
!raw_options.num_slices.has_value()) {
Expand Down Expand Up @@ -400,6 +404,8 @@ FunctionalHloRunner::CreateExecutableBuildOptionsFromExecutionOptions(
build_options.set_num_partitions(execution_options.num_partitions());
build_options.set_use_spmd_partitioning(
execution_options.use_spmd_partitioning());
build_options.set_use_shardy_partitioner(
execution_options.use_shardy_partitioner());
build_options.set_use_auto_spmd_partitioning(
execution_options.use_auto_spmd_partitioning());
build_options.set_deduplicate_hlo(execution_options.deduplicate_hlo());
Expand Down
6 changes: 5 additions & 1 deletion xla/tools/multihost_hlo_runner/functional_hlo_runner.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ class FunctionalHloRunner {
kStandardCompile
};

enum class SpmdMode { kUseSpmdPartitioning, kNotUseSpmdPartitioning };
enum class SpmdMode : int8_t {
kUseSpmdPartitioning, // Use the GSPMD partitioner for partitioning.
kUseShardyPartitioning, // Use the Shardy partitioner for partitioning.
kNotUseSpmdPartitioning // Do not perform partitioning.
};

enum class SpmdPartitionedMode {
kIsSpmdPartitionedModule,
Expand Down
Loading