Skip to content

Commit

Permalink
rnn int8 kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Apr 18, 2024
1 parent e22a695 commit 9275f17
Show file tree
Hide file tree
Showing 7 changed files with 2,013 additions and 211 deletions.
2 changes: 1 addition & 1 deletion src/layer/arm/gru_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2376,7 +2376,7 @@ int GRU_arm::create_pipeline_bf16s(const Option& opt)
create_pipeline_int8(opt);

ncnn::Mat tmp;
ncnn::cast_float32_to_bfloat16(bias_c_data_packed, tmp, opt);
cast_float32_to_bfloat16(bias_c_data_packed, tmp, opt);
bias_c_data_packed = tmp;

return 0;
Expand Down
6 changes: 3 additions & 3 deletions src/layer/arm/gru_arm_asimdhp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1594,21 +1594,21 @@ int GRU_arm::create_pipeline_fp16s(const Option& opt)

{
ncnn::Mat tmp;
ncnn::cast_float32_to_float16(bias_c_data_packed, tmp, opt);
cast_float32_to_float16(bias_c_data_packed, tmp, opt);
bias_c_data_packed = tmp;
}

if (opt.use_fp16_arithmetic)
{
ncnn::Mat tmp;
ncnn::cast_float32_to_float16(weight_xc_data_int8_descales_packed, tmp, opt);
cast_float32_to_float16(weight_xc_data_int8_descales_packed, tmp, opt);
weight_xc_data_int8_descales_packed = tmp;
}

if (opt.use_fp16_arithmetic)
{
ncnn::Mat tmp;
ncnn::cast_float32_to_float16(weight_hc_data_int8_descales_packed, tmp, opt);
cast_float32_to_float16(weight_hc_data_int8_descales_packed, tmp, opt);
weight_hc_data_int8_descales_packed = tmp;
}

Expand Down
Loading

0 comments on commit 9275f17

Please sign in to comment.