Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
c5ae21f4
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
c5ae21f4
编写于
5月 06, 2021
作者:
G
gongweibao
提交者:
GitHub
5月 06, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix bugs of pipeline on ascend. (#32737)
上级
f1c68a08
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
12 addition
and
10 deletion
+12
-10
paddle/fluid/framework/device_worker.h
paddle/fluid/framework/device_worker.h
+1
-1
paddle/fluid/framework/device_worker_factory.cc
paddle/fluid/framework/device_worker_factory.cc
+1
-1
paddle/fluid/framework/pipeline_trainer.cc
paddle/fluid/framework/pipeline_trainer.cc
+2
-2
paddle/fluid/framework/section_worker.cc
paddle/fluid/framework/section_worker.cc
+1
-1
paddle/fluid/framework/trainer.h
paddle/fluid/framework/trainer.h
+1
-1
paddle/fluid/framework/trainer_factory.cc
paddle/fluid/framework/trainer_factory.cc
+2
-1
paddle/fluid/operators/collective/c_allreduce_op.h
paddle/fluid/operators/collective/c_allreduce_op.h
+1
-0
python/paddle/fluid/framework.py
python/paddle/fluid/framework.py
+2
-2
python/paddle/fluid/optimizer.py
python/paddle/fluid/optimizer.py
+1
-1
未找到文件。
paddle/fluid/framework/device_worker.h
浏览文件 @
c5ae21f4
...
...
@@ -639,7 +639,7 @@ class PSGPUWorker : public HogwildWorker {
#endif
#if defined(PADDLE_WITH_NCCL) || defined(PADDLE_WITH_RCCL) || \
defined(WITH_ASCEND_CL)
defined(
PADDLE_
WITH_ASCEND_CL)
class
SectionWorker
:
public
DeviceWorker
{
public:
SectionWorker
()
{}
...
...
paddle/fluid/framework/device_worker_factory.cc
浏览文件 @
c5ae21f4
...
...
@@ -80,7 +80,7 @@ REGISTER_DEVICE_WORKER_CLASS(PSGPUWorker);
#endif
#if defined(PADDLE_WITH_NCCL) || defined(PADDLE_WITH_RCCL) || \
defined(WITH_ASCEND_CL)
defined(
PADDLE_
WITH_ASCEND_CL)
REGISTER_DEVICE_WORKER_CLASS
(
SectionWorker
);
#endif
}
// namespace framework
...
...
paddle/fluid/framework/pipeline_trainer.cc
浏览文件 @
c5ae21f4
...
...
@@ -13,7 +13,7 @@
// limitations under the License.
#if defined(PADDLE_WITH_NCCL) || defined(PADDLE_WITH_RCCL) || \
defined(WITH_ASCEND_CL)
defined(
PADDLE_
WITH_ASCEND_CL)
#include "paddle/fluid/framework/data_feed_factory.h"
#include "paddle/fluid/framework/device_worker_factory.h"
#include "paddle/fluid/framework/trainer.h"
...
...
@@ -37,7 +37,7 @@ void PipelineTrainer::Initialize(const TrainerDesc& trainer_desc,
int
place_id
=
section_config
.
place_id
();
#if (defined PADDLE_WITH_NCCL)
place_
=
platform
::
CUDAPlace
(
place_id
);
#elif (defined WITH_ASCEND_CL) // NOLINT
#elif (defined
PADDLE_
WITH_ASCEND_CL) // NOLINT
place_
=
platform
::
NPUPlace
(
place_id
);
#endif
worker_
=
DeviceWorkerFactory
::
CreateDeviceWorker
(
...
...
paddle/fluid/framework/section_worker.cc
浏览文件 @
c5ae21f4
...
...
@@ -10,7 +10,7 @@ See the License for the specific language governing permissions and
limitations under the License. */
#if defined(PADDLE_WITH_NCCL) || defined(PADDLE_WITH_RCCL) || \
defined(WITH_ASCEND_CL)
defined(
PADDLE_
WITH_ASCEND_CL)
#include <float.h>
#include "paddle/fluid/framework/device_worker.h"
#include "paddle/fluid/framework/executor_gc_helper.h"
...
...
paddle/fluid/framework/trainer.h
浏览文件 @
c5ae21f4
...
...
@@ -332,7 +332,7 @@ class PSGPUTrainer : public TrainerBase {
#endif
#if defined(PADDLE_WITH_NCCL) || defined(PADDLE_WITH_RCCL) || \
defined(WITH_ASCEND_CL)
defined(
PADDLE_
WITH_ASCEND_CL)
class
PipelineTrainer
:
public
TrainerBase
{
public:
PipelineTrainer
()
{}
...
...
paddle/fluid/framework/trainer_factory.cc
浏览文件 @
c5ae21f4
...
...
@@ -76,7 +76,8 @@ REGISTER_TRAINER_CLASS(HeterBoxTrainer);
(defined PADDLE_WITH_PSLIB)
REGISTER_TRAINER_CLASS
(
PSGPUTrainer
);
#endif
#if defined(PADDLE_WITH_NCCL) || defined(PADDLE_WITH_RCCL)
#if defined(PADDLE_WITH_NCCL) || defined(PADDLE_WITH_RCCL) || \
defined(PADDLE_WITH_ASCEND_CL)
REGISTER_TRAINER_CLASS
(
PipelineTrainer
);
#endif
}
// namespace framework
...
...
paddle/fluid/operators/collective/c_allreduce_op.h
浏览文件 @
c5ae21f4
...
...
@@ -131,6 +131,7 @@ class CAllReduceOpASCENDKernel : public framework::OpKernel<T> {
int64_t
numel
=
in
->
numel
();
void
*
sendbuff
=
reinterpret_cast
<
void
*>
(
const_cast
<
T
*>
(
in
->
data
<
T
>
()));
out
->
mutable_data
<
T
>
(
in
->
dims
(),
ctx
.
GetPlace
());
void
*
recvbuff
=
reinterpret_cast
<
void
*>
(
out
->
data
<
T
>
());
int
ring_id
=
ctx
.
Attr
<
int
>
(
"ring_id"
);
...
...
python/paddle/fluid/framework.py
浏览文件 @
c5ae21f4
...
...
@@ -6124,9 +6124,9 @@ def device_guard(device=None):
device
,
index
=
device
.
split
(
':'
)
if
device
==
'cpu'
:
raise
ValueError
(
"Should not set device id for cpu."
)
if
device
not
in
[
'cpu'
,
'gpu'
,
''
,
None
]:
if
device
not
in
[
'cpu'
,
'gpu'
,
'
npu'
,
'
'
,
None
]:
raise
ValueError
(
"The Attr(device) should be 'cpu' or 'gpu', and it can also be empty string or None "
"The Attr(device) should be 'cpu'
'npu'
or 'gpu', and it can also be empty string or None "
"when there is no need to specify device. But received %s"
%
device
)
if
index
:
device
=
":"
.
join
([
device
,
index
])
...
...
python/paddle/fluid/optimizer.py
浏览文件 @
c5ae21f4
...
...
@@ -4116,7 +4116,7 @@ class PipelineOptimizer(object):
device
=
op
.
attr
(
self
.
_op_device_key
)
\
if
op
.
has_attr
(
self
.
_op_device_key
)
else
None
if
device
:
assert
device
[
0
:
3
]
==
'gpu'
,
"Now, only g
pu devices are "
\
assert
device
[
0
:
3
]
==
'gpu'
or
dev_type
==
'npu'
,
"Now, only gpu and n
pu devices are "
\
"supported in pipeline parallemism."
return
device
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录