Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable unpack_to_dest for metal by default, enhance to work with uint32 #14

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
}
Loading