Skip to content

Commit

Permalink
#11756: update condition for fp32 precision flag
Browse files Browse the repository at this point in the history
  • Loading branch information
rdjogoTT committed Sep 23, 2024
1 parent f17a040 commit cbca484
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tt_metal/jit_build/data_format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ std::vector<DataFormat> get_unpack_dst_formats(
} else if (int_fpu_en) {
unpack_dst_format.push_back(src_format);
} else {
if (!preserve_fp32_precision.empty() && en_unpack_tf32 && preserve_fp32_precision[i] != PreserveFP32Target::Disabled) {
if (input_formats[i] == DataFormat::Float32 && !preserve_fp32_precision.empty() && preserve_fp32_precision[i] != PreserveFP32Target::Disabled) {
TT_FATAL(preserve_fp32_precision[i] == PreserveFP32Target::DEST, "preserve_fp32_precision is only available when unpack target is DEST register");
unpack_dst_format.push_back(get_single_unpack_dst_format(input_formats[i], pack_format, DataFormat::Float32));
} else {
Expand All @@ -273,15 +273,15 @@ std::vector<DataFormat> get_unpack_dst_formats(
}
}
for (int i=0 ; i<NUM_OPERANDS ; i++) {
if (!preserve_fp32_precision.empty() && en_unpack_tf32 && preserve_fp32_precision[NUM_OPERANDS+i] != PreserveFP32Target::Disabled) {
if (param_formats[i] == DataFormat::Float32 && !preserve_fp32_precision.empty() && preserve_fp32_precision[NUM_OPERANDS+i] != PreserveFP32Target::Disabled) {
TT_FATAL(preserve_fp32_precision[NUM_OPERANDS+i] == PreserveFP32Target::DEST, "preserve_fp32_precision is only available when unpack target is DEST register");
unpack_dst_format.push_back(get_single_unpack_dst_format(param_formats[i], pack_format, DataFormat::Float32));
} else {
unpack_dst_format.push_back(get_single_unpack_dst_format(param_formats[i], pack_format, unpack_cond_dst_format));
}
}
for (int i=0 ; i<NUM_OPERANDS ; i++) {
if (!preserve_fp32_precision.empty() && en_unpack_tf32 && preserve_fp32_precision[3*NUM_OPERANDS+i] != PreserveFP32Target::Disabled) {
if (intermed_formats[i] == DataFormat::Float32 && !preserve_fp32_precision.empty() && preserve_fp32_precision[3*NUM_OPERANDS+i] != PreserveFP32Target::Disabled) {
TT_FATAL(preserve_fp32_precision[3*NUM_OPERANDS+i] == PreserveFP32Target::DEST, "preserve_fp32_precision is only available when unpack target is DEST register");
unpack_dst_format.push_back(get_single_unpack_dst_format(intermed_formats[i], pack_format, DataFormat::Float32));
} else {
Expand Down

0 comments on commit cbca484

Please sign in to comment.