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

[Feature] Handling onnxrt execution provider config for various models #1098

Closed
manickavela29 opened this issue Jul 9, 2024 · 3 comments
Closed

Comments

@manickavela29
Copy link
Contributor

manickavela29 commented Jul 9, 2024

Hi @csukuangfj,

With #992, config for backends are handled as arguments and it is done.

But there is an additional issue with arguments and models, as the suggested configs are not specific to models
In the case of zipformer,

  • configs required for encoder model, need not be required for decoder and joiner
  • Tensorrt has max_workspace_size which will limit the gpu memory usage for the session,
  • Encoder model can take mode space, which is not necessary for decoder. but with our current arguments both are allocated same memory

Solution :
for zipformer case,
Adding encoder_config, decoder_config and joiner_config

std::string encoder;
std::string decoder;
std::string joiner;

and a new overloaded function at providers and session
All the config will be hardcoded for specific model and not as argument while starting sherpa,

But if you have any better suggestions let me know

@manickavela29 manickavela29 changed the title [Feature] Handling onnxrt execution provider config for several models flexibly [Feature] Handling onnxrt execution provider config for various models Jul 9, 2024
@csukuangfj
Copy link
Collaborator

Adding encoder_config, decoder_config and joiner_config

That would introduce too many command line arguments


How about creating separate sess_opts_ for the decoder and the joiner and hard-coding the config values if tensorrt is used?

@manickavela29
Copy link
Contributor Author

Yes, I meant on similar lines,

By adding separate configs for encoder,decoder and joiner,
I actually meant they will be hardcoded and not exposed as an argument.

And as you suggested, they will have separate sess_opts_ which will be built with their hardcoded custom config

@manickavela29
Copy link
Contributor Author

manickavela29 commented Jul 15, 2024

Actually, given the mode size of decoder and joiner,
we can as well just running with CUDA EP itself,
since encoder is the only heavy lifter here

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

No branches or pull requests

2 participants