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

JIT compilation? #70

Open
GilesStrong opened this issue Jun 8, 2020 · 0 comments
Open

JIT compilation? #70

GilesStrong opened this issue Jun 8, 2020 · 0 comments
Labels
improvement Something which would improve current status, but not add anything new investigation Something which might require a careful study medium priority Not urgent but should be dealt with sooner rather than later

Comments

@GilesStrong
Copy link
Owner

PyTorch has the ability to Just In Time compile stuff to make it run quicker and be more memory efficient. I'd tried to do this a while ago with @weak_script and @weak_module decorators, however they didn't seem to do much and I had trouble automatically generating the docs. I then found that PyTorch recommended that users not use these decorators. Since then PyTorch apparently introduced @torch.jit.script decorators, which are for user use and supposedly provide noticeable improvements in speed and memory usage.

Examples could be for compiling activation functions:
Screenshot from 2020-06-08 11-33-31
Screenshot from 2020-06-08 11-33-30

Whereas LUMIN's implementation of Swish is simply: x*torch.sigmoid(x). Other possibilities could be in LUMIN's loss function (e.g. WeightedMSE). I'm not sure how far one can take this; should all things related to PyTorch be JIT complied, or perhaps only operations on tensors?

A starting point would be test out the JIT compiled Swish against the current version, and then to try to find out more about what should be JITed, and what doesn't.

@GilesStrong GilesStrong added improvement Something which would improve current status, but not add anything new medium priority Not urgent but should be dealt with sooner rather than later investigation Something which might require a careful study labels Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Something which would improve current status, but not add anything new investigation Something which might require a careful study medium priority Not urgent but should be dealt with sooner rather than later
Projects
None yet
Development

No branches or pull requests

1 participant