triton_gemm_fusion_test.cc
Google Test frameworkimports tsl/platform/path.h
SHA-256a85187a666e40e27fbeb9c6f2b1c1cfffc8a848db472590b5750bd40ef866a80
MaleculeMd₂(In₅Pa)
Evidence
1/* Copyright 2023 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 …
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 <cstdlib>
17#include <memory>
18#include <string>
19#include <utility>
20#include <vector>
21
22#include <gmock/gmock.h>
23#include <gtest/gtest.h>
24#include "absl/status/status.h"
25#include "absl/status/status_matchers.h"
26#include "absl/status/statusor.h"
27#include "absl/strings/str_cat.h"
28#include "absl/strings/string_view.h"
29#include "absl/strings/substitute.h"
30#include "llvm/IR/LLVMContext.h"
31#include "llvm/TargetParser/Triple.h"
32#include "mlir/IR/MLIRContext.h"
33#include "mlir/Pass/PassManager.h"
34#include "xla/autotuning.pb.h"
35#include "xla/backends/gpu/codegen/triton/test_utils.h"
36#include "xla/backends/gpu/codegen/triton/xtile_compiler.h"
37#include "xla/backends/gpu/transforms/convert_triton_gemm_config.h"
38#include "xla/backends/gpu/transforms/hoist_fused_bitcasts.h"
39#include "xla/error_spec.h"
40#include "xla/hlo/analysis/symbolic_expr.h"
41#include "xla/hlo/ir/hlo_casting_utils.h"
42#include "xla/hlo/ir/hlo_computation.h"
43#include "xla/hlo/ir/hlo_instruction.h"
44#include "xla/hlo/ir/hlo_instructions.h"
45#include "xla/hlo/ir/hlo_opcode.h"
46#include "xla/hlo/testlib/filecheck.h"
47#include "xla/hlo/testlib/pattern_matcher_gmock.h"
48#include "xla/hlo/testlib/verified_hlo_module.h"
49#include "xla/hlo/utils/hlo_query.h"
50#include "xla/service/gpu/backend_configs.pb.h"
51#include "xla/service/gpu/gpu_device_info_for_tests.h"
52#include "xla/service/gpu/model/block_level_parameters.h"
53#include "xla/service/gpu/target_constants.h"
54#include "xla/service/gpu/tests/gpu_codegen_test.h"
55#include "xla/service/pattern_matcher.h"
56#include "xla/stream_executor/cuda/cuda_compute_capability.h"
57#include "xla/stream_executor/device_description.h"
58#include "xla/tsl/lib/core/status_test_util.h"
165:12… RunFileCheck(module.ToString(), pattern));
166 EXPECT_TRUE(filecheck_result);
167 }
168};
⋯4 lines
174:34… ble_split_k_autotuning(true);
175 return debug_options;
176 }
177};
178
179TEST_F(TritonTest, TestGemmWithTrivialNonContractingDimension) {
180 constexpr absl::string_view kHloText = R"(
181HloModule t, is_schedule …
401:12… io::JoinPath(output_directory, "*.xtile-to-triton.txt"), &paths));
402 EXPECT_EQ(paths.size(), 1);
403 size_t file_size = 0;
404 EXPECT_OK(tsl::Env::Default()->GetFileSize(paths[0], &file_size));
405 EXPECT_GT(file …