Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoParallel] Distributed Unit Test Handling - Part 3 #67872

Merged
merged 38 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c4a24d9
deprecated test_pass_1F1B
AndPuQing Aug 30, 2024
d9f0cd6
deprecated test_amp_o2_pass
AndPuQing Aug 30, 2024
54dc89c
deprecated test_pass_amp
AndPuQing Aug 30, 2024
f4ecfac
deprecated auto_parallel_relaunch_model
AndPuQing Aug 30, 2024
296e667
deprecated auto_parallel_relaunch_with_planner
AndPuQing Aug 30, 2024
bbb06ff
deprecated test_pass_grad_clip
AndPuQing Aug 30, 2024
fee44f2
deprecated engine_api_dp
AndPuQing Aug 30, 2024
0c8f034
deprecated engine_api
AndPuQing Aug 30, 2024
b505e08
deprecated generation_pipeline_pass_unittest
AndPuQing Aug 30, 2024
d135c5f
deprecated gpt_with_prim
AndPuQing Aug 30, 2024
bf8d659
deprecated gradient_merge_pass_unittest
AndPuQing Aug 30, 2024
fa850ee
deprecated mp_allreduce_matmul_grad_overlapping_unittest
AndPuQing Aug 30, 2024
63b5bb7
deprecated optimization_tuner_api
AndPuQing Aug 30, 2024
f123864
deprecated pipeline_scheduler_vpp_unittest
AndPuQing Aug 30, 2024
565e293
deprecated pipeline_scheduler_zb_unittest
AndPuQing Aug 30, 2024
01146c4
deprecated recompute_pass_unittest
AndPuQing Aug 30, 2024
a607ea4
Add sys.path.append("../../auto_parallel") to deprecated test files
AndPuQing Sep 2, 2024
8059c33
fix path
AndPuQing Sep 4, 2024
bb0f506
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
AndPuQing Sep 6, 2024
82a6f8a
fix
AndPuQing Sep 6, 2024
d1bb375
fix
AndPuQing Sep 6, 2024
92bdaf1
fix
AndPuQing Sep 6, 2024
fe77871
fix
AndPuQing Sep 6, 2024
57c4c00
fix
AndPuQing Sep 6, 2024
17560b8
Merge branch 'develop' of https://github.puqing.work/PaddlePaddle/Pad…
AndPuQing Sep 6, 2024
4f32b14
fix
AndPuQing Sep 6, 2024
7421850
fix launch module
AndPuQing Sep 9, 2024
d84d668
Merge branch 'develop' of https://github.puqing.work/PaddlePaddle/Pad…
AndPuQing Sep 14, 2024
e12e972
fix merge
AndPuQing Sep 14, 2024
20440b6
fix merge
AndPuQing Sep 14, 2024
5bc6e0d
fix merge
AndPuQing Sep 14, 2024
42efc94
fix merge
AndPuQing Sep 14, 2024
50e0139
fix merge
AndPuQing Sep 14, 2024
8ffcaf7
fix merge
AndPuQing Sep 14, 2024
8a6f610
fix merge
AndPuQing Sep 14, 2024
c553e2a
fix merge
AndPuQing Sep 14, 2024
16d7aef
fix merge
AndPuQing Sep 14, 2024
e9d7a09
fix merge
AndPuQing Sep 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions test/auto_parallel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,6 @@ add_subdirectory(pir)
if(WITH_DISTRIBUTE AND WITH_GPU)

# NOTE(zyl): unittests WITH multi cards and timeout
py_test_modules(test_auto_parallel_relaunch MODULES
test_auto_parallel_relaunch)
set_tests_properties(test_auto_parallel_relaunch
PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE" TIMEOUT 120)
py_test_modules(test_engine_api MODULES test_engine_api)
set_tests_properties(test_engine_api PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE"
TIMEOUT 80)
py_test_modules(test_engine_api_dp MODULES test_engine_api_dp)
set_tests_properties(test_engine_api_dp
PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE" TIMEOUT 80)
py_test_modules(test_optimization_tuner_api MODULES
test_optimization_tuner_api)
set_tests_properties(test_optimization_tuner_api
PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE" TIMEOUT 120)
py_test_modules(test_converter MODULES test_converter)
set_tests_properties(test_converter PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE"
TIMEOUT 50)
Expand All @@ -33,13 +19,6 @@ if(WITH_DISTRIBUTE AND WITH_GPU)
set_tests_properties(test_iterable_dataset
PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE" TIMEOUT 80)

py_test_modules(test_auto_tuner MODULES test_auto_tuner)
set_tests_properties(test_auto_tuner PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE"
TIMEOUT 100)
py_test_modules(test_auto_tuner_compare MODULES test_auto_tuner_compare)
set_tests_properties(test_auto_tuner_compare
PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE" TIMEOUT 100)

py_test_modules(test_reshard_api MODULES test_reshard_api)
set_tests_properties(test_reshard_api PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE"
TIMEOUT 150)
Expand Down
23 changes: 22 additions & 1 deletion test/deprecated/auto_parallel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,28 @@
# add_subdirectory(pir)

if(WITH_DISTRIBUTE AND WITH_GPU)

py_test_modules(test_auto_parallel_relaunch_deprecated MODULES
test_auto_parallel_relaunch_deprecated)
set_tests_properties(test_auto_parallel_relaunch_deprecated
PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE" TIMEOUT 120)
py_test_modules(test_engine_api_dp_deprecated MODULES
test_engine_api_dp_deprecated)
set_tests_properties(test_engine_api_dp_deprecated
PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE" TIMEOUT 80)
py_test_modules(test_engine_api_deprecated MODULES test_engine_api_deprecated)
set_tests_properties(test_engine_api_deprecated
PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE" TIMEOUT 80)
py_test_modules(test_auto_tuner_compare_deprecated MODULES
test_auto_tuner_compare_deprecated)
set_tests_properties(test_auto_tuner_compare_deprecated
PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE" TIMEOUT 100)
py_test_modules(test_auto_tuner_deprecated MODULES test_auto_tuner_deprecated)
set_tests_properties(test_auto_tuner_deprecated
PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE" TIMEOUT 100)
py_test_modules(test_optimization_tuner_api_deprecated MODULES
test_optimization_tuner_api_deprecated)
set_tests_properties(test_optimization_tuner_api_deprecated
PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE" TIMEOUT 120)
py_test_modules(test_relaunch_with_planner_deprecated MODULES
test_relaunch_with_planner_deprecated)
set_tests_properties(test_relaunch_with_planner_deprecated
Expand Down
23 changes: 23 additions & 0 deletions test/deprecated/auto_parallel/launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (c) 2021 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

from paddle.distributed.fleet import launch
from paddle.distributed.fleet.launch_utils import run_with_coverage

if __name__ == "__main__":
if os.environ.get("WITH_COVERAGE", "OFF") == "ON":
run_with_coverage(True)
launch.launch()
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from engine_api_dp import MyDataset
from engine_api_dp_deprecated import MyDataset

import paddle
import paddle.nn.functional as F
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import numpy as np

sys.path.append("../../auto_parallel")

from get_gpt_model import FakeDataset, generate_model

import paddle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import numpy as np

sys.path.append("../../auto_parallel")

from get_gpt_model import FakeDataset, generate_model

import paddle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
class TestEngineAPI(unittest.TestCase):
def test_auto_tuner_compare(self):
file_dir = os.path.dirname(os.path.abspath(__file__))
launch_model_path = os.path.join(file_dir, "engine_api_dp.py")
launch_model_path = os.path.join(
file_dir, "engine_api_dp_deprecated.py"
)

if os.environ.get("WITH_COVERAGE", "OFF") == "ON":
coverage_args = ["-m", "coverage", "run", "--branch", "-p"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
class TestEngineAPI(unittest.TestCase):
def test_auto_tuner(self):
file_dir = os.path.dirname(os.path.abspath(__file__))
launch_model_path = os.path.join(file_dir, "engine_api_dp.py")
launch_model_path = os.path.join(
file_dir, "engine_api_dp_deprecated.py"
)

if os.environ.get("WITH_COVERAGE", "OFF") == "ON":
coverage_args = ["-m", "coverage", "run", "--branch", "-p"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
class TestEngineAPI(unittest.TestCase):
def test_engine_api(self):
file_dir = os.path.dirname(os.path.abspath(__file__))
launch_model_path = os.path.join(file_dir, "engine_api_dp.py")
launch_model_path = os.path.join(file_dir, "engine_api_deprecated.py")

if os.environ.get("WITH_COVERAGE", "OFF") == "ON":
coverage_args = ["-m", "coverage", "run", "--branch", "-p"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
class TestEngineAPI(unittest.TestCase):
def test_engine_api(self):
file_dir = os.path.dirname(os.path.abspath(__file__))
launch_model_path = os.path.join(file_dir, "engine_api.py")
launch_model_path = os.path.join(
file_dir, "engine_api_dp_deprecated.py"
)

if os.environ.get("WITH_COVERAGE", "OFF") == "ON":
coverage_args = ["-m", "coverage", "run", "--branch", "-p"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ class TestMPAllreduceMatmulGradOverlapping(unittest.TestCase):
def test_mp_allreduce_matmul_grad_overlapping(self):
file_dir = os.path.dirname(os.path.abspath(__file__))
launch_model_path = os.path.join(
file_dir, "mp_allreduce_matmul_grad_overlapping_unittest.py"
file_dir,
"mp_allreduce_matmul_grad_overlapping_unittest.py",
)

if os.environ.get("WITH_COVERAGE", "OFF") == "ON":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
class TestOptimizationTunerAPI(unittest.TestCase):
def test_engine_api(self):
file_dir = os.path.dirname(os.path.abspath(__file__))
launch_model_path = os.path.join(file_dir, "optimization_tuner_api.py")
launch_model_path = os.path.join(
file_dir, "optimization_tuner_api_deprecated.py"
)

if os.environ.get("WITH_COVERAGE", "OFF") == "ON":
coverage_args = ["-m", "coverage", "run", "--branch", "-p"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ def tearDown(self):
self.temp_dir.cleanup()

def test_relaunch_with_planner(self):
from test_auto_parallel_relaunch import cluster_json, mapping_json
from test_auto_parallel_relaunch_deprecated import (
cluster_json,
mapping_json,
)

cluster_json_path = os.path.join(
self.temp_dir.name, "auto_parallel_cluster.json"
Expand Down