@@ -327,7 +327,38 @@ For more detail, please refer to the shell script `./tools/config_tfserving.sh`.
327
327
- Distributed inference is only supported when using Redis as Key-Value storage.
328
328
- Reference documents: https://www.tensorflow.org/tfx/serving/custom_op
329
329
330
- ### With Triton(W.I.P)
330
+ ### With Triton
331
+ When building the custom operations shared library it is important to
332
+ use the same version of TensorFlow as is being used in Triton. You can
333
+ find the TensorFlow version in the [ Triton Release
334
+ Notes] ( https://docs.nvidia.com/deeplearning/triton-inference-server/release-notes/index.html ) . A
335
+ simple way to ensure you are using the correct version of TensorFlow
336
+ is to use the [ NGC TensorFlow
337
+ container] ( https://ngc.nvidia.com/catalog/containers/nvidia:tensorflow )
338
+ corresponding to the Triton container. For example, if you are using
339
+ the 23.05 version of Triton, use the 23.05 version of the TensorFlow
340
+ container.
341
+ ``` bash
342
+ docker pull nvcr.io/nvidia/tritonserver:22.05-py3
343
+
344
+ export TFRA_BRANCH=" master"
345
+ git clone -b $TFRA_BRANCH https://github.com/tensorflow/recommenders-addons.git
346
+ cd recommenders-addons
347
+
348
+ python configure.py
349
+ bazel build //tensorflow_recommenders_addons/dynamic_embedding/core:_cuckoo_hashtable_ops.so # #bazel 5.1.1 is well tested
350
+ mkdir /tmp/so
351
+ # you can also use the so file from pip install package file from "(PYTHONPATH)/site-packages/tensorflow_recommenders_addons/dynamic_embedding/core/_cuckoo_hashtable_ops.so"
352
+ cp bazel-bin/tensorflow_recommenders_addons/dynamic_embedding/core/_cuckoo_hashtable_ops.so /tmp/so
353
+
354
+ # tfra saved_model directory "/models/model_repository"
355
+ docker run --net=host -v /models/model_repository:/models nvcr.io/nvidia/tritonserver:22.05-py3 bash -c \
356
+ " LD_PRELOAD=/tmp/so/_cuckoo_hashtable_ops.so:${LD_PRELOAD} tritonserver --model-repository=/models/ --backend-config=tensorflow,version=2 --strict-model-config=false"
357
+ ```
358
+
359
+ ** NOTICE**
360
+ - The above LD_LIBRARY_PATH and backend-config must be set Because the default backend is tf1.
361
+
331
362
332
363
## Community
333
364
@@ -341,3 +372,5 @@ We also want to extend a thank you to the Google team members who have helped wi
341
372
## License
342
373
Apache License 2.0
343
374
375
+
376
+
0 commit comments