Skip to content

Commit 48853ec

Browse files
olegshyshkovGoogle-ML-Automation
authored andcommitted
[XLA:GPU] Use HloHardwareIndependentTestBase::CreateDefaultDeviceAssignment.
PiperOrigin-RevId: 839349267
1 parent c0f84d6 commit 48853ec

File tree

4 files changed

+1
-24
lines changed

4 files changed

+1
-24
lines changed

xla/tests/BUILD

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3007,14 +3007,12 @@ xla_test(
30073007
":literal_test_util",
30083008
":test_utils",
30093009
":xla_internal_test_main",
3010-
"//xla:array",
30113010
"//xla:error_spec",
30123011
"//xla:literal",
30133012
"//xla:xla_data_proto_cc",
30143013
"//xla/hlo/ir:hlo",
30153014
"//xla/hlo/parser:hlo_parser",
30163015
"//xla/hlo/testlib:verified_hlo_module",
3017-
"//xla/service:computation_placer_hdr",
30183016
"//xla/service:hlo_module_config",
30193017
"//xla/service:hlo_runner",
30203018
"//xla/service/gpu:backend_configs_cc",

xla/tests/collective_ops_e2e_test_base.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@ limitations under the License.
2222
#include <utility>
2323
#include <vector>
2424

25-
#include "absl/functional/any_invocable.h"
2625
#include "absl/log/check.h"
2726
#include "absl/log/log.h"
2827
#include "absl/status/statusor.h"
2928
#include "absl/strings/str_cat.h"
3029
#include "absl/strings/string_view.h"
31-
#include "absl/types/span.h"
3230
#include "xla/hlo/ir/hlo_instruction.h"
3331
#include "xla/hlo/ir/hlo_module.h"
3432
#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
@@ -147,7 +145,7 @@ CollectiveOpsE2ETestBase::ExecuteReplicated(
147145
CHECK(num_partitions > 0 && "expect at least one partition");
148146

149147
DeviceAssignment device_assignment =
150-
MakeDeviceAssignment(num_replicas, num_partitions);
148+
GetDefaultDeviceAssignment(num_replicas, num_partitions);
151149
int64_t num_devices = num_replicas * num_partitions;
152150

153151
CHECK(num_devices == arguments.size() &&

xla/tests/collective_ops_e2e_test_base.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,15 @@ limitations under the License.
2020
#include <memory>
2121
#include <vector>
2222

23-
#include "absl/functional/any_invocable.h"
2423
#include "absl/log/check.h"
2524
#include "absl/log/log.h"
2625
#include "absl/status/statusor.h"
2726
#include "absl/strings/string_view.h"
28-
#include "absl/types/span.h"
29-
#include "xla/array.h"
3027
#include "xla/hlo/ir/hlo_instruction.h"
3128
#include "xla/hlo/ir/hlo_module.h"
3229
#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
3330
#include "xla/literal.h"
3431
#include "xla/service/backend.h"
35-
#include "xla/service/computation_placer.h"
3632
#include "xla/service/gpu/backend_configs.pb.h"
3733
#include "xla/service/hlo_runner.h"
3834
#include "xla/service/hlo_runner_interface.h"
@@ -78,19 +74,6 @@ class CollectiveOpsE2ETestBase : public HloHardwareIndependentTestBase {
7874
Capability().cuda_compute_capability()->IsAtLeastHopper();
7975
}
8076

81-
// Makes an iota device assignment.
82-
DeviceAssignment MakeDeviceAssignment(int64_t num_replicas,
83-
int64_t num_partitions = 1) {
84-
DeviceAssignment assn(/*replica_count=*/num_replicas,
85-
/*computation_count=*/num_partitions);
86-
for (int64_t i = 0; i < num_replicas; ++i) {
87-
for (int64_t j = 0; j < num_partitions; ++j) {
88-
assn(i, j) = i * num_partitions + j;
89-
}
90-
}
91-
return assn;
92-
}
93-
9477
protected:
9578
std::unique_ptr<HloRunner> hlo_runner_;
9679
std::unique_ptr<HloRunner> reference_hlo_runner_;

xla/tests/collective_ops_sharded_unsharded_e2e_test.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,12 @@ limitations under the License.
2626
#include "absl/status/statusor.h"
2727
#include "absl/strings/string_view.h"
2828
#include "absl/types/span.h"
29-
#include "xla/array.h"
3029
#include "xla/error_spec.h"
3130
#include "xla/hlo/ir/hlo_instruction.h"
3231
#include "xla/hlo/ir/hlo_sharding.h"
3332
#include "xla/hlo/parser/hlo_parser.h"
3433
#include "xla/hlo/testlib/verified_hlo_module.h"
3534
#include "xla/literal.h"
36-
#include "xla/service/computation_placer.h"
3735
#include "xla/service/gpu/backend_configs.pb.h"
3836
#include "xla/service/hlo_module_config.h"
3937
#include "xla/service/hlo_runner.h"

0 commit comments

Comments
 (0)