提交 38ff42f9 编写于 作者: T tienfeek

fix fpga quant_dequant_op_fuser bug

上级 735864a0
......@@ -33,7 +33,7 @@ class Debugger {
void registerOutput(std::string op_type, zynqmp::Tensor* tensor) {
if (op_config[op_type]) {
// tensor->saveToFile(op_type, true);
tensor->saveToFile(op_type, true);
}
}
......@@ -43,6 +43,8 @@ class Debugger {
op_config["concat"] = true;
op_config["pooling"] = true;
op_config["conv"] = true;
op_config["dwconv"] = true;
op_config["ew_add"] = true;
op_config["crop"] = true;
op_config["feed"] = true;
op_config["mul"] = true;
......
......@@ -214,7 +214,9 @@ void DequantOpFuser::InsertNewNode(SSAGraph* graph,
for (int i = 0; i < weight_scale_size; i++) {
weight_scale.push_back(whole_weight_scale);
}
#ifndef LITE_WITH_FPGA
op_desc.SetAttr("enable_int8", true);
#endif
if (quantized_op->stmt()->op_info()->HasAttr("input_scale")) {
op_desc.SetAttr("input_scale", input_scale);
}
......
文件模式从 100644 更改为 100755
......@@ -76,6 +76,10 @@ void ConvCompute::Run() {
if (param.x->ZynqTensor()->shape().channel() != 1 &&
param.groups == param.x->ZynqTensor()->shape().channel()) {
dw_conv_pe_.dispatch();
#ifdef FPGA_PRINT_TENSOR
zynqmp::DepthwiseConvParam& dwconv_param = dw_conv_pe_.param();
Debugger::get_instance().registerOutput("dwconv", dwconv_param.output);
#endif
} else {
conv_pe_.dispatch();
#ifdef FPGA_PRINT_TENSOR
......@@ -103,3 +107,17 @@ REGISTER_LITE_KERNEL(
PRECISION(kFP16),
DATALAYOUT(kNHWC))})
.Finalize();
REGISTER_LITE_KERNEL(
depthwise_conv2d, kFPGA, kFP16, kNHWC, paddle::lite::kernels::fpga::ConvCompute, def)
.BindInput("Input",
{LiteType::GetTensorTy(TARGET(kFPGA),
PRECISION(kFP16),
DATALAYOUT(kNHWC))})
.BindInput("Bias", {LiteType::GetTensorTy(TARGET(kARM))})
.BindInput("Filter", {LiteType::GetTensorTy(TARGET(kARM))})
.BindOutput("Output",
{LiteType::GetTensorTy(TARGET(kFPGA),
PRECISION(kFP16),
DATALAYOUT(kNHWC))})
.Finalize();
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册