Skip to content

Commit

Permalink
Reverts 14ca4ea
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 696061109
  • Loading branch information
akuegel authored and Google-ML-Automation committed Nov 13, 2024
1 parent 342e3c1 commit 6e9eefe
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions xla/service/gpu/gpu_float_support.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ bool GpuFloatSupport::IsSupported(const HloInstruction& hlo) const {
case HloOpcode::kReducePrecision:
return true;
// Elementwise ops.
case HloOpcode::kExp:
return LowPrecisionType() == BF16;
case HloOpcode::kAdd:
case HloOpcode::kMultiply:
case HloOpcode::kSubtract: {
Expand Down
15 changes: 15 additions & 0 deletions xla/service/gpu/gpu_float_support_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,21 @@ ENTRY main {
EXPECT_FALSE(Normalize(module.get(), cc, BF16, F32));
}

TEST_F(FloatSupportTest, Bf16ExpIsNotNormalized) {
auto cc = se::CudaComputeCapability::Ampere();
constexpr absl::string_view kHloModule = R"(
HloModule m
ENTRY main {
p0 = bf16[] parameter(0)
ROOT r = bf16[] exponential(p0)
})";

TF_ASSERT_OK_AND_ASSIGN(auto module,
ParseAndReturnVerifiedModule(kHloModule));
EXPECT_FALSE(Normalize(module.get(), cc, BF16, F32));
}

TEST_F(FloatSupportTest,
BF16ReductionOnHopperIsOnlyNormalizedIfReducerIsUnsupported) {
auto cc = se::CudaComputeCapability::Hopper();
Expand Down

0 comments on commit 6e9eefe

Please sign in to comment.