Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
d0177f95
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
331
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
271
列表
看板
标记
里程碑
合并请求
78
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle-Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
271
Issue
271
列表
看板
标记
里程碑
合并请求
78
合并请求
78
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d0177f95
编写于
3月 27, 2020
作者:
C
chonwhite
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed sequence_pool bug
上级
4ab75386
变更
11
显示空白变更内容
内联
并排
Showing
11 changed file
with
18 addition
and
19 deletion
+18
-19
CMakeLists.txt
CMakeLists.txt
+5
-0
lite/backends/fpga/KD/llapi/filter.cpp
lite/backends/fpga/KD/llapi/filter.cpp
+2
-2
lite/backends/fpga/KD/llapi/zynqmp_api.cpp
lite/backends/fpga/KD/llapi/zynqmp_api.cpp
+1
-1
lite/backends/fpga/KD/pes/input_pe.hpp
lite/backends/fpga/KD/pes/input_pe.hpp
+1
-9
lite/backends/fpga/KD/pes/output_pe.hpp
lite/backends/fpga/KD/pes/output_pe.hpp
+4
-2
lite/backends/fpga/KD/pes/pooling_pe.hpp
lite/backends/fpga/KD/pes/pooling_pe.hpp
+1
-1
lite/kernels/arm/sequence_pool_compute.cc
lite/kernels/arm/sequence_pool_compute.cc
+1
-0
lite/kernels/fpga/CMakeLists.txt
lite/kernels/fpga/CMakeLists.txt
+0
-1
lite/kernels/fpga/fetch_compute.cc
lite/kernels/fpga/fetch_compute.cc
+1
-1
lite/kernels/host/one_hot_compute.cc
lite/kernels/host/one_hot_compute.cc
+1
-1
lite/operators/one_hot_op.cc
lite/operators/one_hot_op.cc
+1
-1
未找到文件。
CMakeLists.txt
浏览文件 @
d0177f95
...
@@ -24,6 +24,11 @@ endif(WITH_PADDLE_MOBILE)
...
@@ -24,6 +24,11 @@ endif(WITH_PADDLE_MOBILE)
# set(CMAKE_BUILD_TYPE DEBUG)
# set(CMAKE_BUILD_TYPE DEBUG)
SET
(
CMAKE_BUILD_TYPE
"Release"
)
SET
(
CMAKE_CXX_FLAGS_RELEASE
"$ENV{CXXFLAGS} -O3 -Wall"
)
set
(
PADDLE_SOURCE_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
)
set
(
PADDLE_SOURCE_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
)
set
(
PADDLE_BINARY_DIR
${
CMAKE_CURRENT_BINARY_DIR
}
)
set
(
PADDLE_BINARY_DIR
${
CMAKE_CURRENT_BINARY_DIR
}
)
set
(
CMAKE_CXX_STANDARD 11
)
set
(
CMAKE_CXX_STANDARD 11
)
...
...
lite/backends/fpga/KD/llapi/filter.cpp
浏览文件 @
d0177f95
...
@@ -234,8 +234,8 @@ int8_t* format_filter(float* data_in,
...
@@ -234,8 +234,8 @@ int8_t* format_filter(float* data_in,
float
*
filter_start
=
data_in
+
n
*
chw
;
float
*
filter_start
=
data_in
+
n
*
chw
;
float
f_max
=
find_max
(
filter_start
,
chw
);
float
f_max
=
find_max
(
filter_start
,
chw
);
int8_t
*
quantized_start
=
quantized_data
+
n
*
chw
;
int8_t
*
quantized_start
=
quantized_data
+
n
*
chw
;
quantize
(
filter_start
,
quantized_start
,
chw
,
max
);
quantize
(
filter_start
,
quantized_start
,
chw
,
f_
max
);
filter_max
.
push_back
(
max
);
filter_max
.
push_back
(
f_
max
);
}
}
int8_t
*
hwc_data
=
int8_t
*
hwc_data
=
...
...
lite/backends/fpga/KD/llapi/zynqmp_api.cpp
浏览文件 @
d0177f95
...
@@ -187,7 +187,7 @@ int get_device_info(const struct DeviceInfo &args) {
...
@@ -187,7 +187,7 @@ int get_device_info(const struct DeviceInfo &args) {
int
perform_bypass
(
const
struct
BypassArgs
&
args
)
{
int
perform_bypass
(
const
struct
BypassArgs
&
args
)
{
int
ret
=
-
1
;
int
ret
=
-
1
;
int
size
=
args
.
image
.
channels
*
args
.
image
.
width
*
args
.
image
.
height
;
int
size
=
args
.
image
.
channels
*
args
.
image
.
width
*
args
.
image
.
height
;
int
max_size
=
1
<<
2
1
;
int
max_size
=
1
<<
2
2
;
float
times
=
1.0
*
size
/
max_size
;
float
times
=
1.0
*
size
/
max_size
;
int
count
=
static_cast
<
int
>
(
times
);
int
count
=
static_cast
<
int
>
(
times
);
...
...
lite/backends/fpga/KD/pes/input_pe.hpp
浏览文件 @
d0177f95
...
@@ -29,28 +29,20 @@ class InputPE : public PE {
...
@@ -29,28 +29,20 @@ class InputPE : public PE {
}
}
bool
dispatch
()
{
bool
dispatch
()
{
std
::
cout
<<
"input_dispatch()
\n
"
;
//
std::cout << "input_dispatch()\n";
Tensor
*
input
=
param_
.
input
;
Tensor
*
input
=
param_
.
input
;
Tensor
*
output
=
param_
.
output
;
Tensor
*
output
=
param_
.
output
;
Tensor
*
src
=
input
;
Tensor
*
src
=
input
;
// std::cout << "input:" << input << std::endl;
input
->
flush
();
input
->
flush
();
// std::cout << "input_flush()\n";
Tensor
half_tensor
;
Tensor
half_tensor
;
if
(
input
->
dataType
()
==
DataType
::
FP32
)
{
if
(
input
->
dataType
()
==
DataType
::
FP32
)
{
// std::cout << "2()\n";
half_tensor
.
mutableData
<
void
*>
(
DataType
::
FP16
,
input
->
shape
());
half_tensor
.
mutableData
<
void
*>
(
DataType
::
FP16
,
input
->
shape
());
// std::cout << "3()\n";
half_tensor
.
copyFrom
(
input
);
half_tensor
.
copyFrom
(
input
);
// std::cout << "4()\n";
src
=
&
half_tensor
;
src
=
&
half_tensor
;
}
}
// std::cout << "5()\n";
output
->
mutableData
<
void
>
();
output
->
mutableData
<
void
>
();
// std::cout << "6()\n";
src
->
alignImage
(
output
,
true
);
src
->
alignImage
(
output
,
true
);
// std::cout << "7()\n";
return
true
;
return
true
;
}
}
...
...
lite/backends/fpga/KD/pes/output_pe.hpp
浏览文件 @
d0177f95
...
@@ -54,8 +54,10 @@ class OutputPE : public PE {
...
@@ -54,8 +54,10 @@ class OutputPE : public PE {
output
->
data
<
void
>
(),
output
->
data
<
void
>
(),
output
->
shape
().
numel
()
*
sizeof
(
float
));
output
->
shape
().
numel
()
*
sizeof
(
float
));
// auto max = fpga_get_memory_size_max();
fpga_reset
();
// std::cout << "===== Max: ===== :: " << max << std::endl;
auto
max
=
fpga_get_memory_size_max
();
std
::
cout
<<
"PL ===== Max: ===== :: "
<<
max
<<
std
::
endl
;
return
true
;
return
true
;
}
}
...
...
lite/backends/fpga/KD/pes/pooling_pe.hpp
浏览文件 @
d0177f95
...
@@ -67,7 +67,7 @@ class PoolingPE : public PE {
...
@@ -67,7 +67,7 @@ class PoolingPE : public PE {
use_cpu_
=
output
->
shape
().
width
()
==
1
&&
output
->
shape
().
height
()
==
1
&&
use_cpu_
=
output
->
shape
().
width
()
==
1
&&
output
->
shape
().
height
()
==
1
&&
(
k_width
>
255
||
k_height
>
255
);
(
k_width
>
255
||
k_height
>
255
);
use_cpu_
=
param_
.
type
==
AVERAGE
;
//
use_cpu_ = param_.type == AVERAGE;
}
}
void
compute
()
{
void
compute
()
{
...
...
lite/kernels/arm/sequence_pool_compute.cc
浏览文件 @
d0177f95
...
@@ -59,6 +59,7 @@ void SequencePoolCompute::Run() {
...
@@ -59,6 +59,7 @@ void SequencePoolCompute::Run() {
for
(
int
i
=
0
;
i
<=
batch_size
;
i
++
)
{
for
(
int
i
=
0
;
i
<=
batch_size
;
i
++
)
{
offset_new
[
i
]
=
i
;
offset_new
[
i
]
=
i
;
}
}
(
output
->
mutable_lod
())
->
clear
();
(
output
->
mutable_lod
())
->
push_back
(
offset_new
);
(
output
->
mutable_lod
())
->
push_back
(
offset_new
);
}
}
...
...
lite/kernels/fpga/CMakeLists.txt
浏览文件 @
d0177f95
...
@@ -14,7 +14,6 @@ add_kernel(conv_compute_fpga FPGA basic SRCS conv_compute.cc DEPS ${fpga_deps})
...
@@ -14,7 +14,6 @@ add_kernel(conv_compute_fpga FPGA basic SRCS conv_compute.cc DEPS ${fpga_deps})
# add_kernel(density_prior_box_compute_fpga FPGA basic SRCS density_prior_box_compute.cc DEPS ${fpga_deps})
# add_kernel(density_prior_box_compute_fpga FPGA basic SRCS density_prior_box_compute.cc DEPS ${fpga_deps})
add_kernel
(
dropout_compute_fpga FPGA basic SRCS dropout_compute.cc DEPS
${
fpga_deps
}
)
add_kernel
(
dropout_compute_fpga FPGA basic SRCS dropout_compute.cc DEPS
${
fpga_deps
}
)
add_kernel
(
elementwise_compute_fpga FPGA basic SRCS elementwise_compute.cc DEPS
${
fpga_deps
}
)
add_kernel
(
elementwise_compute_fpga FPGA basic SRCS elementwise_compute.cc DEPS
${
fpga_deps
}
)
# add_kernel(feed_compute_fpga FPGA basic SRCS fc_compute.cc DEPS ${fpga_deps})
add_kernel
(
fc_compute_fpga FPGA basic SRCS fc_compute.cc DEPS
${
fpga_deps
}
)
add_kernel
(
fc_compute_fpga FPGA basic SRCS fc_compute.cc DEPS
${
fpga_deps
}
)
add_kernel
(
gru_compute_fpga FPGA extra SRCS gru_compute.cc DEPS
${
fpga_deps
}
)
add_kernel
(
gru_compute_fpga FPGA extra SRCS gru_compute.cc DEPS
${
fpga_deps
}
)
...
...
lite/kernels/fpga/fetch_compute.cc
浏览文件 @
d0177f95
...
@@ -82,6 +82,6 @@ REGISTER_LITE_KERNEL(fetch,
...
@@ -82,6 +82,6 @@ REGISTER_LITE_KERNEL(fetch,
kNHWC
,
kNHWC
,
paddle
::
lite
::
kernels
::
fpga
::
FetchCompute
,
paddle
::
lite
::
kernels
::
fpga
::
FetchCompute
,
host_host
)
host_host
)
.
BindInput
(
"X"
,
{
LiteType
::
GetTensorTy
(
TARGET
(
k
Host
))})
.
BindInput
(
"X"
,
{
LiteType
::
GetTensorTy
(
TARGET
(
k
ARM
))})
.
BindOutput
(
"Out"
,
{
LiteType
::
GetTensorTy
(
TARGET
(
kHost
))})
.
BindOutput
(
"Out"
,
{
LiteType
::
GetTensorTy
(
TARGET
(
kHost
))})
.
Finalize
();
.
Finalize
();
lite/kernels/host/one_hot_compute.cc
浏览文件 @
d0177f95
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
#include <utility>
#include <utility>
#include <vector>
#include <vector>
#include "lite/backends/fpga/KD/debugger.hpp"
//
#include "lite/backends/fpga/KD/debugger.hpp"
#include "lite/kernels/host/one_hot_compute.h"
#include "lite/kernels/host/one_hot_compute.h"
#include "lite/utils/paddle_enforce.h"
#include "lite/utils/paddle_enforce.h"
...
...
lite/operators/one_hot_op.cc
浏览文件 @
d0177f95
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
#include "lite/operators/one_hot_op.h"
#include "lite/operators/one_hot_op.h"
#include "lite/core/op_registry.h"
#include "lite/core/op_registry.h"
#include "lite/backends/fpga/KD/debugger.hpp"
//
#include "lite/backends/fpga/KD/debugger.hpp"
namespace
paddle
{
namespace
paddle
{
namespace
lite
{
namespace
lite
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录