未验证 提交 ae6a8271 编写于 作者: R ronnywang 提交者: GitHub

[CustomDevice] unittests tracking the fixed version plugin (#45553)

* [CustomDevice] unittests tracking the fixed version plugin

* update
上级 1523ddc8
if(WITH_CUSTOM_DEVICE AND NOT WITH_GPU)
set(PLUGIN_URL https://github.com/PaddlePaddle/PaddleCustomDevice.git)
set(PLUGIN_TAG d5e5ac1d8e9f7588d4c2998bb3b5ffc66f65af2e)
file(
GLOB TEST_OPS
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
......@@ -7,13 +10,18 @@ if(WITH_CUSTOM_DEVICE AND NOT WITH_GPU)
list(REMOVE_ITEM TEST_OPS test_collective_process_group_xccl)
foreach(TEST_OP ${TEST_OPS})
py_test(${TEST_OP} SRCS ${TEST_OP}.py)
py_test(${TEST_OP} SRCS ${TEST_OP}.py ENVS PLUGIN_URL=${PLUGIN_URL}
PLUGIN_TAG=${PLUGIN_TAG})
endforeach()
bash_test_modules(
test_fleet_launch_custom_device START_BASH
test_fleet_launch_custom_device.sh ENVS
PADDLE_BINARY_DIR=${PADDLE_BINARY_DIR})
test_fleet_launch_custom_device
START_BASH
test_fleet_launch_custom_device.sh
ENVS
PADDLE_BINARY_DIR=${PADDLE_BINARY_DIR}
PLUGIN_URL=${PLUGIN_URL}
PLUGIN_TAG=${PLUGIN_TAG})
set_tests_properties(test_custom_cpu_plugin PROPERTIES TIMEOUT 120)
set_tests_properties(test_custom_cpu_profiler_plugin PROPERTIES TIMEOUT 120)
......
......@@ -136,7 +136,12 @@ class TestProcessGroup(TestMultipleCustomCPU):
def setUp(self):
# compile so and set to current path
cur_dir = os.path.dirname(os.path.abspath(__file__))
cmd = 'rm -rf PaddleCustomDevice && git clone https://github.com/PaddlePaddle/PaddleCustomDevice.git && cd PaddleCustomDevice/backends/custom_cpu && mkdir build && cd build && cmake .. && make -j8'
cmd = 'rm -rf PaddleCustomDevice \
&& git clone {} \
&& cd PaddleCustomDevice/backends/custom_cpu \
&& git checkout {} -b dev \
&& mkdir build && cd build && cmake .. && make -j8'.format(
os.getenv('PLUGIN_URL'), os.getenv('PLUGIN_TAG'))
os.system(cmd)
# set environment for loading and registering compiled custom kernels
......
......@@ -24,7 +24,12 @@ class TestCustomCPUPlugin(unittest.TestCase):
def setUp(self):
# compile so and set to current path
cur_dir = os.path.dirname(os.path.abspath(__file__))
cmd = 'rm -rf PaddleCustomDevice && git clone https://github.com/PaddlePaddle/PaddleCustomDevice.git && cd PaddleCustomDevice/backends/custom_cpu && mkdir build && cd build && cmake .. && make -j8'
cmd = 'rm -rf PaddleCustomDevice \
&& git clone {} \
&& cd PaddleCustomDevice/backends/custom_cpu \
&& git checkout {} -b dev \
&& mkdir build && cd build && cmake .. && make -j8'.format(
os.getenv('PLUGIN_URL'), os.getenv('PLUGIN_TAG'))
os.system(cmd)
# set environment for loading and registering compiled custom kernels
......
......@@ -24,7 +24,12 @@ class TestCustomCPUProfilerPlugin(unittest.TestCase):
def setUp(self):
# compile so and set to current path
cur_dir = os.path.dirname(os.path.abspath(__file__))
cmd = 'rm -rf PaddleCustomDevice && git clone https://github.com/PaddlePaddle/PaddleCustomDevice.git && cd PaddleCustomDevice/backends/custom_cpu && mkdir build && cd build && cmake .. && make -j8'
cmd = 'rm -rf PaddleCustomDevice \
&& git clone {} \
&& cd PaddleCustomDevice/backends/custom_cpu \
&& git checkout {} -b dev \
&& mkdir build && cd build && cmake .. && make -j8'.format(
os.getenv('PLUGIN_URL'), os.getenv('PLUGIN_TAG'))
os.system(cmd)
# set environment for loading and registering compiled custom kernels
......
......@@ -16,7 +16,11 @@
set -e
rm -rf PaddleCustomDevice && git clone https://github.com/PaddlePaddle/PaddleCustomDevice.git && pushd PaddleCustomDevice/backends/custom_cpu && mkdir build && pushd build && cmake .. && make -j8 && popd && popd
rm -rf PaddleCustomDevice && \
git clone ${PLUGIN_URL} \
&& pushd PaddleCustomDevice/backends/custom_cpu \
&& git checkout ${PLUGIN_TAG} -b dev \
&& mkdir build && pushd build && cmake .. && make -j8 && popd && popd
echo "begin test use custom_cpu"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册