Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
438ca7f6
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
438ca7f6
编写于
7月 21, 2022
作者:
Z
zhaoyingli
提交者:
GitHub
7月 21, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[AutoParallel] fix unittest with paddle.distributed.launch (#44439)
* fix unittest * fix log_dir * _enable_legacy_dygraph
上级
98e96853
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
21 addition
and
18 deletion
+21
-18
python/paddle/distributed/auto_parallel/process_group.py
python/paddle/distributed/auto_parallel/process_group.py
+4
-1
python/paddle/fluid/tests/unittests/auto_parallel/test_auto_parallel_relaunch.py
...ts/unittests/auto_parallel/test_auto_parallel_relaunch.py
+1
-1
python/paddle/fluid/tests/unittests/auto_parallel/test_converter.py
...dle/fluid/tests/unittests/auto_parallel/test_converter.py
+5
-5
python/paddle/fluid/tests/unittests/auto_parallel/test_engine_api.py
...le/fluid/tests/unittests/auto_parallel/test_engine_api.py
+2
-2
python/paddle/fluid/tests/unittests/auto_parallel/test_engine_api_dp.py
...fluid/tests/unittests/auto_parallel/test_engine_api_dp.py
+2
-2
python/paddle/fluid/tests/unittests/auto_parallel/test_high_order_grad.py
...uid/tests/unittests/auto_parallel/test_high_order_grad.py
+5
-5
python/paddle/fluid/tests/unittests/auto_parallel/test_relaunch_with_gpt_planner.py
...unittests/auto_parallel/test_relaunch_with_gpt_planner.py
+1
-1
python/paddle/fluid/tests/unittests/auto_parallel/test_relaunch_with_planner.py
...sts/unittests/auto_parallel/test_relaunch_with_planner.py
+1
-1
未找到文件。
python/paddle/distributed/auto_parallel/process_group.py
浏览文件 @
438ca7f6
...
...
@@ -16,10 +16,12 @@ from collections import OrderedDict
import
paddle
import
paddle.fluid.core
as
core
from
..collective
import
_get_global_env
from
..collective
import
_new_ring_id
from
...fluid.framework
import
_non_static_mode
from
...fluid.layers.tensor
import
fill_constant
from
paddle.fluid.framework
import
_enable_legacy_dygraph
def
get_all_process_groups
():
...
...
@@ -134,7 +136,8 @@ class ProcessGroup:
# TODO(shenliang03): This is a temporary solution to solve the problem of
# hang caused by cross-creation of new_group
paddle
.
framework
.
_in_legacy_dygraph
()
paddle
.
disable_static
()
_enable_legacy_dygraph
()
paddle
.
set_device
(
'gpu:%d'
%
paddle
.
distributed
.
ParallelEnv
().
dev_id
)
tmp
=
paddle
.
to_tensor
(
...
...
python/paddle/fluid/tests/unittests/auto_parallel/test_auto_parallel_relaunch.py
浏览文件 @
438ca7f6
...
...
@@ -126,7 +126,7 @@ class TestAutoParallelReLaunch(unittest.TestCase):
coverage_args
=
[]
cmd
=
[
sys
.
executable
,
"-u"
]
+
coverage_args
+
[
"-m"
,
"launch"
,
"--log_dir"
,
self
.
temp_dir
.
name
,
"-m"
,
"
paddle.distributed.
launch"
,
"--log_dir"
,
self
.
temp_dir
.
name
,
"--cluster_topo_path"
,
cluster_json_path
,
"--rank_mapping_path"
,
mapping_json_path
,
"--enable_auto_mapping"
,
"True"
,
launch_model_path
...
...
python/paddle/fluid/tests/unittests/auto_parallel/test_converter.py
浏览文件 @
438ca7f6
...
...
@@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
tempfile
import
unittest
import
os
import
sys
...
...
@@ -32,18 +33,17 @@ class TestConverter(unittest.TestCase):
else
:
coverage_args
=
[]
tmp_dir
=
tempfile
.
TemporaryDirectory
()
cmd
=
[
sys
.
executable
,
"-u"
]
+
coverage_args
+
[
"-m"
,
"launch"
,
"--gpus"
,
"0,1"
,
launch_model_path
"-m"
,
"paddle.distributed.launch"
,
"--devices"
,
"0,1"
,
"--log_dir"
,
tmp_dir
.
name
,
launch_model_path
]
process
=
subprocess
.
Popen
(
cmd
)
process
.
wait
()
self
.
assertEqual
(
process
.
returncode
,
0
)
# Remove unnecessary files
log_path
=
os
.
path
.
join
(
file_dir
,
"log"
)
if
os
.
path
.
exists
(
log_path
):
shutil
.
rmtree
(
log_path
)
tmp_dir
.
cleanup
()
def
test_input_invalid
(
self
):
with
self
.
assertRaises
(
ValueError
):
...
...
python/paddle/fluid/tests/unittests/auto_parallel/test_engine_api.py
浏览文件 @
438ca7f6
...
...
@@ -34,8 +34,8 @@ class TestEngineAPI(unittest.TestCase):
tmp_dir
=
tempfile
.
TemporaryDirectory
()
cmd
=
[
sys
.
executable
,
"-u"
]
+
coverage_args
+
[
"-m"
,
"
launch"
,
"--gpus"
,
"0,1"
,
"--log_dir"
,
tmp_dir
.
name
,
launch_model_path
"-m"
,
"
paddle.distributed.launch"
,
"--devices"
,
"0,1"
,
"--log_dir"
,
tmp_dir
.
name
,
launch_model_path
]
process
=
subprocess
.
Popen
(
cmd
)
...
...
python/paddle/fluid/tests/unittests/auto_parallel/test_engine_api_dp.py
浏览文件 @
438ca7f6
...
...
@@ -34,8 +34,8 @@ class TestEngineAPI(unittest.TestCase):
tmp_dir
=
tempfile
.
TemporaryDirectory
()
cmd
=
[
sys
.
executable
,
"-u"
]
+
coverage_args
+
[
"-m"
,
"
launch"
,
"--gpus"
,
"0,1"
,
"--log_dir"
,
tmp_dir
.
name
,
launch_model_path
"-m"
,
"
paddle.distributed.launch"
,
"--devices"
,
"0,1"
,
"--log_dir"
,
tmp_dir
.
name
,
launch_model_path
]
process
=
subprocess
.
Popen
(
cmd
)
...
...
python/paddle/fluid/tests/unittests/auto_parallel/test_high_order_grad.py
浏览文件 @
438ca7f6
...
...
@@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
tempfile
import
unittest
import
os
import
sys
...
...
@@ -31,18 +32,17 @@ class TestHighOrderGrad(unittest.TestCase):
else
:
coverage_args
=
[]
tmp_dir
=
tempfile
.
TemporaryDirectory
()
cmd
=
[
sys
.
executable
,
"-u"
]
+
coverage_args
+
[
"-m"
,
"launch"
,
"--gpus"
,
"0,1"
,
launch_model_path
"-m"
,
"paddle.distributed.launch"
,
"--devices"
,
"0,1"
,
"--log_dir"
,
tmp_dir
.
name
,
launch_model_path
]
process
=
subprocess
.
Popen
(
cmd
)
process
.
wait
()
self
.
assertEqual
(
process
.
returncode
,
0
)
# Remove unnecessary files
log_path
=
os
.
path
.
join
(
file_dir
,
"log"
)
if
os
.
path
.
exists
(
log_path
):
shutil
.
rmtree
(
log_path
)
tmp_dir
.
cleanup
()
if
__name__
==
"__main__"
:
...
...
python/paddle/fluid/tests/unittests/auto_parallel/test_relaunch_with_gpt_planner.py
浏览文件 @
438ca7f6
...
...
@@ -56,7 +56,7 @@ class TestPlannerReLaunch(unittest.TestCase):
coverage_args
=
[]
cmd
=
[
sys
.
executable
,
"-u"
]
+
coverage_args
+
[
"-m"
,
"launch"
,
"--log_dir"
,
self
.
temp_dir
.
name
,
"-m"
,
"
paddle.distributed.
launch"
,
"--log_dir"
,
self
.
temp_dir
.
name
,
"--cluster_topo_path"
,
cluster_json_path
,
"--rank_mapping_path"
,
mapping_json_path
,
"--enable_auto_mapping"
,
"True"
,
launch_model_path
...
...
python/paddle/fluid/tests/unittests/auto_parallel/test_relaunch_with_planner.py
浏览文件 @
438ca7f6
...
...
@@ -56,7 +56,7 @@ class TestPlannerReLaunch(unittest.TestCase):
coverage_args
=
[]
cmd
=
[
sys
.
executable
,
"-u"
]
+
coverage_args
+
[
"-m"
,
"launch"
,
"--log_dir"
,
self
.
temp_dir
.
name
,
"-m"
,
"
paddle.distributed.
launch"
,
"--log_dir"
,
self
.
temp_dir
.
name
,
"--cluster_topo_path"
,
cluster_json_path
,
"--rank_mapping_path"
,
mapping_json_path
,
"--enable_auto_mapping"
,
"True"
,
launch_model_path
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录