Benign repos Download

spmd_partitioner_test.cc

Google Test frameworkimports xla/tsl/platform/errors.h
SHA-25699cadeaeca2fc37cd19431ab452910ac53fefc5fc01c4bb678e87fca98cbeba7

Evidence

apache web server name lines 1–10
1/* Copyright 2020 The OpenXLA Authors.
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is …
imports xla/tsl/platform/errors.h lines 11–58
11:42… IND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14==============================================================================*/
15
16#include "xla/service/spmd/spmd_partitioner.h"
17
18#include <algorithm>
19#include <cstdint>
20#include <memory>
21#include <optional>
22#include <string>
23#include <utility>
24#include <vector>
25
26#include <gmock/gmock.h>
27#include <gtest/gtest.h>
28#include "absl/algorithm/container.h"
29#include "absl/log/check.h"
30#include "absl/log/log.h"
31#include "absl/status/status.h"
32#include "absl/status/statusor.h"
33#include "absl/strings/match.h"
34#include "absl/strings/string_view.h"
35#include "xla/hlo/ir/hlo_casting_utils.h"
36#include "xla/hlo/ir/hlo_computation.h"
37#include "xla/hlo/ir/hlo_instruction.h"
38#include "xla/hlo/ir/hlo_instructions.h"
39#include "xla/hlo/ir/hlo_module.h"
40#include "xla/hlo/ir/hlo_opcode.h"
41#include "xla/hlo/ir/hlo_print_options.h"
42#include "xla/hlo/ir/hlo_sharding.h"
43#include "xla/hlo/ir/replica_group.h"
44#include "xla/hlo/pass/hlo_pass_pipeline.h"
45#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
46#include "xla/hlo/utils/hlo_matchers.h"
47#include "xla/hlo/utils/hlo_sharding_util.h"
48#include "xla/layout_util.h"
49#include "xla/literal_util.h"
50#include "xla/service/hlo_module_config.h"
51#include "xla/service/hlo_verifier.h"
52#include "xla/service/spmd/sharding_format_picker.h"
53#include "xla/service/spmd/spmd_prepare.h"
54#include "xla/shape.h"
55#include "xla/tsl/lib/core/status_test_util.h"
56#include "xla/tsl/platform/errors.h"
57#include "xla/tsl/platform/statusor.h"
58#include "xla/util.h"
ASSERT_ macro prefix lines 198–203
198:2… ROOT %copy = s32[2,3]{1,0} copy(%cc), sharding={replicated}
199})";
200 TF_ASSERT_OK_AND_ASSIGN(auto module,
201 PartitionComputation(hlo_string, /*num_devices=*/2));
202 VLOG(1) << module->ToString();
203 …
C/C++ unit-test EXPECT_EQ marker lines 315–319
315:39… operand(0);
316 const HloInstruction* call1 = root->operand(1);
317 EXPECT_EQ(call0->to_apply(), call1->to_apply());
318 const HloInstruction* call_comp_root = call0->to_apply()->root_instruction();
319 EXPECT …
C/C++ unit-test EXPECT_TRUE marker lines 532–537
532:34…
533
534 // Verify all-gather instruction contains ReplicaGroupV2.
535 EXPECT_TRUE(all_gather->device_list()->version() ==
536 CollectiveDeviceListVersion::kIota);
537 EXPECT_EQ(*all_gather->device_list …

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.