Skip to content
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

Fix for DS_IntermediateDecode modifying live prefixes in DecoderState #2184

Merged
merged 3 commits into from
Jun 20, 2019

Conversation

reuben
Copy link
Contributor

@reuben reuben commented Jun 18, 2019

No description provided.

@reuben
Copy link
Contributor Author

reuben commented Jun 18, 2019

@eggonlea can you try this fix and verify if it fixes the bug you found?

Copy link
Collaborator

@eggonlea eggonlea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected with different "--stream size".

But copying all prefixes and creating new maps is time consuming. The smaller stream size, the lower efficiency. It would be great if we can avoid the copy at all.

@eggonlea eggonlea mentioned this pull request Jun 18, 2019
@reuben
Copy link
Contributor Author

reuben commented Jun 18, 2019

Yes, it is. I'm trying to design a better way of fixing this, the PathTrie makes it a bit tricky.

@reuben
Copy link
Contributor Author

reuben commented Jun 18, 2019

Although it should only really matter if you call intermediate decode very often.

@reuben reuben requested a review from lissyx June 19, 2019 22:55
@reuben
Copy link
Contributor Author

reuben commented Jun 19, 2019

@lissyx the crux of the problem here is that in decoder_decode we were sorting the live prefixes still being used by decoder_next, which changes the behavior of the decoder over the whole stream. This solution is a bit hacky, it copies the prefix vector, stores the modified scores outside of the vector, and then sorts them with an external score, which keeps all the live prefixes unchanged except for approx_ctc (which isn't used in decoder_next). A better fix requires more substantial changes to the decoder implementation, but I'd rather fix this quickly for 0.5.1.

@lissyx
Copy link
Collaborator

lissyx commented Jun 20, 2019

r+

@reuben reuben merged commit 080fc27 into master Jun 20, 2019
@reuben reuben deleted the fix-intermediate-decode branch June 20, 2019 13:37
@lock
Copy link

lock bot commented Jul 20, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Jul 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants