Skip to content

Commit

Permalink
Add F4E2M1FN type: HLO evaluator
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-kozub committed Dec 18, 2024
1 parent 1f0e19f commit 999bf96
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions xla/hlo/evaluator/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ cc_library(
"hlo_evaluator_typed_visitor_int4.cc",
"hlo_evaluator_typed_visitor_int64.cc",
"hlo_evaluator_typed_visitor_int8.cc",
"hlo_evaluator_typed_visitor_mxfloat.cc",
"hlo_evaluator_typed_visitor_uint16.cc",
"hlo_evaluator_typed_visitor_uint32.cc",
"hlo_evaluator_typed_visitor_uint64.cc",
Expand Down
1 change: 1 addition & 0 deletions xla/hlo/evaluator/hlo_evaluator_typed_visitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -1734,6 +1734,7 @@ extern template class HloEvaluatorTypedVisitor<double>;
extern template class HloEvaluatorTypedVisitor<complex64>;
extern template class HloEvaluatorTypedVisitor<complex128>;
extern template class HloEvaluatorTypedVisitor<bfloat16, float>;
extern template class HloEvaluatorTypedVisitor<tsl::float4_e2m1fn, float>;
extern template class HloEvaluatorTypedVisitor<tsl::float8_e5m2, float>;
extern template class HloEvaluatorTypedVisitor<tsl::float8_e4m3, float>;
extern template class HloEvaluatorTypedVisitor<tsl::float8_e4m3fn, float>;
Expand Down
22 changes: 22 additions & 0 deletions xla/hlo/evaluator/hlo_evaluator_typed_visitor_mxfloat.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* Copyright 2024 The OpenXLA Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

#include "xla/hlo/evaluator/hlo_evaluator.h"
#include "xla/hlo/evaluator/hlo_evaluator_typed_visitor.h"
#include "tsl/platform/ml_dtypes.h"

namespace xla {
template class HloEvaluatorTypedVisitor<tsl::float4_e2m1fn, float>;
} // namespace xla

0 comments on commit 999bf96

Please sign in to comment.