Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tensorflow Serving with XLA

Is it possible to enable XLA compilation when doing inference with Tensorflow Serving?

(I am hoping it's just a matter of undocumented configs and that I can avoid implementing a custom Servable).

like image 713
njs Avatar asked Aug 03 '26 01:08

njs


1 Answers

@njs,

It is actually not suggested doing compilations during inference. Compilations at inference time will cause HBM to be out of memory, resulting the chips to be unable to serve requests.

The recommended solution is to:

  1. Use batch-function with allowed batch sizes to restrict the number of compilations at run time.

  2. Do all compilations for these allowed batch sizes at model load time instead of inference time. This way your model is ready for inference right after load, rather than going through high latency compilations at inference time.

like image 115
RakTheGeek Avatar answered Aug 04 '26 17:08

RakTheGeek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!