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

Accelerating inference performance with torch.compile #67

Open
saugatkandel opened this issue May 11, 2024 · 0 comments
Open

Accelerating inference performance with torch.compile #67

saugatkandel opened this issue May 11, 2024 · 0 comments

Comments

@saugatkandel
Copy link

I noticed that membrain-seg does not currently use jit compilation. Using torch.compile (https://pytorch.org/tutorials/intermediate/torch_compile_tutorial.html) can be a simple way to accelerate the model performance for training and inference. Just wrapping

model_new = torch.compile(model)

is usually sufficient to increase the performance by 2x. Are there any barriers to incorporating such a change within membrain-seg?

I have been using this in my own membrain-seg wrappers, and it has worked very well. However, making jit work with on-the-fly Fourier cropping and rescaling could require more work than just this simple one-line change.

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

1 participant