Benign repos Download

bfloat16_propagation_test.cc

Google Test frameworkimports tsl/platform/statusor.h
SHA-2563c3c5b31c86ec7274e1797832bf8e6f535349370a72f18c9f964207101fce384

Evidence

apache web server name lines 1–10
1/* Copyright 2018 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 tsl/platform/statusor.h lines 11–50
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/hlo/transforms/bfloat16_propagation.h"
17
18#include <cstdint>
19#include <memory>
20#include <string>
21
22#include <gtest/gtest.h>
23#include "absl/log/log.h"
24#include "absl/status/statusor.h"
25#include "absl/strings/string_view.h"
26#include "xla/comparison_util.h"
27#include "xla/hlo/analysis/alias_info.h"
28#include "xla/hlo/ir/hlo_computation.h"
29#include "xla/hlo/ir/hlo_instruction.h"
30#include "xla/hlo/ir/hlo_module.h"
31#include "xla/hlo/ir/hlo_opcode.h"
32#include "xla/hlo/ir/replica_group.h"
33#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
34#include "xla/hlo/testlib/test.h"
35#include "xla/hlo/testlib/test_helpers.h"
36#include "xla/literal_util.h"
37#include "xla/service/float_support.h"
38#include "xla/service/hlo_verifier.h"
39#include "xla/shape.h"
40#include "xla/shape_util.h"
41#include "xla/tests/literal_test_util.h"
42#include "xla/tsl/platform/statusor.h"
43#include "xla/xla_data.pb.h"
44#include "tsl/platform/statusor.h"
45
46namespace xla {
47
48// A class specifying the BF16 support used to test the propagation pass. It
49// specifies that BF16 and mixed precision are supported in all HloInstructions,
50// and that kDot reduces its ope …
TEST_F macro lines 116–119
116:8… ugh add where reducing operand precision can affect the result.
117TEST_F(BFloat16PropagationTest, PropagateThroughSelectButNotAdd) {
118 auto builder = HloComputation::Builder(TestName());
119 Shape shape …
C/C++ unit-test EXPECT_EQ marker lines 144–151
144:7… computation = module->AddEntryComputation(builder.Build());
145
146 EXPECT_TRUE(PropagatePrecision(module.get()));
147
148 EXPECT_EQ(computation->root_instruction(), root);
149 EXPECT_TRUE(OutputsBF16(xpose));
150 EXPECT_TRUE(OutputsBF16(sel));
151 EXPECT_TRUE(Outpu …
English function-word token "have" lines 368–373
368:5… PECT_TRUE(OutputsBF16(lhs));
369
370 // add0 and rhs have been eliminated by simplification and DCE.
371}
372
373// Tests that a non-fusion computation's root sho …

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.