Browse Source

为 paddle 分布式的测试例添加paddledist标签

tags/v1.0.0alpha
x54-729 3 years ago
parent
commit
80ef85cf7c
4 changed files with 8 additions and 8 deletions
  1. +1
    -1
      tests/core/controllers/test_trainer_paddle.py
  2. +3
    -4
      tests/core/drivers/paddle_driver/test_dist_utils.py
  3. +3
    -3
      tests/core/drivers/paddle_driver/test_fleet.py
  4. +1
    -0
      tests/pytest.ini

+ 1
- 1
tests/core/controllers/test_trainer_paddle.py View File

@@ -27,7 +27,7 @@ class TrainPaddleConfig:
@pytest.mark.parametrize("driver,device", [("paddle", "cpu"), ("paddle", 1), ("fleet", [0, 1])]) @pytest.mark.parametrize("driver,device", [("paddle", "cpu"), ("paddle", 1), ("fleet", [0, 1])])
# @pytest.mark.parametrize("driver,device", [("fleet", [0, 1])]) # @pytest.mark.parametrize("driver,device", [("fleet", [0, 1])])
@pytest.mark.parametrize("callbacks", [[RichCallback(5)]]) @pytest.mark.parametrize("callbacks", [[RichCallback(5)]])
@pytest.mark.paddle
@pytest.mark.paddledist
@magic_argv_env_context @magic_argv_env_context
def test_trainer_paddle( def test_trainer_paddle(
driver, driver,


+ 3
- 4
tests/core/drivers/paddle_driver/test_dist_utils.py View File

@@ -19,7 +19,7 @@ if _NEED_IMPORT_PADDLE:
import paddle import paddle
import paddle.distributed as dist import paddle.distributed as dist


@pytest.mark.paddle
@pytest.mark.paddledist
class TestDistUtilsTools: class TestDistUtilsTools:
""" """
测试一些工具函数 测试一些工具函数
@@ -79,14 +79,13 @@ class TestDistUtilsTools:
assert res["int"] == paddle_dict["int"] assert res["int"] == paddle_dict["int"]
assert res["string"] == paddle_dict["string"] assert res["string"] == paddle_dict["string"]



@pytest.mark.paddle
@pytest.mark.paddledist
class TestAllGatherAndBroadCast: class TestAllGatherAndBroadCast:


@classmethod @classmethod
def setup_class(cls): def setup_class(cls):
devices = [0,1,2] devices = [0,1,2]
output_from_new_proc = "only_error"
output_from_new_proc = "all"


launcher = FleetLauncher(devices=devices, output_from_new_proc=output_from_new_proc) launcher = FleetLauncher(devices=devices, output_from_new_proc=output_from_new_proc)
cls.local_rank = int(os.getenv("PADDLE_RANK_IN_NODE", "0")) cls.local_rank = int(os.getenv("PADDLE_RANK_IN_NODE", "0"))


+ 3
- 3
tests/core/drivers/paddle_driver/test_fleet.py View File

@@ -39,7 +39,7 @@ def generate_driver(num_labels, feature_dimension, device=[0,1], fp16=False, out
# #
############################################################################ ############################################################################


@pytest.mark.paddle
@pytest.mark.paddledist
class TestFleetDriverFunction: class TestFleetDriverFunction:
""" """
测试 PaddleFleetDriver 一些简单函数的测试类,基本都是测试能否运行、是否存在 import 错误等问题 测试 PaddleFleetDriver 一些简单函数的测试类,基本都是测试能否运行、是否存在 import 错误等问题
@@ -147,7 +147,7 @@ class TestFleetDriverFunction:
# #
############################################################################ ############################################################################


@pytest.mark.paddle
@pytest.mark.paddledist
class TestSetDistReproDataloader: class TestSetDistReproDataloader:


@classmethod @classmethod
@@ -521,7 +521,7 @@ class TestSetDistReproDataloader:
# #
############################################################################ ############################################################################


@pytest.mark.paddle
@pytest.mark.paddledist
class TestSaveLoad: class TestSaveLoad:
""" """
测试多卡情况下 save 和 load 相关函数的表现 测试多卡情况下 save 和 load 相关函数的表现


+ 1
- 0
tests/pytest.ini View File

@@ -2,5 +2,6 @@
markers = markers =
torch torch
paddle paddle
paddledist
jittor jittor
torchpaddle torchpaddle

Loading…
Cancel
Save