Thanks.
After adding synchronization, the partical code is as follows

std::chrono::steady_clock::time_point t1, t2;
std::chrono::duration time_used;
at::cuda::CUDAStream stream = at::cuda::getCurrentCUDAStream();
AT_CUDA_CHECK(cudaStreamSynchronize(stream));
t1 = std::chrono::steady_clock::now();
auto output = m_model->forward({ input }).toTuple();
AT_CUDA_CHECK(cudaStreamSynchronize(stream));
t2= std::chrono::steady_clock::now();
time_used = std::chrono::duration_cast<std::chrono::duration>(t2 - t1) * 1000;
printf(“forward cost time %f ms \n”, time_used);

The test results are as follows, and find that fp16 is even slightly slower than fp32
FP16

FP32