how to speed up the prediction?
The fine-tuned Chinese model is good in my task, but I found it takes around 1s to process a batch of five records (each record is 128 characters long) using CPU. Is there any suggestion to speed up the prediction? Thanks.
do you install tensorflow using bazel? it can accelerate the CPU calaulation about 3x, or maybe you can try GPU.
for faster prediction, please kindly check my bert-as-service, which implements highly-scalable non-blocking prediction for BERT.
@xwzhong No. I just use the docker image of tensorflow.
If you use tpu, TPU prediction only works on a single host (one TPU worker). Gpu is much faster than cpu.. Maybe you can think about buy a graphic card...
BERT will always be slow on the CPU, there is not an easy way to speed it up other than to switch to GPU or TPU as suggested here.
Why is bert prediction faster on gpu?
@hanxiao If you can provide an example of entity recognition, it’s really good.
Thanks very much! super.single430
@hanxiao Can you please share an example for predicting sentence similarity without encoding sentence. I have fine tuned bert quora question pairs and inference is taking 1-2 seconds after export. Can we get faster than this?
Thanks,
@xwzhong Hi. I tried building tensorflow using bazel from the official instruction. However the build runs for a long time, then throws error. Can you tell me the exact steps you followed?