ilyag-grovety opened a new pull request, #15117:
URL: https://github.com/apache/tvm/pull/15117
This PR adds support of regular NMS operator.
Open questions:
1. How to properly test added functionality?
Other NMS implementations, e.g., fast NMS, use a TF frozen graph from TF
official website to convert a model to TFLite and keep NMS operations only. In
order to create a similar test, we need to find an archive on TF official
website that contains a frozen graph of a model compiled with
`--use-regular-nms=True` flag. We haven't found it yet, so any help is
appreciated.
3. Regular NMS requires two sort operations:
- Sorting the scores after selecting scores above `nms_score_threshold`.
This PR implements this with a simple bubble sort in order to prove the
algorithm's semantics. We tried to replace it with `tvm.contrib.sort.argsort`.
It works well when testing the regular NMS with `run_tvm_graph` as fast NMS
test does or building and running the regular NMS with llvm target. At the same
time, it fails to build (error is provided below) when
`target=ethos-u,cmsis-nn,c`. It seems that `__tvm_module_ctx` variable is only
being initialized when `cpp` runtime is chosen.
The error:
`error: '__tvm_module_ctx' undeclared (first use in this function)
203 | if (TVMBackendGetFuncFromEnv(__tvm_module_ctx,
"tvm.contrib.sort.argsort", &tvm_contrib_sort_argsort_packed) != 0) {`
- Sorting the scores of previous and current NMS steps. There are two
alternatives here:
- implement some sorting algorithm as part of hybrid script (to
replace current bubble sort)
- save the result of each NMS step and use `argsort` after the hybrid
script part. This approach has a drawback as it requires significant amount of
memory to store the results of each NMS step.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]