未验证 提交 cff7d642 编写于 作者: 6 6clc 提交者: GitHub

[CINN] fix run cinn-ut in paddle with cinn (#55530)

修复Paddle With CINN 执行 python单测下op_mapper 时报gflags符号undefined问题。
上级 9084a034
...@@ -582,6 +582,13 @@ include(flags) # set paddle compile flags ...@@ -582,6 +582,13 @@ include(flags) # set paddle compile flags
if(WITH_CINN) if(WITH_CINN)
message(STATUS "Compile Paddle with CINN.") message(STATUS "Compile Paddle with CINN.")
message(
WARNING
"Enable WITH_SHARED_PHI when compiling with CINN. Force WITH_SHARED_PHI=ON."
)
set(WITH_SHARED_PHI
ON
CACHE BOOL "Enable WITH_SHARED_PHI when compiling with CINN" FORCE)
# TODO(6clc): Use CINN_WITH_CUDNN to completely replace WITH_CUDNN in CINN. # TODO(6clc): Use CINN_WITH_CUDNN to completely replace WITH_CUDNN in CINN.
# Use WITH_GPU to completely replace WITH_CUDA in CINN. # Use WITH_GPU to completely replace WITH_CUDA in CINN.
set(WITH_MKL_CBLAS ${WITH_MKL}) set(WITH_MKL_CBLAS ${WITH_MKL})
......
...@@ -167,6 +167,10 @@ cinn_cc_library( ...@@ -167,6 +167,10 @@ cinn_cc_library(
${jitify_deps}) ${jitify_deps})
add_dependencies(cinnapi GEN_LLVM_RUNTIME_IR_HEADER ZLIB::ZLIB) add_dependencies(cinnapi GEN_LLVM_RUNTIME_IR_HEADER ZLIB::ZLIB)
add_dependencies(cinnapi GEN_LLVM_RUNTIME_IR_HEADER ${core_deps}) add_dependencies(cinnapi GEN_LLVM_RUNTIME_IR_HEADER ${core_deps})
if(NOT CINN_ONLY)
target_link_libraries(cinnapi phi)
add_dependencies(cinnapi phi)
endif()
target_link_libraries(cinnapi ${PYTHON_LIBRARIES}) target_link_libraries(cinnapi ${PYTHON_LIBRARIES})
...@@ -216,6 +220,10 @@ function(gen_cinncore LINKTYPE) ...@@ -216,6 +220,10 @@ function(gen_cinncore LINKTYPE)
ginac) ginac)
add_dependencies(${CINNCORE_TARGET} GEN_LLVM_RUNTIME_IR_HEADER ZLIB::ZLIB) add_dependencies(${CINNCORE_TARGET} GEN_LLVM_RUNTIME_IR_HEADER ZLIB::ZLIB)
add_dependencies(${CINNCORE_TARGET} GEN_LLVM_RUNTIME_IR_HEADER ${core_deps}) add_dependencies(${CINNCORE_TARGET} GEN_LLVM_RUNTIME_IR_HEADER ${core_deps})
if(NOT CINN_ONLY)
target_link_libraries(${CINNCORE_TARGET} phi)
add_dependencies(${CINNCORE_TARGET} phi)
endif()
add_dependencies(${CINNCORE_TARGET} pybind) add_dependencies(${CINNCORE_TARGET} pybind)
target_link_libraries(${CINNCORE_TARGET} ${PYTHON_LIBRARIES}) target_link_libraries(${CINNCORE_TARGET} ${PYTHON_LIBRARIES})
......
...@@ -139,6 +139,9 @@ if '${WITH_MKL}' == 'ON': ...@@ -139,6 +139,9 @@ if '${WITH_MKL}' == 'ON':
if '${WITH_MKLDNN}' == 'ON': if '${WITH_MKLDNN}' == 'ON':
cinnlibs.append('${MKLDNN_SHARED_LIB}') cinnlibs.append('${MKLDNN_SHARED_LIB}')
if '${CINN_ONLY}' == 'OFF':
cinnlibs.append('${PHI_LIB}')
if '${WITH_GPU}' == 'ON': if '${WITH_GPU}' == 'ON':
cinnlibs.append('${CMAKE_BINARY_DIR}/dist/cinn/include/paddle/cinn/runtime/cuda/cinn_cuda_runtime_source.cuh') cinnlibs.append('${CMAKE_BINARY_DIR}/dist/cinn/include/paddle/cinn/runtime/cuda/cinn_cuda_runtime_source.cuh')
cinnlibs.append('${CMAKE_BINARY_DIR}/dist/cinn/include/paddle/cinn/runtime/cuda/float16.h') cinnlibs.append('${CMAKE_BINARY_DIR}/dist/cinn/include/paddle/cinn/runtime/cuda/float16.h')
......
...@@ -25,14 +25,14 @@ foreach(basic_test_name ${BASIC_TEST_NAMES}) ...@@ -25,14 +25,14 @@ foreach(basic_test_name ${BASIC_TEST_NAMES})
NAME ${basic_test_name} NAME ${basic_test_name}
COMMAND COMMAND
${CMAKE_COMMAND} -E env ${CMAKE_COMMAND} -E env
PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/:$ENV{PYTHONPATH} PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/cinn:$ENV{PYTHONPATH}
python3 ${CMAKE_CURRENT_SOURCE_DIR}/${basic_test_name}.py python3 ${CMAKE_CURRENT_SOURCE_DIR}/${basic_test_name}.py
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
endforeach() endforeach()
if(NOT ${WITH_GPU}) if(NOT ${WITH_GPU})
# ADD_TEST(NAME test_op_nn # ADD_TEST(NAME test_op_nn
# COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/:$ENV{PYTHONPATH} # COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/cinn:$ENV{PYTHONPATH}
# python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_op_nn.py WORKING_DIRECTORY ${CMAKE_BINARY_DIR} # python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_op_nn.py WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
# ) # )
endif() endif()
...@@ -40,7 +40,7 @@ endif() ...@@ -40,7 +40,7 @@ endif()
if(WITH_CUDNN) if(WITH_CUDNN)
# TODO(thisjiang): revert test_cinn_frontend after fix inference mul problem # TODO(thisjiang): revert test_cinn_frontend after fix inference mul problem
# ADD_TEST(NAME test_cinn_frontend # ADD_TEST(NAME test_cinn_frontend
# COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/:$ENV{PYTHONPATH} # COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/cinn:$ENV{PYTHONPATH}
# python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_frontend.py # python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_frontend.py
# ${CMAKE_BINARY_DIR}/third_party/naive_mul_model # ${CMAKE_BINARY_DIR}/third_party/naive_mul_model
# ${CMAKE_BINARY_DIR}/third_party/multi_fc_model # ${CMAKE_BINARY_DIR}/third_party/multi_fc_model
...@@ -50,20 +50,20 @@ if(WITH_CUDNN) ...@@ -50,20 +50,20 @@ if(WITH_CUDNN)
NAME test_netbuilder NAME test_netbuilder
COMMAND COMMAND
${CMAKE_COMMAND} -E env ${CMAKE_COMMAND} -E env
PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/:$ENV{PYTHONPATH} PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/cinn:$ENV{PYTHONPATH}
python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_netbuilder.py "${WITH_GPU}" python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_netbuilder.py "${WITH_GPU}"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
endif() endif()
#ADD_TEST(NAME test_computation_python #ADD_TEST(NAME test_computation_python
# COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/:$ENV{PYTHONPATH} # COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/cinn:$ENV{PYTHONPATH}
# python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_computation.py # python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_computation.py
# ${CMAKE_BINARY_DIR}/third_party/naive_mul_model # ${CMAKE_BINARY_DIR}/third_party/naive_mul_model
# "${WITH_GPU}" WORKING_DIRECTORY ${CMAKE_BINARY_DIR} # "${WITH_GPU}" WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
#) #)
#ADD_TEST(NAME test_cinn_ops_check #ADD_TEST(NAME test_cinn_ops_check
# COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/:$ENV{PYTHONPATH} # COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/cinn:$ENV{PYTHONPATH}
# python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_ops.py "${WITH_GPU}" # python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_ops.py "${WITH_GPU}"
# WORKING_DIRECTORY ${CMAKE_BINARY_DIR} # WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
#) #)
...@@ -72,7 +72,7 @@ add_test( ...@@ -72,7 +72,7 @@ add_test(
NAME test_cinn_op_benchmark NAME test_cinn_op_benchmark
COMMAND COMMAND
${CMAKE_COMMAND} -E env ${CMAKE_COMMAND} -E env
PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/:$ENV{PYTHONPATH} PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/cinn:$ENV{PYTHONPATH}
python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_op_benchmark.py "${WITH_GPU}" python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_op_benchmark.py "${WITH_GPU}"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
...@@ -81,7 +81,7 @@ if(WITH_CUDNN) ...@@ -81,7 +81,7 @@ if(WITH_CUDNN)
NAME test_cinn_fake_resnet NAME test_cinn_fake_resnet
COMMAND COMMAND
${CMAKE_COMMAND} -E env ${CMAKE_COMMAND} -E env
PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/:$ENV{PYTHONPATH} PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/cinn:$ENV{PYTHONPATH}
python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_resnet.py python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_resnet.py
"${CMAKE_BINARY_DIR}/third_party/resnet_model" "${WITH_GPU}" "${CMAKE_BINARY_DIR}/third_party/resnet_model" "${WITH_GPU}"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
...@@ -90,7 +90,7 @@ if(WITH_CUDNN) ...@@ -90,7 +90,7 @@ if(WITH_CUDNN)
NAME test_cinn_real_resnet18 NAME test_cinn_real_resnet18
COMMAND COMMAND
${CMAKE_COMMAND} -E env ${CMAKE_COMMAND} -E env
PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/:$ENV{PYTHONPATH} PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/cinn:$ENV{PYTHONPATH}
python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_resnet18.py python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_resnet18.py
"${CMAKE_BINARY_DIR}/third_party/ResNet18" "${WITH_GPU}" "${CMAKE_BINARY_DIR}/third_party/ResNet18" "${WITH_GPU}"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
...@@ -99,7 +99,7 @@ if(WITH_CUDNN) ...@@ -99,7 +99,7 @@ if(WITH_CUDNN)
NAME test_cinn_real_mobilenetV2 NAME test_cinn_real_mobilenetV2
COMMAND COMMAND
${CMAKE_COMMAND} -E env ${CMAKE_COMMAND} -E env
PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/:$ENV{PYTHONPATH} PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/cinn:$ENV{PYTHONPATH}
python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_mobilenetv2.py python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_mobilenetv2.py
"${CMAKE_BINARY_DIR}/third_party/MobileNetV2" "${WITH_GPU}" "${CMAKE_BINARY_DIR}/third_party/MobileNetV2" "${WITH_GPU}"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
...@@ -108,7 +108,7 @@ if(WITH_CUDNN) ...@@ -108,7 +108,7 @@ if(WITH_CUDNN)
NAME test_cinn_real_efficientnet NAME test_cinn_real_efficientnet
COMMAND COMMAND
${CMAKE_COMMAND} -E env ${CMAKE_COMMAND} -E env
PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/:$ENV{PYTHONPATH} PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/cinn:$ENV{PYTHONPATH}
python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_efficientnet.py python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_efficientnet.py
"${CMAKE_BINARY_DIR}/third_party/EfficientNet" "${WITH_GPU}" "${CMAKE_BINARY_DIR}/third_party/EfficientNet" "${WITH_GPU}"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
...@@ -117,7 +117,7 @@ if(WITH_CUDNN) ...@@ -117,7 +117,7 @@ if(WITH_CUDNN)
NAME test_cinn_real_mobilenetV1 NAME test_cinn_real_mobilenetV1
COMMAND COMMAND
${CMAKE_COMMAND} -E env ${CMAKE_COMMAND} -E env
PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/:$ENV{PYTHONPATH} PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/cinn:$ENV{PYTHONPATH}
python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_mobilenetv1.py python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_mobilenetv1.py
"${CMAKE_BINARY_DIR}/third_party/MobilenetV1" "${WITH_GPU}" "${CMAKE_BINARY_DIR}/third_party/MobilenetV1" "${WITH_GPU}"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
...@@ -126,7 +126,7 @@ if(WITH_CUDNN) ...@@ -126,7 +126,7 @@ if(WITH_CUDNN)
NAME test_cinn_real_resnet50 NAME test_cinn_real_resnet50
COMMAND COMMAND
${CMAKE_COMMAND} -E env ${CMAKE_COMMAND} -E env
PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/:$ENV{PYTHONPATH} PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/cinn:$ENV{PYTHONPATH}
python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_resnet50.py python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_resnet50.py
"${CMAKE_BINARY_DIR}/third_party/ResNet50" "${WITH_GPU}" "${CMAKE_BINARY_DIR}/third_party/ResNet50" "${WITH_GPU}"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
...@@ -135,7 +135,7 @@ if(WITH_CUDNN) ...@@ -135,7 +135,7 @@ if(WITH_CUDNN)
NAME test_cinn_real_squeezenet NAME test_cinn_real_squeezenet
COMMAND COMMAND
${CMAKE_COMMAND} -E env ${CMAKE_COMMAND} -E env
PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/:$ENV{PYTHONPATH} PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/cinn:$ENV{PYTHONPATH}
python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_squeezenet.py python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_squeezenet.py
"${CMAKE_BINARY_DIR}/third_party/SqueezeNet" "${WITH_GPU}" "${CMAKE_BINARY_DIR}/third_party/SqueezeNet" "${WITH_GPU}"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
...@@ -144,14 +144,14 @@ if(WITH_CUDNN) ...@@ -144,14 +144,14 @@ if(WITH_CUDNN)
NAME test_paddle_model_convertor NAME test_paddle_model_convertor
COMMAND COMMAND
${CMAKE_COMMAND} -E env ${CMAKE_COMMAND} -E env
PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/:$ENV{PYTHONPATH} PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/cinn:$ENV{PYTHONPATH}
python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_paddle_model_convertor.py --path python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_paddle_model_convertor.py --path
"${CMAKE_BINARY_DIR}/third_party/resnet_model" "${CMAKE_BINARY_DIR}/third_party/resnet_model"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
endif() endif()
#ADD_TEST(NAME test_cinn_real_facedet #ADD_TEST(NAME test_cinn_real_facedet
# COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/:$ENV{PYTHONPATH} # COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/cinn:$ENV{PYTHONPATH}
# python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_facedet.py "${CMAKE_BINARY_DIR}/third_party/FaceDet" "${WITH_GPU}" # python3 ${CMAKE_CURRENT_SOURCE_DIR}/test_facedet.py "${CMAKE_BINARY_DIR}/third_party/FaceDet" "${WITH_GPU}"
# WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) # WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
if(WITH_GPU) if(WITH_GPU)
...@@ -166,7 +166,7 @@ if(WITH_GPU) ...@@ -166,7 +166,7 @@ if(WITH_GPU)
NAME test_conv2d_op NAME test_conv2d_op
COMMAND COMMAND
${CMAKE_COMMAND} -E env ${CMAKE_COMMAND} -E env
PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/:$ENV{PYTHONPATH} PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/cinn:$ENV{PYTHONPATH}
python3 ${CMAKE_CURRENT_SOURCE_DIR}/ops/test_conv2d_op.py python3 ${CMAKE_CURRENT_SOURCE_DIR}/ops/test_conv2d_op.py
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
endif() endif()
...@@ -181,7 +181,7 @@ if(WITH_GPU) ...@@ -181,7 +181,7 @@ if(WITH_GPU)
NAME ${op_test_name} NAME ${op_test_name}
COMMAND COMMAND
${CMAKE_COMMAND} -E env ${CMAKE_COMMAND} -E env
PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/:$ENV{PYTHONPATH} PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/cinn:$ENV{PYTHONPATH}
python3 ${CMAKE_CURRENT_SOURCE_DIR}/${op_test_name}.py python3 ${CMAKE_CURRENT_SOURCE_DIR}/${op_test_name}.py
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
endforeach() endforeach()
...@@ -198,7 +198,7 @@ if(WITH_GPU) ...@@ -198,7 +198,7 @@ if(WITH_GPU)
NAME test_mul_op_mapper NAME test_mul_op_mapper
COMMAND COMMAND
${CMAKE_COMMAND} -E env ${CMAKE_COMMAND} -E env
PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/:$ENV{PYTHONPATH} PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/cinn:$ENV{PYTHONPATH}
python3 ${CMAKE_CURRENT_SOURCE_DIR}/op_mappers/test_mul_op.py python3 ${CMAKE_CURRENT_SOURCE_DIR}/op_mappers/test_mul_op.py
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
...@@ -206,7 +206,7 @@ if(WITH_GPU) ...@@ -206,7 +206,7 @@ if(WITH_GPU)
NAME test_conv2d_op_mapper NAME test_conv2d_op_mapper
COMMAND COMMAND
${CMAKE_COMMAND} -E env ${CMAKE_COMMAND} -E env
PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/:$ENV{PYTHONPATH} PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/cinn:$ENV{PYTHONPATH}
python3 ${CMAKE_CURRENT_SOURCE_DIR}/op_mappers/test_conv2d_op.py python3 ${CMAKE_CURRENT_SOURCE_DIR}/op_mappers/test_conv2d_op.py
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
endif() endif()
...@@ -221,7 +221,7 @@ if(WITH_GPU) ...@@ -221,7 +221,7 @@ if(WITH_GPU)
NAME "${op_mapper_test_name}_mapper" NAME "${op_mapper_test_name}_mapper"
COMMAND COMMAND
${CMAKE_COMMAND} -E env ${CMAKE_COMMAND} -E env
PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/:$ENV{PYTHONPATH} PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/cinn:$ENV{PYTHONPATH}
python3 ${CMAKE_CURRENT_SOURCE_DIR}/${op_mapper_test_name}.py python3 ${CMAKE_CURRENT_SOURCE_DIR}/${op_mapper_test_name}.py
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
endforeach() endforeach()
...@@ -242,7 +242,7 @@ if(WITH_GPU) ...@@ -242,7 +242,7 @@ if(WITH_GPU)
NAME ${pass_test_name} NAME ${pass_test_name}
COMMAND COMMAND
${CMAKE_COMMAND} -E env ${CMAKE_COMMAND} -E env
PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/:$ENV{PYTHONPATH} PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/cinn:$ENV{PYTHONPATH}
python3 ${CMAKE_CURRENT_SOURCE_DIR}/${pass_test_name}.py python3 ${CMAKE_CURRENT_SOURCE_DIR}/${pass_test_name}.py
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
endforeach() endforeach()
...@@ -262,7 +262,7 @@ if(WITH_GPU) ...@@ -262,7 +262,7 @@ if(WITH_GPU)
NAME ${fusion_test_name} NAME ${fusion_test_name}
COMMAND COMMAND
${CMAKE_COMMAND} -E env ${CMAKE_COMMAND} -E env
PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/:$ENV{PYTHONPATH} PYTHONPATH=${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/python/cinn:$ENV{PYTHONPATH}
python3 ${CMAKE_CURRENT_SOURCE_DIR}/${fusion_test_name}.py python3 ${CMAKE_CURRENT_SOURCE_DIR}/${fusion_test_name}.py
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
endforeach() endforeach()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册