Skip to content

fix lattice length of rnnt_decode#1089

Closed
glynpu wants to merge 1 commit into
k2-fsa:masterfrom
glynpu:fix_lattice_length_rnnt_decode
Closed

fix lattice length of rnnt_decode#1089
glynpu wants to merge 1 commit into
k2-fsa:masterfrom
glynpu:fix_lattice_length_rnnt_decode

Conversation

@glynpu

@glynpu glynpu commented Nov 3, 2022

Copy link
Copy Markdown
Contributor

The logprobs of final frame does not contribute lattice generation.
This pr is trying to fix this issue.

With original code.

if num_frames = 1

image

if num_frames = 10
image

Current pr

if num_frames = 1
image

if num_frames = 10
image

Comment thread k2/csrc/rnnt_decode.cu
states_.TotSize(1),
config_.vocab_size,
0);
Advance(dummy_logprobs);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Current implementation will cause an error when decoding chunk by chunk, I think you need to delete the states gennerated by dummy advance before flushing back to streams.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I will say, a dummy advance is a good idea to fix this issue.

@pkufool pkufool Nov 3, 2022

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

BTW, we'd better make this dummy advance run only once per sequence (i.e. the last chunk), If we do it for every chunk, it will be a big overhead.

@glynpu glynpu mentioned this pull request Jan 4, 2023
@glynpu

glynpu commented Jan 4, 2023

Copy link
Copy Markdown
Contributor Author

Close this since we figure out a faster verson. #1134

@glynpu glynpu closed this Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants