Skip to content

Commit c0f2728

Browse files
authored
[Paddle-ASP]Make test_asp_sharding running on non-mac platform (#39034)
* [Paddle-ASP]Make test_asp_sharding running on non-mac platform * syntax check * syntax check
1 parent 8784ec6 commit c0f2728

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

python/paddle/fluid/tests/unittests/asp/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}")
33

44
list(REMOVE_ITEM TEST_OPS "test_fleet_with_asp")
55
list(REMOVE_ITEM TEST_OPS "test_fleet_with_asp_amp")
6+
list(REMOVE_ITEM TEST_OPS "test_fleet_with_asp_sharding")
67

78
foreach(TEST_OP ${TEST_OPS})
89
py_test_modules(${TEST_OP} MODULES ${TEST_OP})
@@ -12,3 +13,7 @@ if(WITH_DISTRIBUTE)
1213
py_test_modules(test_fleet_with_asp MODULES test_fleet_with_asp ENVS ${dist_ENVS})
1314
py_test_modules(test_fleet_with_asp_amp MODULES test_fleet_with_asp_amp ENVS ${dist_ENVS})
1415
endif()
16+
17+
if((WITH_DISTRIBUTE) AND (NOT WIN32) AND (NOT APPLE))
18+
py_test_modules(test_fleet_with_asp_sharding MODULES test_fleet_with_asp_sharding ENVS ${dist_ENVS})
19+
endif()

python/paddle/fluid/tests/unittests/asp/test_fleet_with_asp_sharding.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import paddle.fluid as fluid
2121
import paddle.fluid.core as core
2222
import os
23-
import sys
2423
from paddle.static import sparsity
2524
from paddle.fluid.contrib.sparsity.asp import ASPHelper
2625
import numpy as np
@@ -78,9 +77,6 @@ def net(self, main_prog, startup_prog):
7877
return avg_cost, dist_strategy, input_x, input_y
7978

8079
def test_with_asp_sharding(self):
81-
if sys.platform == 'win32':
82-
return
83-
print(sys.platform)
8480
fleet.init(is_collective=True)
8581
train_prog, startup_prog = fluid.Program(), fluid.Program()
8682
avg_cost, strategy, input_x, input_y = self.net(train_prog,

0 commit comments

Comments
 (0)