-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SpeakerClustering: fix tensor dimennsions in forward() #5387
SpeakerClustering: fix tensor dimennsions in forward() #5387
Conversation
For some paramters in SpeakerClustering.forward(), tensor dimensions were not specified. This results in error when inferencing exported model in Triton server. Signed-off-by: Viraj Karandikar <[email protected]>
4274f39
to
439d93f
Compare
@tango4j can you review this? |
Signed-off-by: Taejin Park <[email protected]>
Signed-off-by: Taejin Park <[email protected]>
Signed-off-by: Taejin Park <[email protected]>
for more information, see https://pre-commit.ci
Signed-off-by: Taejin Park <[email protected]>
…karandikar/NeMo into vkarandikar_fix_clustering
for more information, see https://pre-commit.ci
@virajkarandikar The change looks good. I have added unit-test for jit script exporting. However, this can only check problems on the python side, not for triton server cases. |
return emb_tensor, segm_tensor, multiscale_segment_counts, multiscale_weights, spk_timestamps | ||
|
||
|
||
@pytest.mark.skip("test is not intended") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we skipping this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is sub-function for other testcases. This function was included in the test hogging up the time so skipped it.
This allows triton inference using human readable dict keys for parameter names instead of cryptic INPUT_x notation Signed-off-by: Viraj Karandikar <[email protected]>
4dc1d85
to
dafa2de
Compare
@tango4j I have changed the forward to use Dict. This allows triton inference by using parameter names instead of INPUT_n notation. See https://github.com/triton-inference-server/server/blob/main/docs/user_guide/model_configuration.md#special-conventions-for-pytorch-backend for details. Looks like the unit test needs to be updated. Will you do that please? I will try if I can. |
Signed-off-by: Taejin Park <[email protected]>
for more information, see https://pre-commit.ci
Signed-off-by: Taejin Park <[email protected]>
Signed-off-by: Taejin Park <[email protected]>
…karandikar/NeMo into vkarandikar_fix_clustering
@virajkarandikar The cluster inference function should have parameters for re-usability. so I made a wrapper function for the part you created ( |
Signed-off-by: Taejin Park <[email protected]>
…karandikar/NeMo into vkarandikar_fix_clustering
for more information, see https://pre-commit.ci
Ok. It works fine. |
@virajkarandikar Sure, I will add a test for forward(). |
Signed-off-by: Taejin Park <[email protected]>
…karandikar/NeMo into vkarandikar_fix_clustering
for more information, see https://pre-commit.ci
@virajkarandikar I have added the test-case for .forward() (triton env inference). @nithinraok Please approve if there is no issues with this PR. Tutorial notebooks are also tested without errors. |
* SpeakerClustering: fix tensor dimennsions in forward() For some paramters in SpeakerClustering.forward(), tensor dimensions were not specified. This results in error when inferencing exported model in Triton server. Signed-off-by: Viraj Karandikar <[email protected]> * adding tests for clustering Signed-off-by: Taejin Park <[email protected]> * removed unused functions Signed-off-by: Taejin Park <[email protected]> * removed unused functions 2 Signed-off-by: Taejin Park <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixed cpu/gpu test decorator for unittests Signed-off-by: Taejin Park <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * clustering: use dict in forward This allows triton inference using human readable dict keys for parameter names instead of cryptic INPUT_x notation Signed-off-by: Viraj Karandikar <[email protected]> * created a wrapper for param_dicts for triton infer Signed-off-by: Taejin Park <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixed docstrings Signed-off-by: Taejin Park <[email protected]> * fixed docstring Signed-off-by: Taejin Park <[email protected]> * fixed test_speaker_counting function in the test Signed-off-by: Taejin Park <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Added a test for Triton server call Signed-off-by: Taejin Park <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Signed-off-by: Viraj Karandikar <[email protected]> Signed-off-by: Taejin Park <[email protected]> Co-authored-by: Taejin Park <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Signed-off-by: Hainan Xu <[email protected]>
* SpeakerClustering: fix tensor dimennsions in forward() For some paramters in SpeakerClustering.forward(), tensor dimensions were not specified. This results in error when inferencing exported model in Triton server. Signed-off-by: Viraj Karandikar <[email protected]> * adding tests for clustering Signed-off-by: Taejin Park <[email protected]> * removed unused functions Signed-off-by: Taejin Park <[email protected]> * removed unused functions 2 Signed-off-by: Taejin Park <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixed cpu/gpu test decorator for unittests Signed-off-by: Taejin Park <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * clustering: use dict in forward This allows triton inference using human readable dict keys for parameter names instead of cryptic INPUT_x notation Signed-off-by: Viraj Karandikar <[email protected]> * created a wrapper for param_dicts for triton infer Signed-off-by: Taejin Park <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixed docstrings Signed-off-by: Taejin Park <[email protected]> * fixed docstring Signed-off-by: Taejin Park <[email protected]> * fixed test_speaker_counting function in the test Signed-off-by: Taejin Park <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Added a test for Triton server call Signed-off-by: Taejin Park <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Signed-off-by: Viraj Karandikar <[email protected]> Signed-off-by: Taejin Park <[email protected]> Co-authored-by: Taejin Park <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Signed-off-by: Hainan Xu <[email protected]>
* SpeakerClustering: fix tensor dimennsions in forward() For some paramters in SpeakerClustering.forward(), tensor dimensions were not specified. This results in error when inferencing exported model in Triton server. Signed-off-by: Viraj Karandikar <[email protected]> * adding tests for clustering Signed-off-by: Taejin Park <[email protected]> * removed unused functions Signed-off-by: Taejin Park <[email protected]> * removed unused functions 2 Signed-off-by: Taejin Park <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixed cpu/gpu test decorator for unittests Signed-off-by: Taejin Park <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * clustering: use dict in forward This allows triton inference using human readable dict keys for parameter names instead of cryptic INPUT_x notation Signed-off-by: Viraj Karandikar <[email protected]> * created a wrapper for param_dicts for triton infer Signed-off-by: Taejin Park <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixed docstrings Signed-off-by: Taejin Park <[email protected]> * fixed docstring Signed-off-by: Taejin Park <[email protected]> * fixed test_speaker_counting function in the test Signed-off-by: Taejin Park <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Added a test for Triton server call Signed-off-by: Taejin Park <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Signed-off-by: Viraj Karandikar <[email protected]> Signed-off-by: Taejin Park <[email protected]> Co-authored-by: Taejin Park <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* SpeakerClustering: fix tensor dimennsions in forward() For some paramters in SpeakerClustering.forward(), tensor dimensions were not specified. This results in error when inferencing exported model in Triton server. Signed-off-by: Viraj Karandikar <[email protected]> * adding tests for clustering Signed-off-by: Taejin Park <[email protected]> * removed unused functions Signed-off-by: Taejin Park <[email protected]> * removed unused functions 2 Signed-off-by: Taejin Park <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixed cpu/gpu test decorator for unittests Signed-off-by: Taejin Park <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * clustering: use dict in forward This allows triton inference using human readable dict keys for parameter names instead of cryptic INPUT_x notation Signed-off-by: Viraj Karandikar <[email protected]> * created a wrapper for param_dicts for triton infer Signed-off-by: Taejin Park <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixed docstrings Signed-off-by: Taejin Park <[email protected]> * fixed docstring Signed-off-by: Taejin Park <[email protected]> * fixed test_speaker_counting function in the test Signed-off-by: Taejin Park <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Added a test for Triton server call Signed-off-by: Taejin Park <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Signed-off-by: Viraj Karandikar <[email protected]> Signed-off-by: Taejin Park <[email protected]> Co-authored-by: Taejin Park <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Signed-off-by: andrusenkoau <[email protected]>
For some paramters in SpeakerClustering.forward(), tensor dimensions were not specified and this resulted in zero dimension tensor inputs. This causes error when inferencing exported model in Triton server.
What does this PR do ?
Avoids zero dimension input tensors. Also extracts values from the tensors which have single dim of size 1. This avoids scattered use of item() to extract value from tensor.
Collection: ASR Diarizer
Changelog
Usage
Fix is needed to use exported clustering model in Triton
# Add a code snippet demonstrating how to use this
Before your PR is "Ready for review"
Pre checks:
PR Type:
If you haven't finished some of the above items you can still open "Draft" PR.
Who can review?
Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.
Additional Information