Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
919aa2ea
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看板
提交
919aa2ea
编写于
4月 09, 2018
作者:
_青葱
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' of
https://github.com/PaddlePaddle/Paddle
into initializer
Merge branch develop
上级
cd41dca2
1194b97b
变更
26
隐藏空白更改
内联
并排
Showing
26 changed file
with
76 addition
and
36 deletion
+76
-36
doc/fluid/design/concepts/images/parallel_executor_overview.dot
...uid/design/concepts/images/parallel_executor_overview.dot
+0
-0
doc/fluid/design/concepts/images/parallel_executor_overview.png
...uid/design/concepts/images/parallel_executor_overview.png
+0
-0
doc/fluid/design/concepts/index_cn.rst
doc/fluid/design/concepts/index_cn.rst
+1
-0
doc/fluid/design/concepts/index_en.rst
doc/fluid/design/concepts/index_en.rst
+1
-0
doc/fluid/design/concepts/parallel_executor.md
doc/fluid/design/concepts/parallel_executor.md
+0
-0
paddle/fluid/operators/activation_op.h
paddle/fluid/operators/activation_op.h
+2
-0
paddle/fluid/operators/adagrad_op.cc
paddle/fluid/operators/adagrad_op.cc
+1
-0
paddle/fluid/operators/array_operator.h
paddle/fluid/operators/array_operator.h
+1
-0
paddle/fluid/operators/assign_value_op.cc
paddle/fluid/operators/assign_value_op.cc
+2
-0
paddle/fluid/operators/assign_value_op.h
paddle/fluid/operators/assign_value_op.h
+1
-0
paddle/fluid/operators/auc_op.cc
paddle/fluid/operators/auc_op.cc
+1
-0
paddle/fluid/operators/auc_op.h
paddle/fluid/operators/auc_op.h
+9
-6
paddle/fluid/operators/average_accumulates_op.cc
paddle/fluid/operators/average_accumulates_op.cc
+5
-5
paddle/fluid/operators/average_accumulates_op.cu
paddle/fluid/operators/average_accumulates_op.cu
+5
-5
paddle/fluid/operators/average_accumulates_op.h
paddle/fluid/operators/average_accumulates_op.h
+4
-4
paddle/fluid/operators/spp_op.cc
paddle/fluid/operators/spp_op.cc
+2
-0
paddle/fluid/operators/spp_op.h
paddle/fluid/operators/spp_op.h
+2
-0
paddle/fluid/operators/sum_op.cc
paddle/fluid/operators/sum_op.cc
+2
-0
paddle/fluid/operators/sum_op.h
paddle/fluid/operators/sum_op.h
+1
-0
paddle/fluid/operators/top_k_op.h
paddle/fluid/operators/top_k_op.h
+2
-0
paddle/fluid/operators/transpose_op.cc
paddle/fluid/operators/transpose_op.cc
+1
-0
paddle/fluid/operators/transpose_op.h
paddle/fluid/operators/transpose_op.h
+1
-0
paddle/fluid/operators/unpool_op.cc
paddle/fluid/operators/unpool_op.cc
+2
-0
paddle/fluid/operators/unpool_op.h
paddle/fluid/operators/unpool_op.h
+2
-0
paddle/fluid/operators/warpctc_op.h
paddle/fluid/operators/warpctc_op.h
+1
-0
python/paddle/fluid/distribute_transpiler.py
python/paddle/fluid/distribute_transpiler.py
+27
-16
未找到文件。
doc/
design
/images/parallel_executor_overview.dot
→
doc/
fluid/design/concepts
/images/parallel_executor_overview.dot
浏览文件 @
919aa2ea
文件已移动
doc/
design
/images/parallel_executor_overview.png
→
doc/
fluid/design/concepts
/images/parallel_executor_overview.png
浏览文件 @
919aa2ea
文件已移动
doc/fluid/design/concepts/index_cn.rst
浏览文件 @
919aa2ea
...
...
@@ -16,3 +16,4 @@
block.md
scope.md
executor.md
parallel_executor.md
doc/fluid/design/concepts/index_en.rst
浏览文件 @
919aa2ea
...
...
@@ -16,3 +16,4 @@ Core Concepts
block.md
scope.md
executor.md
parallel_executor.md
doc/
design
/parallel_executor.md
→
doc/
fluid/design/concepts
/parallel_executor.md
浏览文件 @
919aa2ea
文件已移动
paddle/fluid/operators/activation_op.h
浏览文件 @
919aa2ea
...
...
@@ -13,6 +13,8 @@ See the License for the specific language governing permissions and
limitations under the License. */
#pragma once
#include <utility>
#include <vector>
#include "paddle/fluid/framework/eigen.h"
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/operators/detail/safe_ref.h"
...
...
paddle/fluid/operators/adagrad_op.cc
浏览文件 @
919aa2ea
...
...
@@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. */
#include "paddle/fluid/operators/adagrad_op.h"
#include <vector>
#include <cmath>
...
...
paddle/fluid/operators/array_operator.h
浏览文件 @
919aa2ea
...
...
@@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. */
#pragma once
#include <string>
#include "paddle/fluid/framework/lod_tensor_array.h"
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/platform/device_context.h"
...
...
paddle/fluid/operators/assign_value_op.cc
浏览文件 @
919aa2ea
...
...
@@ -13,6 +13,8 @@
// limitations under the License.
#include "paddle/fluid/operators/assign_value_op.h"
#include <string>
#include <vector>
namespace
paddle
{
namespace
operators
{
...
...
paddle/fluid/operators/assign_value_op.h
浏览文件 @
919aa2ea
...
...
@@ -14,6 +14,7 @@
#pragma once
#include <vector>
#include "paddle/fluid/framework/eigen.h"
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/platform/enforce.h"
...
...
paddle/fluid/operators/auc_op.cc
浏览文件 @
919aa2ea
...
...
@@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. */
#include "paddle/fluid/operators/auc_op.h"
#include <string>
namespace
paddle
{
namespace
operators
{
...
...
paddle/fluid/operators/auc_op.h
浏览文件 @
919aa2ea
...
...
@@ -13,6 +13,8 @@ See the License for the specific language governing permissions and
limitations under the License. */
#pragma once
#include <string>
#include <vector>
#include "paddle/fluid/framework/eigen.h"
#include "paddle/fluid/framework/op_registry.h"
...
...
@@ -40,7 +42,7 @@ class AucKernel : public framework::OpKernel<T> {
std
::
vector
<
float
>
thresholds_list
;
thresholds_list
.
reserve
(
num_thresholds
);
for
(
int
i
=
1
;
i
<
num_thresholds
-
1
;
i
++
)
{
thresholds_list
[
i
]
=
(
float
)
i
/
(
num_thresholds
-
1
);
thresholds_list
[
i
]
=
static_cast
<
float
>
(
i
)
/
(
num_thresholds
-
1
);
}
const
float
kEpsilon
=
1e-7
;
thresholds_list
[
0
]
=
0.0
f
-
kEpsilon
;
...
...
@@ -105,11 +107,12 @@ class AucKernel : public framework::OpKernel<T> {
float
*
fp_rate_data
=
fp_rate
.
mutable_data
<
float
>
(
ctx
.
GetPlace
());
float
*
rec_rate_data
=
rec_rate
.
mutable_data
<
float
>
(
ctx
.
GetPlace
());
for
(
int
i
=
0
;
i
<
num_thresholds
;
i
++
)
{
tp_rate_data
[
i
]
=
((
float
)
tp_data
[
i
]
+
epsilon
)
/
(
tp_data
[
i
]
+
fn_data
[
i
]
+
epsilon
);
fp_rate_data
[
i
]
=
(
float
)
fp_data
[
i
]
/
(
fp_data
[
i
]
+
tn_data
[
i
]
+
epsilon
);
rec_rate_data
[
i
]
=
((
float
)
tp_data
[
i
]
+
epsilon
)
/
(
tp_data
[
i
]
+
fp_data
[
i
]
+
epsilon
);
tp_rate_data
[
i
]
=
(
static_cast
<
float
>
(
tp_data
[
i
])
+
epsilon
)
/
(
tp_data
[
i
]
+
fn_data
[
i
]
+
epsilon
);
fp_rate_data
[
i
]
=
static_cast
<
float
>
(
fp_data
[
i
])
/
(
fp_data
[
i
]
+
tn_data
[
i
]
+
epsilon
);
rec_rate_data
[
i
]
=
(
static_cast
<
float
>
(
tp_data
[
i
])
+
epsilon
)
/
(
tp_data
[
i
]
+
fp_data
[
i
]
+
epsilon
);
}
*
auc_data
=
0.0
f
;
if
(
curve
==
"ROC"
)
{
...
...
paddle/fluid/operators/average_accumulates_op.cc
浏览文件 @
919aa2ea
...
...
@@ -19,15 +19,15 @@ namespace operators {
template
<
>
void
GetAccumulators
<
paddle
::
platform
::
CPUDeviceContext
>
(
const
framework
::
ExecutionContext
&
ctx
,
int64_t
&
num_updates_
,
int64_t
&
num_accumulates_
,
int64_t
&
old_num_accumulates_
)
{
const
framework
::
ExecutionContext
&
ctx
,
int64_t
*
num_updates_
,
int64_t
*
num_accumulates_
,
int64_t
*
old_num_accumulates_
)
{
auto
*
in_old_num_accumulates
=
ctx
.
Input
<
Tensor
>
(
"in_old_num_accumulates"
);
auto
*
in_num_accumulates
=
ctx
.
Input
<
Tensor
>
(
"in_num_accumulates"
);
auto
*
in_num_updates
=
ctx
.
Input
<
Tensor
>
(
"in_num_updates"
);
old_num_accumulates_
=
in_old_num_accumulates
->
data
<
int64_t
>
()[
0
];
num_accumulates_
=
in_num_accumulates
->
data
<
int64_t
>
()[
0
];
num_updates_
=
in_num_updates
->
data
<
int64_t
>
()[
0
];
*
old_num_accumulates_
=
in_old_num_accumulates
->
data
<
int64_t
>
()[
0
];
*
num_accumulates_
=
in_num_accumulates
->
data
<
int64_t
>
()[
0
];
*
num_updates_
=
in_num_updates
->
data
<
int64_t
>
()[
0
];
}
template
<
>
...
...
paddle/fluid/operators/average_accumulates_op.cu
浏览文件 @
919aa2ea
...
...
@@ -19,18 +19,18 @@ namespace paddle {
namespace
operators
{
template
<
>
void
GetAccumulators
<
paddle
::
platform
::
CUDADeviceContext
>
(
const
framework
::
ExecutionContext
&
ctx
,
int64_t
&
num_updates_
,
int64_t
&
num_accumulates_
,
int64_t
&
old_num_accumulates_
)
{
const
framework
::
ExecutionContext
&
ctx
,
int64_t
*
num_updates_
,
int64_t
*
num_accumulates_
,
int64_t
*
old_num_accumulates_
)
{
auto
*
in_old_num_accumulates
=
ctx
.
Input
<
Tensor
>
(
"in_old_num_accumulates"
);
auto
*
in_num_accumulates
=
ctx
.
Input
<
Tensor
>
(
"in_num_accumulates"
);
auto
*
in_num_updates
=
ctx
.
Input
<
Tensor
>
(
"in_num_updates"
);
auto
stream
=
ctx
.
cuda_device_context
().
stream
();
memory
::
Copy
(
platform
::
CPUPlace
(),
&
old_num_accumulates_
,
memory
::
Copy
(
platform
::
CPUPlace
(),
old_num_accumulates_
,
platform
::
CUDAPlace
(),
in_old_num_accumulates
->
data
<
int64_t
>
(),
sizeof
(
int64_t
),
stream
);
memory
::
Copy
(
platform
::
CPUPlace
(),
&
num_accumulates_
,
platform
::
CUDAPlace
(),
memory
::
Copy
(
platform
::
CPUPlace
(),
num_accumulates_
,
platform
::
CUDAPlace
(),
in_num_accumulates
->
data
<
int64_t
>
(),
sizeof
(
int64_t
),
stream
);
memory
::
Copy
(
platform
::
CPUPlace
(),
&
num_updates_
,
platform
::
CUDAPlace
(),
memory
::
Copy
(
platform
::
CPUPlace
(),
num_updates_
,
platform
::
CUDAPlace
(),
in_num_updates
->
data
<
int64_t
>
(),
sizeof
(
int64_t
),
stream
);
}
...
...
paddle/fluid/operators/average_accumulates_op.h
浏览文件 @
919aa2ea
...
...
@@ -29,8 +29,8 @@ using EigenVector = framework::EigenVector<T, MajorType, IndexType>;
template
<
typename
DeviceContext
>
void
GetAccumulators
(
const
framework
::
ExecutionContext
&
ctx
,
int64_t
&
num_updates
,
int64_t
&
num_accumulates
,
int64_t
&
old_num_accumulates
);
int64_t
*
num_updates
,
int64_t
*
num_accumulates
,
int64_t
*
old_num_accumulates
);
template
<
typename
DeviceContext
>
void
SetAccumulators
(
const
framework
::
ExecutionContext
&
ctx
,
...
...
@@ -47,8 +47,8 @@ class AverageAccumulatesKernel : public framework::OpKernel<T> {
int64_t
num_updates
=
0
;
int64_t
num_accumulates
=
0
;
int64_t
old_num_accumulates
=
0
;
GetAccumulators
<
DeviceContext
>
(
ctx
,
num_updates
,
num_accumulates
,
old_num_accumulates
);
GetAccumulators
<
DeviceContext
>
(
ctx
,
&
num_updates
,
&
num_accumulates
,
&
old_num_accumulates
);
// Get attrs
float
average_window
=
ctx
.
Attr
<
float
>
(
"average_window"
);
...
...
paddle/fluid/operators/spp_op.cc
浏览文件 @
919aa2ea
...
...
@@ -13,6 +13,8 @@ See the License for the specific language governing permissions and
limitations under the License. */
#include "paddle/fluid/operators/spp_op.h"
#include <string>
#include <vector>
namespace
paddle
{
namespace
operators
{
...
...
paddle/fluid/operators/spp_op.h
浏览文件 @
919aa2ea
...
...
@@ -13,6 +13,8 @@ See the License for the specific language governing permissions and
limitations under the License. */
#pragma once
#include <string>
#include <vector>
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/operators/math/math_function.h"
#include "paddle/fluid/operators/math/pooling.h"
...
...
paddle/fluid/operators/sum_op.cc
浏览文件 @
919aa2ea
...
...
@@ -10,6 +10,8 @@ See the License for the specific language governing permissions and
limitations under the License. */
#include "paddle/fluid/operators/sum_op.h"
#include <algorithm>
#include <string>
#include <vector>
#include "paddle/fluid/framework/var_type_inference.h"
#include "paddle/fluid/operators/detail/safe_ref.h"
...
...
paddle/fluid/operators/sum_op.h
浏览文件 @
919aa2ea
...
...
@@ -10,6 +10,7 @@ See the License for the specific language governing permissions and
limitations under the License. */
#pragma once
#include <vector>
#include "paddle/fluid/framework/eigen.h"
#include "paddle/fluid/framework/lod_tensor_array.h"
#include "paddle/fluid/framework/op_registry.h"
...
...
paddle/fluid/operators/top_k_op.h
浏览文件 @
919aa2ea
...
...
@@ -15,6 +15,8 @@ limitations under the License. */
#pragma once
#include <algorithm>
#include <iostream>
#include <utility>
#include <vector>
#include "paddle/fluid/framework/eigen.h"
#include "paddle/fluid/framework/op_registry.h"
...
...
paddle/fluid/operators/transpose_op.cc
浏览文件 @
919aa2ea
...
...
@@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. */
#include "paddle/fluid/operators/transpose_op.h"
#include <vector>
namespace
paddle
{
namespace
operators
{
...
...
paddle/fluid/operators/transpose_op.h
浏览文件 @
919aa2ea
...
...
@@ -14,6 +14,7 @@ limitations under the License. */
#pragma once
#include <vector>
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/operators/math/math_function.h"
...
...
paddle/fluid/operators/unpool_op.cc
浏览文件 @
919aa2ea
...
...
@@ -13,6 +13,8 @@ See the License for the specific language governing permissions and
limitations under the License. */
#include "paddle/fluid/operators/unpool_op.h"
#include <string>
#include <vector>
namespace
paddle
{
namespace
operators
{
...
...
paddle/fluid/operators/unpool_op.h
浏览文件 @
919aa2ea
...
...
@@ -14,6 +14,8 @@ limitations under the License. */
#pragma once
#include <string>
#include <vector>
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/operators/math/math_function.h"
#include "paddle/fluid/operators/math/unpooling.h"
...
...
paddle/fluid/operators/warpctc_op.h
浏览文件 @
919aa2ea
...
...
@@ -14,6 +14,7 @@ limitations under the License. */
#pragma once
#include <vector>
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/operators/math/math_function.h"
#include "paddle/fluid/operators/math/sequence_padding.h"
...
...
python/paddle/fluid/distribute_transpiler.py
浏览文件 @
919aa2ea
...
...
@@ -102,6 +102,8 @@ def split_dense_variable(var_list,
the parameter server side can gain better performance. By default
minimum block size is 1024. The max block size is used to prevent
very large blocks that may cause send error.
:return: A list of VarBlocks. Each VarBlock specifies a shard of
the var.
"""
blocks
=
[]
for
var
in
var_list
:
...
...
@@ -192,22 +194,24 @@ class DistributeTranspiler:
self
.
trainer_id
=
trainer_id
pserver_endpoints
=
pservers
.
split
(
","
)
# step1
# step1: For large parameters and gradients, split them into smaller
# blocks.
param_list
=
[
pg
[
0
]
for
pg
in
params_grads
]
grad_list
=
[
pg
[
1
]
for
pg
in
params_grads
]
grad_blocks
=
split_dense_variable
(
grad_list
,
len
(
pserver_endpoints
))
param_blocks
=
split_dense_variable
(
param_list
,
len
(
pserver_endpoints
))
# step2
# step2: Create new vars for the parameters and gradients blocks and
# add ops to do the split.
grad_var_mapping
=
self
.
_append_split_op
(
program
,
grad_blocks
)
# step3
param_var_mapping
=
self
.
_create_vars_from_blocklist
(
program
,
param_blocks
)
# step3: Add gradients as send op inputs and parameters as send
# op outputs.
send_inputs
=
[]
send_outputs
=
[]
for
b
in
grad_blocks
:
# append by order
varname
,
block_id
,
_
=
b
.
split
(
":"
)
send_inputs
.
append
(
grad_var_mapping
[
varname
][
int
(
block_id
)])
param_var_mapping
=
self
.
_create_vars_from_blocklist
(
program
,
param_blocks
)
for
b
in
param_blocks
:
varname
,
block_id
,
_
=
b
.
split
(
":"
)
send_outputs
.
append
(
param_var_mapping
[
varname
][
int
(
block_id
)])
...
...
@@ -237,7 +241,7 @@ class DistributeTranspiler:
"RPCClient"
:
rpc_client_var
},
attrs
=
{
"endpoints"
:
pserver_endpoints
,
"epmap"
:
eplist
})
# step4
# step4
: Concat the parameters splits together after recv.
for
varname
,
splited_var
in
param_var_mapping
.
iteritems
():
if
len
(
splited_var
)
<=
1
:
continue
...
...
@@ -258,13 +262,14 @@ class DistributeTranspiler:
def
get_pserver_program
(
self
,
endpoint
):
"""
Get pserver side program using the endpoint.
TODO(panyx0718): Revisit this assumption. what if #blocks > #pservers.
NOTE: assume blocks of the same variable is not distributed
on the same pserver, only change param/grad varnames for
trainers to fetch.
"""
# step1
pserver_program
=
Program
()
# step2
# step2
: Create vars to receive vars at parameter servers.
recv_inputs
=
[]
for
v
in
self
.
param_grad_ep_mapping
[
endpoint
][
"params"
]:
self
.
_clone_var
(
pserver_program
.
global_block
(),
v
)
...
...
@@ -278,12 +283,6 @@ class DistributeTranspiler:
orig_var_name
=
v
.
name
[:
suff_idx
]
else
:
orig_var_name
=
v
.
name
single_trainer_var
=
pserver_program
.
global_block
().
create_var
(
name
=
orig_var_name
,
persistable
=
True
,
type
=
v
.
type
,
dtype
=
v
.
dtype
,
shape
=
v
.
shape
)
if
self
.
trainers
>
1
:
for
trainer_id
in
xrange
(
self
.
trainers
):
var
=
pserver_program
.
global_block
().
create_var
(
...
...
@@ -294,6 +293,12 @@ class DistributeTranspiler:
shape
=
v
.
shape
)
recv_inputs
.
append
(
var
)
else
:
single_trainer_var
=
pserver_program
.
global_block
().
create_var
(
name
=
orig_var_name
,
persistable
=
True
,
type
=
v
.
type
,
dtype
=
v
.
dtype
,
shape
=
v
.
shape
)
recv_inputs
.
append
(
single_trainer_var
)
# step3
...
...
@@ -344,7 +349,7 @@ class DistributeTranspiler:
self
.
_append_pserver_non_opt_ops
(
block
,
op
)
append_block
=
optimize_block
# append lr decay ops to the child block if exits
# append lr decay ops to the child block if exi
s
ts
lr_ops
=
self
.
_get_lr_ops
()
if
len
(
lr_ops
)
>
0
:
for
_
,
op
in
enumerate
(
lr_ops
):
...
...
@@ -447,8 +452,10 @@ class DistributeTranspiler:
block_list
,
add_trainer_suffix
=
False
):
"""
Create vars for each split.
NOTE: only grads need to be named for different trainers, use
add_trainer_suffix to rename the grad vars.
:return: A dict mapping from original var name to each var split.
"""
block_map
=
dict
()
var_mapping
=
dict
()
...
...
@@ -615,6 +622,7 @@ class DistributeTranspiler:
type
=
"sum"
,
inputs
=
{
"X"
:
vars2merge
},
outputs
=
{
"Out"
:
merged_var
})
# TODO(panyx0718): What if it's SELECTED_ROWS.
if
not
merged_var
.
type
==
core
.
VarDesc
.
VarType
.
SELECTED_ROWS
:
optimize_block
.
append_op
(
type
=
"scale"
,
...
...
@@ -638,7 +646,7 @@ class DistributeTranspiler:
shape
=
param_block
.
shape
)
new_inputs
[
key
]
=
tmpvar
elif
key
==
"LearningRate"
:
# le
ra
ning rate variable has already be created by non-optimize op,
# le
ar
ning rate variable has already be created by non-optimize op,
# don't create it once again.
lr_varname
=
opt_op
.
input
(
key
)[
0
]
if
pserver_block
.
vars
.
has_key
(
lr_varname
):
...
...
@@ -773,6 +781,7 @@ class DistributeTranspiler:
return
False
def
_get_input_map_from_op
(
self
,
varmap
,
op
):
"""Returns a dict from op input name to the vars in varmap."""
iomap
=
dict
()
for
key
in
op
.
input_names
:
vars
=
[]
...
...
@@ -785,6 +794,7 @@ class DistributeTranspiler:
return
iomap
def
_get_output_map_from_op
(
self
,
varmap
,
op
):
"""Returns a dict from op output name to the vars in varmap."""
iomap
=
dict
()
for
key
in
op
.
output_names
:
vars
=
[]
...
...
@@ -812,6 +822,7 @@ class DistributeTranspiler:
find_ops
.
append
(
op
)
# make a union find struct by the ops in default_main_program
ufind
=
UnionFind
(
block
.
ops
)
for
op1
in
block
.
ops
:
for
op2
in
block
.
ops
:
# NOTE: we need to skip all optimize ops, since it is connected
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录