solve zipformer streaming gpu inference#961
Conversation
|
The script |
yfyeung
left a comment
There was a problem hiding this comment.
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 We also need to create the inputs on cuda device in this case. (See 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.