tfjs icon indicating copy to clipboard operation
tfjs copied to clipboard

"topk" kernel for the WASM backend

Open trekhleb opened this issue 6 years ago • 2 comments

Please make sure that this is a feature request. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:feature_template

System information

  • TensorFlow.js version (you are using): v2.7.0
  • Are you willing to contribute it (Yes/No): No

Describe the feature and the current behavior/state.

Feature

Add support of topk kernel for the WASM backend.

This will allow the WASM based usage of object detection models (i.e. ssd_mobilenet_v2_fpnlite_640x640_coco17_tpu-8 model from TensorFlow 2 Detection Model Zoo, converted to the GraphModel via TensorFlow.js Converter)

Current Behavior Currently WASM backend is failing with the error Error: 'topk' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen.

Will this change the current api? How?

Current API should not be changed

Who will benefit with this feature?

Consumers of converted object detection models from TensorFlow 2 Detection Model Zoo will be able to run them in browser on top of a WASM backend. According to this official TF blogpost it may speed up the detection for up to two times.

Any Other info.

trekhleb avatar Oct 28 '20 00:10 trekhleb

+1 for this feature

lcycoding avatar Oct 28 '20 08:10 lcycoding

cc @annxingyuan

rthadur avatar Oct 28 '20 17:10 rthadur