Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
b275e16a
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b275e16a
编写于
7月 01, 2019
作者:
C
Chunwei
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'chunwei/code-clean' into 'incubate/lite'
some code clean See merge request inference/paddlelite!94
上级
0d773c77
1ae26706
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
23 addition
and
22 deletion
+23
-22
paddle/fluid/lite/api/paddle_use_passes.h
paddle/fluid/lite/api/paddle_use_passes.h
+2
-2
paddle/fluid/lite/core/mir/CMakeLists.txt
paddle/fluid/lite/core/mir/CMakeLists.txt
+2
-2
paddle/fluid/lite/core/mir/static_kernel_pick_pass.cc
paddle/fluid/lite/core/mir/static_kernel_pick_pass.cc
+1
-1
paddle/fluid/lite/core/mir/type_precision_cast_pass.cc
paddle/fluid/lite/core/mir/type_precision_cast_pass.cc
+2
-2
paddle/fluid/lite/core/mir/type_precision_cast_pass.h
paddle/fluid/lite/core/mir/type_precision_cast_pass.h
+0
-0
paddle/fluid/lite/core/mir/type_target_cast_pass.cc
paddle/fluid/lite/core/mir/type_target_cast_pass.cc
+2
-2
paddle/fluid/lite/core/mir/type_target_cast_pass.h
paddle/fluid/lite/core/mir/type_target_cast_pass.h
+0
-0
paddle/fluid/lite/core/mir/variable_place_inference_pass_test.cc
...fluid/lite/core/mir/variable_place_inference_pass_test.cc
+1
-1
paddle/fluid/lite/core/optimizer.cc
paddle/fluid/lite/core/optimizer.cc
+1
-1
paddle/fluid/lite/core/optimizer.h
paddle/fluid/lite/core/optimizer.h
+4
-4
paddle/fluid/lite/core/type_system.h
paddle/fluid/lite/core/type_system.h
+5
-4
paddle/fluid/lite/core/types.h
paddle/fluid/lite/core/types.h
+2
-2
paddle/fluid/lite/tools/debug/model_debug_tool.cc
paddle/fluid/lite/tools/debug/model_debug_tool.cc
+1
-1
未找到文件。
paddle/fluid/lite/api/paddle_use_passes.h
浏览文件 @
b275e16a
...
...
@@ -18,7 +18,7 @@
USE_MIR_PASS
(
demo
);
USE_MIR_PASS
(
static_kernel_pick_pass
);
USE_MIR_PASS
(
variable_place_inference_pass
);
USE_MIR_PASS
(
type_target_
transform
_pass
);
USE_MIR_PASS
(
type_target_
cast
_pass
);
USE_MIR_PASS
(
generate_program_pass
);
USE_MIR_PASS
(
io_copy_kernel_pick_pass
);
USE_MIR_PASS
(
argument_type_display_pass
);
...
...
@@ -31,5 +31,5 @@ USE_MIR_PASS(identity_scale_eliminate_pass);
USE_MIR_PASS
(
lite_conv_elementwise_add_activation_fuse_pass
);
USE_MIR_PASS
(
lite_elementwise_add_activation_fuse_pass
);
USE_MIR_PASS
(
lite_quant_dequant_fuse_pass
);
USE_MIR_PASS
(
precision_cast_transform
_pass
);
USE_MIR_PASS
(
type_precision_cast
_pass
);
USE_MIR_PASS
(
trans_weight_pass
);
paddle/fluid/lite/core/mir/CMakeLists.txt
浏览文件 @
b275e16a
...
...
@@ -17,8 +17,8 @@ lite_cc_library(mir_passes
elimination/identity_scale_eliminate_pass.cc
static_kernel_pick_pass.cc
variable_place_inference_pass.cc
type_target_
transform
_pass.cc
precision_cast_transform
_pass.cc
type_target_
cast
_pass.cc
type_precision_cast
_pass.cc
io_copy_kernel_pick_pass.cc
graph_visualize_pass.cc
generate_program_pass.cc
...
...
paddle/fluid/lite/core/mir/static_kernel_pick_pass.cc
浏览文件 @
b275e16a
...
...
@@ -29,7 +29,7 @@ bool KernelScoreCmp(const std::pair<size_t, std::unique_ptr<KernelBase>>& a,
}
void
StaticKernelPickPass
::
Apply
(
const
std
::
unique_ptr
<
SSAGraph
>&
graph
)
{
CHECK
(
kernel_pick_factors_
.
AnyFactorC
onsidered
())
CHECK
(
kernel_pick_factors_
.
any_factor_c
onsidered
())
<<
"kernel_pick_factors should be specified first"
;
CHECK
(
graph
)
<<
"graph not valid"
;
// sort kernels by the factors.
...
...
paddle/fluid/lite/core/mir/
precision_cast_transform
_pass.cc
→
paddle/fluid/lite/core/mir/
type_precision_cast
_pass.cc
浏览文件 @
b275e16a
...
...
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/fluid/lite/core/mir/
precision_cast_transform
_pass.h"
#include "paddle/fluid/lite/core/mir/
type_precision_cast
_pass.h"
#include <list>
#include <memory>
#include <string>
...
...
@@ -162,5 +162,5 @@ void PrecisionCastPass::SetValidPlaces(const std::vector<Place>& valid_places) {
}
// namespace lite
}
// namespace paddle
REGISTER_MIR_PASS
(
precision_cast_transform
_pass
,
REGISTER_MIR_PASS
(
type_precision_cast
_pass
,
paddle
::
lite
::
mir
::
PrecisionCastPass
);
paddle/fluid/lite/core/mir/
precision_cast_transform
_pass.h
→
paddle/fluid/lite/core/mir/
type_precision_cast
_pass.h
浏览文件 @
b275e16a
文件已移动
paddle/fluid/lite/core/mir/type_target_
transform
_pass.cc
→
paddle/fluid/lite/core/mir/type_target_
cast
_pass.cc
浏览文件 @
b275e16a
...
...
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/fluid/lite/core/mir/type_target_
transform
_pass.h"
#include "paddle/fluid/lite/core/mir/type_target_
cast
_pass.h"
#include <list>
#include <memory>
#include <string>
...
...
@@ -142,5 +142,5 @@ void TypeTargetTransformPass::SetValidPlaces(
}
// namespace lite
}
// namespace paddle
REGISTER_MIR_PASS
(
type_target_
transform
_pass
,
REGISTER_MIR_PASS
(
type_target_
cast
_pass
,
paddle
::
lite
::
mir
::
TypeTargetTransformPass
);
paddle/fluid/lite/core/mir/type_target_
transform
_pass.h
→
paddle/fluid/lite/core/mir/type_target_
cast
_pass.h
浏览文件 @
b275e16a
文件已移动
paddle/fluid/lite/core/mir/variable_place_inference_pass_test.cc
浏览文件 @
b275e16a
...
...
@@ -60,7 +60,7 @@ TEST(variable_place_inference_pass, test) {
"argument_type_display_pass"
,
//
"variable_place_inference_pass"
,
//
"argument_type_display_pass"
,
//
"type_target_
transform_pass"
,
//
"type_target_
cast_pass"
,
//
});
Place
prefered_place
{
...
...
paddle/fluid/lite/core/optimizer.cc
浏览文件 @
b275e16a
...
...
@@ -15,7 +15,7 @@
#include "paddle/fluid/lite/core/optimizer.h"
#include <fstream>
#include "paddle/fluid/lite/core/mir/static_kernel_pick_pass.h"
#include "paddle/fluid/lite/core/mir/type_target_
transform
_pass.h"
#include "paddle/fluid/lite/core/mir/type_target_
cast
_pass.h"
#include "paddle/fluid/lite/model_parser/model_parser.h"
#include "paddle/fluid/lite/utils/all.h"
...
...
paddle/fluid/lite/core/optimizer.h
浏览文件 @
b275e16a
...
...
@@ -20,7 +20,7 @@
#include "paddle/fluid/lite/core/mir/pass_manager.h"
#include "paddle/fluid/lite/core/mir/ssa_graph.h"
#include "paddle/fluid/lite/core/mir/static_kernel_pick_pass.h"
#include "paddle/fluid/lite/core/mir/type_target_
transform
_pass.h"
#include "paddle/fluid/lite/core/mir/type_target_
cast
_pass.h"
#include "paddle/fluid/lite/core/program.h"
#include "paddle/fluid/lite/core/types.h"
#include "paddle/fluid/lite/model_parser/model_parser.h"
...
...
@@ -70,12 +70,12 @@ class Optimizer {
"static_kernel_pick_pass"
,
//
"variable_place_inference_pass"
,
//
"argument_type_display_pass"
,
//
"type_target_
transform_pass"
,
//
"type_target_
cast_pass"
,
//
"variable_place_inference_pass"
,
//
"argument_type_display_pass"
,
//
"io_copy_kernel_pick_pass"
,
//
"variable_place_inference_pass"
,
//
"
precision_cast_transform_pass"
,
//
"
type_precision_cast_pass"
,
//
"argument_type_display_pass"
,
//
"trans_weight_pass"
,
//
"runtime_context_assign_pass"
,
//
...
...
@@ -109,7 +109,7 @@ class Optimizer {
void
InitTargetTypeTransformPass
()
{
auto
*
pass
=
mir
::
PassManager
::
Global
().
LookUp
<
mir
::
TypeTargetTransformPass
>
(
"type_target_
transform
_pass"
);
"type_target_
cast
_pass"
);
CHECK
(
pass
);
CHECK
(
!
valid_places_
.
empty
());
LOG
(
INFO
)
<<
"valid_places.size "
<<
valid_places_
.
size
();
...
...
paddle/fluid/lite/core/type_system.h
浏览文件 @
b275e16a
...
...
@@ -34,11 +34,12 @@ namespace lite {
// Type is the definition of all the types that supported by the Variable that
// represents as the input and output of an operator or kernel.
// The DNN system is simple, and the architecture can not process that many data
// types as a compiler, or that will turn out to a chaos.
// The DNN system is simple, just a list of operators, and the architecture
// can not process that many data types as a compiler, or that will turn out to
// a chaos.
//
// We should make sure that the supported data types be registered here, and
// keep the
quantity
small and avoid using some special data types as op's
// keep the
set
small and avoid using some special data types as op's
// inputs or outputs, such as some runtime cache, those types can't be processed
// by the MIR.
//
...
...
@@ -51,7 +52,7 @@ namespace lite {
// transforming operators, for example, a DataLayoutTransformOp can convert a
// `TensorFp32NCHWTy` to a `TensorFp32NHWCTy`; a IoCopyOp can convert a
// `TensorFp32NCHWTy(kHost)` to `TensorFp32NCHWTy(kCUDA)`. There are many other
// convertions between different Types, but there are some unsupport
t
ed type
// convertions between different Types, but there are some unsupported type
// convertions, for example, there is noway to convert a `UnsupportedTy` to a
// `TensorAnyTy`.
//
...
...
paddle/fluid/lite/core/types.h
浏览文件 @
b275e16a
...
...
@@ -36,10 +36,10 @@ class KernelPickFactor {
};
// Has any factors considered.
bool
AnyFactorC
onsidered
()
const
{
return
data_
;
}
bool
any_factor_c
onsidered
()
const
{
return
data_
;
}
KernelPickFactor
&
ConsiderTarget
();
// P
er
fer a specific target, e.g. prefer CUDA kernels.
// P
re
fer a specific target, e.g. prefer CUDA kernels.
KernelPickFactor
&
ConsiderPrecision
();
KernelPickFactor
&
ConsiderDataLayout
();
KernelPickFactor
&
ConsiderDevice
();
...
...
paddle/fluid/lite/tools/debug/model_debug_tool.cc
浏览文件 @
b275e16a
...
...
@@ -46,7 +46,7 @@ void Run(DebugConfig* conf) {
std
::
vector
<
std
::
string
>
passes
{{
"static_kernel_pick_pass"
,
"variable_place_inference_pass"
,
"type_target_
transform
_pass"
,
"variable_place_inference_pass"
,
"type_target_
cast
_pass"
,
"variable_place_inference_pass"
,
"io_copy_kernel_pick_pass"
,
"variable_place_inference_pass"
,
"runtime_context_assign_pass"
,
}};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录