-
Notifications
You must be signed in to change notification settings - Fork 310
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
solve zipformer streaming gpu inference #961
base: master
Are you sure you want to change the base?
Conversation
The script |
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.
Please explain the reason for this modification.
@yaozengwei because it has a error so, only need encode to torch.jit.script. |
Could you try to convert the model to cuda device instead of cpu when doing the jit.trace exporting (See icefall/egs/librispeech/ASR/pruned_transducer_stateless7_streaming/jit_trace_export.py Line 290 in d74822d
We also need to create the inputs on cuda device in this case. (See icefall/egs/librispeech/ASR/pruned_transducer_stateless7_streaming/jit_trace_export.py Line 130 in d74822d
I wonder if we need to export the model on cuda device when we want to run the model on cuda device. See https://pytorch.org/docs/stable/jit.html#frequently-asked-questions |
there are two scenes: rows = torch.arange(start=time1 - 1, end=-1, step=-1)
2、when use cpu to export. the sherpa online[https://github.com/k2-fsa/sherpa/blob/master/sherpa/cpp_api/bin/online-recognizer.cc] use gpu inference, it had a error so, the best method is to modify the encode export style. using torch.jit.script. |
Could you successfully export the model if you do the change The reason why we export with jit.trace instead of jit.script is some inference frameworks need that. |
when use rows = torch.arange(start=time1 - 1, end=-1, step=-1).cuda(), it failed. so I try to use torch.jit.script for the encode model. then, use sherpa online. it can run successfullly when use_gpu. |
Ok. The exported encoder that you are running on cuda device is jit.script version. |
No description provided.