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

Making features and neural networks jitable #4

Closed
mravanelli opened this issue Apr 28, 2020 · 5 comments
Closed

Making features and neural networks jitable #4

mravanelli opened this issue Apr 28, 2020 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@mravanelli
Copy link
Collaborator

1- Check if all the project is now jitable
2- Do the little changes to features and archictecture.py to make everything jitable
I will focus on that once the performance issue is fixed.

@mravanelli mravanelli added the enhancement New feature or request label Apr 28, 2020
@mravanelli mravanelli self-assigned this Apr 28, 2020
@pplantinga
Copy link
Collaborator

From Mirco:
For jitability I have the following proposal
1- we can jit only the subset of functions that give a major speed-up. For now, I saw a major speed up only for customized rnns (and I think there could be a speedup for all the functions containing long for loops). As you can see from the ligru in architecture.py this can be done with torch.jit.ScriptModule and the decoration flag
2- We can expect that only a subset of users might want to export the model in c++. This operation typically happens after training. In practice, the user can call sb.recover_if_possible(min_key="wer") and only after that users can make the model jitable. Let me check if this might work. If so, we can provide some examples to the users about "how to make your model jitable"

@TParcollet
Copy link
Collaborator

Can we ask the pytorch team for some insights on this part? It could be great to give a general expected performance improvement scale to the user w.r.t to specific operations. @pplantinga In fact, if we also are interested in seducing companies, the possibility to export c++ is quite important ... So it could be great to have an easy interface for that.

@pplantinga
Copy link
Collaborator

We discussed this at the Architecture meeting today. Some notes from the meeting:

  • It is not currently possible to support both shape inference and jitability.
  • The devs at PyTorch consider shape inference to be harmful, so they aren't planning to make changes so that both are possible.
  • For the majority of users, shape inference will be a large benefit so we plan to support that by default rather than jitability.
  • Mirco will write a document explaining how to export c++ (basically, train the model as usual, comment out about 2 lines per forward method used in the model, then export).

@TParcollet
Copy link
Collaborator

"The devs at PyTorch consider shape inference to be harmful" -> But this is what is so powerful about PyTorch ... But I see.

@mravanelli
Copy link
Collaborator Author

mravanelli commented May 4, 2020 via email

30stomercury pushed a commit that referenced this issue Sep 21, 2020
@samuelazran samuelazran mentioned this issue May 16, 2021
2 tasks
fpaissan pushed a commit to fpaissan/speechbrain that referenced this issue May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants