Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
9af23f1d
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
9af23f1d
编写于
2月 21, 2023
作者:
K
kangguangli
提交者:
GitHub
2月 21, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove test_fetch_unmerged (#50619)
上级
3c7e94d6
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
0 addition
and
141 deletion
+0
-141
python/paddle/fluid/tests/unittests/CMakeLists.txt
python/paddle/fluid/tests/unittests/CMakeLists.txt
+0
-2
python/paddle/fluid/tests/unittests/test_fetch_unmerged.py
python/paddle/fluid/tests/unittests/test_fetch_unmerged.py
+0
-136
tools/parallel_UT_rule.py
tools/parallel_UT_rule.py
+0
-2
tools/static_mode_white_list.py
tools/static_mode_white_list.py
+0
-1
未找到文件。
python/paddle/fluid/tests/unittests/CMakeLists.txt
浏览文件 @
9af23f1d
...
...
@@ -890,7 +890,6 @@ set_tests_properties(
test_dataloader_keep_order
test_dataloader_unkeep_order
test_parallel_ssa_graph_inference_feed_partial_data
test_fetch_unmerged
test_buffer_shared_memory_reuse_pass
PROPERTIES LABELS
"RUN_TYPE=DIST"
)
set_tests_properties
(
...
...
@@ -968,7 +967,6 @@ set_tests_properties(test_inplace_softmax_with_cross_entropy PROPERTIES TIMEOUT
120
)
set_tests_properties
(
test_cross_entropy2_op PROPERTIES TIMEOUT 120
)
set_tests_properties
(
test_cross_entropy_loss PROPERTIES TIMEOUT 180
)
set_tests_properties
(
test_fetch_unmerged PROPERTIES TIMEOUT 120
)
set_tests_properties
(
test_gru_unit_op PROPERTIES TIMEOUT 120
)
set_tests_properties
(
test_activation_nn_grad PROPERTIES TIMEOUT 200
)
set_tests_properties
(
test_empty_op PROPERTIES TIMEOUT 120
)
...
...
python/paddle/fluid/tests/unittests/test_fetch_unmerged.py
已删除
100644 → 0
浏览文件 @
3c7e94d6
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import
os
import
unittest
import
numpy
as
np
import
paddle
import
paddle.fluid
as
fluid
os
.
environ
[
"CPU_NUM"
]
=
"2"
class
TestFetchUnmerged
(
unittest
.
TestCase
):
def
conv_net
(
self
,
img
,
label
):
conv_pool_1
=
fluid
.
nets
.
simple_img_conv_pool
(
input
=
img
,
filter_size
=
5
,
num_filters
=
8
,
pool_size
=
2
,
pool_stride
=
2
,
pool_type
=
'max'
,
act
=
"relu"
,
)
conv_pool_1
=
paddle
.
static
.
nn
.
batch_norm
(
conv_pool_1
)
conv_pool_2
=
fluid
.
nets
.
simple_img_conv_pool
(
input
=
conv_pool_1
,
filter_size
=
5
,
num_filters
=
16
,
pool_size
=
2
,
pool_stride
=
2
,
pool_type
=
'avg'
,
act
=
"relu"
,
)
hidden
=
paddle
.
static
.
nn
.
fc
(
x
=
conv_pool_2
,
size
=
32
,
activation
=
'relu'
)
prediction
=
paddle
.
static
.
nn
.
fc
(
x
=
hidden
,
size
=
10
,
activation
=
'softmax'
)
loss
=
paddle
.
nn
.
functional
.
cross_entropy
(
input
=
prediction
,
label
=
label
,
reduction
=
'none'
,
use_softmax
=
False
)
avg_loss
=
paddle
.
mean
(
loss
)
return
avg_loss
,
prediction
def
build_program
(
self
,
main
,
startup
,
is_test
):
with
fluid
.
unique_name
.
guard
():
with
fluid
.
program_guard
(
main
,
startup
):
img
=
paddle
.
static
.
data
(
name
=
'image'
,
shape
=
[
-
1
,
1
,
28
,
28
],
dtype
=
'float32'
)
label
=
paddle
.
static
.
data
(
name
=
'label'
,
shape
=
[
-
1
,
1
],
dtype
=
'int64'
)
loss
,
prediction
=
self
.
conv_net
(
img
,
label
)
if
not
is_test
:
opt
=
fluid
.
optimizer
.
Adam
(
learning_rate
=
0.001
)
opt
.
minimize
(
loss
)
return
[
img
,
label
],
loss
,
prediction
def
fetch_unmerged
(
self
,
use_cuda
=
True
):
main_program
=
fluid
.
Program
()
startup_program
=
fluid
.
Program
()
feeds
,
loss
,
prediction
=
self
.
build_program
(
main_program
,
startup_program
,
False
)
place
=
fluid
.
CUDAPlace
(
0
)
if
use_cuda
else
fluid
.
CPUPlace
()
exe
=
fluid
.
Executor
(
place
)
exe
.
run
(
startup_program
)
build_strategy
=
fluid
.
BuildStrategy
()
binary
=
fluid
.
CompiledProgram
(
main_program
).
with_data_parallel
(
loss_name
=
loss
.
name
,
build_strategy
=
build_strategy
)
iters
=
2
batch_size
=
16
train_reader
=
paddle
.
batch
(
paddle
.
reader
.
shuffle
(
paddle
.
dataset
.
mnist
.
train
(),
buf_size
=
500
),
batch_size
=
batch_size
,
)
feeder
=
fluid
.
DataFeeder
(
feed_list
=
feeds
,
place
=
place
)
device_num
=
fluid
.
core
.
get_cuda_device_count
()
if
use_cuda
else
2
for
_
in
range
(
iters
):
data
=
next
(
train_reader
())
loss_v
,
prediction_v
=
exe
.
run
(
binary
,
feed
=
feeder
.
feed
(
data
),
fetch_list
=
[
loss
,
prediction
],
return_merged
=
False
,
)
self
.
assertEqual
(
np
.
array
(
loss_v
).
shape
,
(
device_num
,
1
))
self
.
assertEqual
(
np
.
array
(
prediction_v
).
shape
,
(
device_num
,
batch_size
/
device_num
,
10
),
)
for
_
in
range
(
iters
):
data
=
next
(
train_reader
())
loss_v
,
prediction_v
=
exe
.
run
(
binary
,
feed
=
feeder
.
feed
(
data
),
fetch_list
=
[
loss
,
prediction
],
return_merged
=
True
,
)
self
.
assertEqual
(
np
.
array
(
loss_v
).
shape
,
(
device_num
,))
self
.
assertEqual
(
np
.
array
(
prediction_v
).
shape
,
(
batch_size
,
10
))
def
test_fetch_unmerged
(
self
):
if
fluid
.
core
.
is_compiled_with_cuda
():
self
.
fetch_unmerged
(
use_cuda
=
True
)
self
.
fetch_unmerged
(
use_cuda
=
False
)
def
test_fetch_unmerged_parallel_graph
(
self
):
fluid
.
core
.
globals
()[
'FLAGS_enable_parallel_graph'
]
=
True
if
fluid
.
core
.
is_compiled_with_cuda
():
self
.
fetch_unmerged
(
use_cuda
=
True
)
self
.
fetch_unmerged
(
use_cuda
=
False
)
fluid
.
core
.
globals
()[
'FLAGS_enable_parallel_graph'
]
=
False
if
__name__
==
'__main__'
:
unittest
.
main
()
tools/parallel_UT_rule.py
浏览文件 @
9af23f1d
...
...
@@ -1506,7 +1506,6 @@ FOURTH_HIGH_PARALLEL_JOB_NEW = [
'test_smooth_l1_loss'
,
'test_bilateral_slice_op'
,
'test_inplace_abn_op'
,
'test_fetch_unmerged'
,
'test_parallel_executor_seresnext_base_gpu'
,
'test_parallel_executor_seresnext_with_fuse_all_reduce_gpu'
,
'test_parallel_ssa_graph_inference_feed_partial_data'
,
...
...
@@ -2336,7 +2335,6 @@ TETRAD_PARALLEL_JOB = [
'test_tensorrt_engine'
,
'test_load_state_dict_from_old_format'
,
'test_fuse_elewise_add_act_pass'
,
'test_fetch_unmerged'
,
'test_randint_op'
,
'test_standalone_controlflow'
,
'test_standalone_multiply_write'
,
...
...
tools/static_mode_white_list.py
浏览文件 @
9af23f1d
...
...
@@ -197,7 +197,6 @@ STATIC_MODE_TESTING_LIST = [
'test_fc_op'
,
'test_feed_data_check_shape_type'
,
'test_fetch_lod_tensor_array'
,
'test_fetch_unmerged'
,
'test_fetch_var'
,
'test_fill_any_like_op'
,
'test_fill_constant_op'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录