symbolic_tile_analysis_test.cc
Google Test frameworkimports xla/tsl/platform/errors.h
SHA-2566ce683a483a1d34b11bbc3ec067e621dfd029830e591fceee12b731c29611eb1
MaleculeMd₂(In₂Pa)
Evidence
1/* Copyright 2024 The TensorFlow Authors. All Rights Reserved.
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 …
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/codegen/tiling/symbolic_tile_analysis.h"
17
18#include <cstdint>
19#include <iterator>
20#include <memory>
21#include <optional>
22#include <string>
23#include <utility>
24#include <variant>
25#include <vector>
26
27#include <gmock/gmock.h>
28#include <gtest/gtest.h>
29#include "absl/algorithm/container.h"
30#include "absl/container/flat_hash_map.h"
31#include "absl/container/flat_hash_set.h"
32#include "absl/log/check.h"
33#include "absl/log/log.h"
34#include "absl/status/status.h"
35#include "absl/status/status_matchers.h"
36#include "absl/strings/str_join.h"
37#include "absl/strings/string_view.h"
38#include "absl/strings/substitute.h"
39#include "absl/types/span.h"
40#include "mlir/IR/MLIRContext.h"
41#include "xla/codegen/tiling/constraint_expression.h"
42#include "xla/codegen/tiling/symbolic_tiled_hlo_instruction.h"
43#include "xla/codegen/tiling/tiled_hlo_computation.h"
44#include "xla/codegen/tiling/tiled_hlo_fusion_instruction.h"
45#include "xla/codegen/tiling/tiled_hlo_instruction.h"
46#include "xla/codegen/tiling/tiled_hlo_schedule.h"
47#include "xla/codegen/tiling/tiling_specification.h"
48#include "xla/hlo/analysis/indexing_test_utils.h"
49#include "xla/hlo/analysis/symbolic_expr.h"
50#include "xla/hlo/ir/hlo_casting_utils.h"
51#include "xla/hlo/ir/hlo_instructions.h"
52#include "xla/hlo/ir/hlo_module.h"
53#include "xla/hlo/ir/hlo_opcode.h"
54#include "xla/hlo/parser/hlo_parser.h"
55#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
56#include "xla/hlo/testlib/verified_hlo_module.h"
57#include "xla/hlo/utils/hlo_traversal.h"
58#include "xla/service/gpu/backend_configs.pb.h"
203:46… don't check its operands.
204 continue;
205 }
206 EXPECT_EQ(instr->hlo()->operands().size(), instr->operands().size())
207 << "tiled instruction " << instr->hlo()->ToString()
208 …
209:22… ";
210 for (const auto& op : instr->operands()) {
211 EXPECT_TRUE(visited.contains(op->hlo()))
212 << "operand " << op->ToString() << " is not visited yet";
213 }
214 for (con …
231:70… ent they
232// usually match the original "nested fusions" tests.
233
234TEST_F(SymbolicTileAnalysisTest, SimpleNormalizationDiamondIsSupported) {
235 TF_ASSERT_OK_AND_ASSIGN(std::unique_ptr<VerifiedHloModule> …