nvptx_compiler_test.cc
Google Test frameworkimports xla/tsl/platform/errors.h
SHA-256944cd0c6e1207d12e47826810187d4844bf4eacfa2ead2107ead94c2950402d9
MaleculeMd₂(In₂Pa)
Evidence
1/* Copyright 2021 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 "xla/service/gpu/nvptx_compiler.h"
17
18#include <cstdint>
19#include <memory>
20
21#include <gtest/gtest.h>
22#include "absl/status/statusor.h"
23#include "absl/strings/string_view.h"
24#include "mlir/IR/MLIRContext.h"
25#include "xla/hlo/analysis/hlo_ordering.h"
26#include "xla/hlo/ir/hlo_instruction.h"
27#include "xla/hlo/ir/hlo_opcode.h"
28#include "xla/hlo/utils/hlo_query.h"
29#include "xla/service/buffer_assignment.h"
30#include "xla/service/buffer_value.h"
31#include "xla/service/gpu/alias_info.h"
32#include "xla/service/gpu/gpu_constants.h"
33#include "xla/service/gpu/gpu_hlo_schedule.h"
34#include "xla/service/gpu/gpu_latency_hiding_scheduler.h"
35#include "xla/service/gpu/tests/hlo_pjrt_gpu_test_base.h"
36#include "xla/service/logical_buffer.h"
37#include "xla/stream_executor/cuda/cuda_compute_capability.h"
38#include "xla/stream_executor/device_description.h"
39#include "xla/tsl/lib/core/status_test_util.h"
40#include "xla/tsl/platform/errors.h"
41#include "xla/tsl/platform/statusor.h"
42#include "xla/util.h"
43#include "xla/xla.pb.h"
44
45namespace xla {
⋯4 lines
101:25… a_gpu_cublas_fallback(false);
102 return debug_options;
103 }
104};
105
106TEST_F(NVPTXCompilerTest, AllReducePerformedInplace) {
107 const absl::string_view hlo_string = R"(
108HloModule Module, input_output_alias …
118:17… = f32[128] all-reduce(param0),
119 replica_groups={}, to_apply=summit
120}
121)";
⋯4 lines
127:19… all_reduce = module->entry_computation()->root_instruction();
128 EXPECT_TRUE(buffer_assignment->SharesTopLevelSlice(all_reduce,
129 all_reduce->operand(0)) …