未验证 提交 36980306 编写于 作者: Z zhupengyang 提交者: GitHub

disable lite gpu (#43178)

上级 e161979e
...@@ -106,7 +106,7 @@ if (NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR) ...@@ -106,7 +106,7 @@ if (NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR)
else() else()
set(LITE_BUILD_COMMAND $(MAKE) publish_inference -j) set(LITE_BUILD_COMMAND $(MAKE) publish_inference -j)
set(LITE_OPTIONAL_ARGS -DWITH_MKL=ON set(LITE_OPTIONAL_ARGS -DWITH_MKL=ON
-DLITE_WITH_CUDA=${WITH_GPU} -DLITE_WITH_CUDA=OFF
-DWITH_MKLDNN=OFF -DWITH_MKLDNN=OFF
-DLITE_WITH_X86=ON -DLITE_WITH_X86=ON
-DLITE_WITH_PROFILE=OFF -DLITE_WITH_PROFILE=OFF
...@@ -115,9 +115,6 @@ if (NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR) ...@@ -115,9 +115,6 @@ if (NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR)
-DWITH_PYTHON=OFF -DWITH_PYTHON=OFF
-DWITH_TESTING=OFF -DWITH_TESTING=OFF
-DLITE_BUILD_EXTRA=ON -DLITE_BUILD_EXTRA=ON
-DCUDNN_ROOT=${CUDNN_ROOT}
-DLITE_WITH_STATIC_CUDA=OFF
-DCUDA_ARCH_NAME=${CUDA_ARCH_NAME}
-DLITE_WITH_XPU=${LITE_WITH_XPU} -DLITE_WITH_XPU=${LITE_WITH_XPU}
-DXPU_SDK_URL=${XPU_BASE_URL} -DXPU_SDK_URL=${XPU_BASE_URL}
-DXPU_SDK_ENV=${XPU_SDK_ENV} -DXPU_SDK_ENV=${XPU_SDK_ENV}
......
...@@ -12,10 +12,6 @@ ...@@ -12,10 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
#define LITE_WITH_CUDA 1
#endif
#ifdef LITE_SUBGRAPH_WITH_XPU #ifdef LITE_SUBGRAPH_WITH_XPU
#define LITE_WITH_XPU 1 #define LITE_WITH_XPU 1
#endif #endif
......
...@@ -151,22 +151,12 @@ TEST(LiteEngineOp, TensorCopyAsync) { ...@@ -151,22 +151,12 @@ TEST(LiteEngineOp, TensorCopyAsync) {
auto* ctx_cpu = auto* ctx_cpu =
platform::DeviceContextPool::Instance().Get(platform::CPUPlace()); platform::DeviceContextPool::Instance().Get(platform::CPUPlace());
test_tensor_copy(*ctx_cpu); test_tensor_copy(*ctx_cpu);
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
auto* ctx_gpu =
platform::DeviceContextPool::Instance().Get(platform::CUDAPlace(0));
test_tensor_copy(*ctx_gpu);
#endif
} }
TEST(LiteEngineOp, TensorShare) { TEST(LiteEngineOp, TensorShare) {
auto* ctx_cpu = auto* ctx_cpu =
platform::DeviceContextPool::Instance().Get(platform::CPUPlace()); platform::DeviceContextPool::Instance().Get(platform::CPUPlace());
test_tensor_share(*ctx_cpu); test_tensor_share(*ctx_cpu);
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
auto* ctx_gpu =
platform::DeviceContextPool::Instance().Get(platform::CUDAPlace(0));
test_tensor_share(*ctx_gpu);
#endif
} }
} // namespace utils } // namespace utils
......
...@@ -119,35 +119,13 @@ TEST(AnalysisPredictor, lite_xpu) { ...@@ -119,35 +119,13 @@ TEST(AnalysisPredictor, lite_xpu) {
} }
#endif #endif
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
TEST(AnalysisPredictor, thread_local_stream) {
const size_t thread_num = 5;
std::vector<std::thread> threads(thread_num);
Barrier barrier(thread_num);
for (size_t i = 0; i < threads.size(); ++i) {
threads[i] = std::thread([&barrier, i]() {
AnalysisConfig config;
config.EnableUseGpu(100, 0);
config.SetModel(FLAGS_infer_model + "/" + "mul_model");
config.EnableGpuMultiStream();
test_predictor(config, &barrier);
test_predictor_zero_copy(config);
});
}
for (auto& th : threads) {
th.join();
}
}
TEST(AnalysisPredictor, lite_engine) { TEST(AnalysisPredictor, lite_engine) {
AnalysisConfig config; AnalysisConfig config;
config.EnableUseGpu(100, 0);
config.SetModel(FLAGS_infer_model + "/" + "mul_model"); config.SetModel(FLAGS_infer_model + "/" + "mul_model");
config.EnableLiteEngine(paddle::AnalysisConfig::Precision::kFloat32); config.EnableLiteEngine(paddle::AnalysisConfig::Precision::kFloat32);
test_predictor(config); test_predictor(config);
test_predictor_zero_copy(config); test_predictor_zero_copy(config);
} }
#endif
} // namespace inference } // namespace inference
} // namespace paddle } // namespace paddle
...@@ -22,10 +22,9 @@ limitations under the License. */ ...@@ -22,10 +22,9 @@ limitations under the License. */
namespace paddle { namespace paddle {
namespace inference { namespace inference {
TEST(AnalysisPredictor, use_gpu) { TEST(AnalysisPredictor, use_cpu) {
std::string model_dir = FLAGS_infer_model + "/" + "model"; std::string model_dir = FLAGS_infer_model + "/" + "model";
AnalysisConfig config; AnalysisConfig config;
config.EnableUseGpu(100, 0);
config.SetModel(model_dir + "/model", model_dir + "/params"); config.SetModel(model_dir + "/model", model_dir + "/params");
config.EnableLiteEngine(paddle::AnalysisConfig::Precision::kFloat32, true); config.EnableLiteEngine(paddle::AnalysisConfig::Precision::kFloat32, true);
...@@ -73,10 +72,9 @@ TEST(AnalysisPredictor, use_gpu) { ...@@ -73,10 +72,9 @@ TEST(AnalysisPredictor, use_gpu) {
namespace paddle_infer { namespace paddle_infer {
TEST(Predictor, use_gpu) { TEST(Predictor, use_cpu) {
std::string model_dir = FLAGS_infer_model + "/" + "model"; std::string model_dir = FLAGS_infer_model + "/" + "model";
Config config; Config config;
config.EnableUseGpu(100, 0);
config.SetModel(model_dir + "/model", model_dir + "/params"); config.SetModel(model_dir + "/model", model_dir + "/params");
config.EnableLiteEngine(PrecisionType::kFloat32); config.EnableLiteEngine(PrecisionType::kFloat32);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册