@@ -278,41 +278,56 @@ de = tfra.dynamic_embedding.get_variable("VariableOnGpu",
278
278
sess_config.gpu_options.allow_growth = True
279
279
```
280
280
281
- ## Inference with TensorFlow Serving
281
+ ## Inference
282
+
283
+ ### With TensorFlow Serving
282
284
283
285
#### Compatibility Matrix
284
- | TFRA | TensorFlow | Serving | Compiler | CUDA | CUDNN | Compute Capability |
285
- | :------| :-----------| :---- | :---------| :------------ | :---- | :------------ |
286
- | 0.6.0 | 2.8.3 | 2.5.2 | GCC 7.3.1 | 11.2| 8.1 | 6.0, 6.1, 7.0, 7.5, 8.0, 8.6 |
287
- | 0.5.1 | 2.8.3 | 2.5.2 | GCC 7.3.1 | 11.2| 8.1 | 6.0, 6.1, 7.0, 7.5, 8.0, 8.6 |
288
- | 0.5.0 | 2.8.3 | 2.5.2 | GCC 7.3.1 | 11.2| 8.1 | 6.0, 6.1, 7.0, 7.5, 8.0, 8.6 |
289
- | 0.4.0 | 2.5.1 | 2.5.2 | GCC 7.3.1 | 11.2| 8.1 | 6.0, 6.1, 7.0, 7.5, 8.0, 8.6 |
290
- | 0.3.1 | 2.5.1 | 2.5.2 | GCC 7.3.1 | 11.2| 8.1 | 6.0, 6.1, 7.0, 7.5, 8.0, 8.6 |
291
- | 0.2.0 | 2.4.1 | 2.4.0 | GCC 7.3.1 | 11.0 | 8.0 | 6.0, 6.1, 7.0, 7.5, 8.0 |
292
- | 0.2.0 | 1.15.2 | 1.15.0 | GCC 7.3.1 | 10.0 | 7.6 | 6.0, 6.1, 7.0, 7.5 |
293
- | 0.1.0 | 2.4.1 | 2.4.0 | GCC 7.3.1 | - | - | - |
294
-
295
- ** NOTICE** :Reference documents: https://www.tensorflow.org/tfx/serving/custom_op
296
-
297
- #### CPU or GPU Serving TensorFlow models with custom ops
298
- When compiling, set the environment variable:
286
+ | TFRA | TensorFlow | Serving branch | Compiler | CUDA | CUDNN | Compute Capability |
287
+ | :------| :-----------| :---------------| :---------| :------------ | :---- | :------------ |
288
+ | 0.6.0 | 2.8.3 | r2.8 | GCC 7.3.1 | 11.2| 8.1 | 6.0, 6.1, 7.0, 7.5, 8.0, 8.6 |
289
+ | 0.5.1 | 2.8.3 | r2.8 | GCC 7.3.1 | 11.2| 8.1 | 6.0, 6.1, 7.0, 7.5, 8.0, 8.6 |
290
+ | 0.5.0 | 2.8.3 | r2.8 | GCC 7.3.1 | 11.2| 8.1 | 6.0, 6.1, 7.0, 7.5, 8.0, 8.6 |
291
+ | 0.4.0 | 2.5.1 | r2.5 | GCC 7.3.1 | 11.2| 8.1 | 6.0, 6.1, 7.0, 7.5, 8.0, 8.6 |
292
+ | 0.3.1 | 2.5.1 | r2.5 | GCC 7.3.1 | 11.2| 8.1 | 6.0, 6.1, 7.0, 7.5, 8.0, 8.6 |
293
+ | 0.2.0 | 2.4.1 | r2.4 | GCC 7.3.1 | 11.0 | 8.0 | 6.0, 6.1, 7.0, 7.5, 8.0 |
294
+ | 0.2.0 | 1.15.2 | r1.15 | GCC 7.3.1 | 10.0 | 7.6 | 6.0, 6.1, 7.0, 7.5 |
295
+ | 0.1.0 | 2.4.1 | r2.4 | GCC 7.3.1 | - | - | - |
296
+
297
+ Serving TFRA-enable models by custom ops in TensorFlow Serving.
298
+
299
299
``` sh
300
- export FOR_TF_SERVING = " 1"
301
- ```
302
- Tensorflow Serving modification(** model_servers/BUILD** ):
303
- ```
304
- SUPPORTED_TENSORFLOW_OPS = if_v2([]) + if_not_v2([
305
- "@org_tensorflow//tensorflow/contrib:contrib_kernels",
306
- "@org_tensorflow//tensorflow/contrib:contrib_ops_op_lib",
307
- ]) + [
308
- "@org_tensorflow_text//tensorflow_text:ops_lib",
309
- "//tensorflow_recommenders_addons/dynamic_embedding/core:_cuckoo_hashtable_ops.so",
310
- "//tensorflow_recommenders_addons/dynamic_embedding/core:_math_ops.so",
311
- ]
300
+ # # If enable GPU OPs
301
+ export SERVING_WITH_GPU=1
302
+
303
+ # # Specifiy the branch of TFRA
304
+ export TFRA_BRANCH=" master" # The `master` and `r0.6` are available.
305
+
306
+ # # Create workspace, modify the directory as you prefer to.
307
+ export TFRA_SERVING_WORKSPACE=~ /tfra_serving_workspace/
308
+ mkdir -p $TFRA_SERVING_WORKSPACE && cd $TFRA_SERVING_WORKSPACE
309
+
310
+ # # Clone the release branches of serving and TFRA according to `Compatibility Matrix`.
311
+ git clone -b r2.8 https://github.com/tensorflow/serving.git
312
+ git clone -b $TFRA_BRANCH https://github.com/tensorflow/recommenders-addons.git
313
+
314
+ # # Run config shell script
315
+ cd $TFRA_SERVING_WORKSPACE /recommenders-addons/tools
316
+ bash config_tfserving.sh $TFRA_BRANCH $TFRA_SERVING_WORKSPACE /serving $SERVING_WITH_GPU
317
+
318
+ # # Build serving with TFRA OPs.
319
+ cd $TFRA_SERVING_WORKSPACE /serving
320
+ ./tools/run_in_docker.sh bazel build tensorflow_serving/model_servers:tensorflow_model_server
321
+
312
322
```
323
+
324
+ For more detail, please refer to the shell script ` ./tools/config_tfserving.sh ` .
325
+
313
326
** NOTICE**
314
327
- Distributed inference is only supported when using Redis as Key-Value storage.
328
+ - Reference documents: https://www.tensorflow.org/tfx/serving/custom_op
315
329
330
+ ### With Triton(W.I.P)
316
331
317
332
## Community
318
333
0 commit comments