Skip to content

Commit

Permalink
enable unpack_to_dest for metal by default, enhance to work with uint32
Browse files Browse the repository at this point in the history
  • Loading branch information
ttmtrajkovic committed Mar 26, 2024
1 parent 62065f3 commit 971ace9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions common/inc/cmath_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ inline void set_dest_section_base()
}

inline constexpr bool is_32bit_input(const std::uint32_t src_format, const std::uint32_t dst_format) {
const uint input_df = src_format;
const uint output_df = dst_format;
const uint input_df = src_format & 0xF;
const uint output_df = dst_format & 0xF;
return ((input_df == (uint)DataFormat::Int32) || (input_df == (uint)DataFormat::Float32)) &&
((output_df == (uint)DataFormat::Int32) || (output_df == (uint)DataFormat::Float32));
}
Expand Down
4 changes: 2 additions & 2 deletions common/inc/cunpack_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,8 @@ namespace ckernel::unpacker
}

inline constexpr bool is_32bit_input(const std::uint32_t unpack_src_format, const std::uint32_t unpack_dst_format) {
const uint input_df = unpack_src_format;
const uint output_df = unpack_dst_format;
const uint input_df = unpack_src_format & 0xF;
const uint output_df = unpack_dst_format & 0xF;
return ((input_df == (uint)DataFormat::Int32) || (input_df == (uint)DataFormat::Float32)) &&
((output_df == (uint)DataFormat::Int32) || (output_df == (uint)DataFormat::Float32));
}
Expand Down
3 changes: 3 additions & 0 deletions llk_lib/llk_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ enum ReluType {
MAX_THRESHOLD_RELU,
};

constexpr bool UnpackToDestEn = true;
constexpr bool UnpackToDestDis = false;

/*
Stochastic rounding modes:
None: No stochastic rounding enabled, default rounding is round to nearest even.
Expand Down
4 changes: 4 additions & 0 deletions llk_lib/llk_unpack_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ inline void _llk_unpack_dbg_feature_disable_(){
// workaround for bug tenstorrent/budabackend#1372
}

inline void _llk_unpack_clear_dbg_feature_disable_(){
reg_write(RISCV_DEBUG_REG_DBG_FEATURE_DISABLE, 0); // Unset debug feature disable
}

inline void _llk_enable_int8_fpu_math_() {
enable_int8_fpu_math();
}

0 comments on commit 971ace9

Please sign in to comment.