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

Pytorch compile #934

Merged
merged 5 commits into from
Sep 5, 2023
Merged

Pytorch compile #934

merged 5 commits into from
Sep 5, 2023

Conversation

aakashdp6548
Copy link
Collaborator

Upgrade pytorch version to 2.0 and compile yolo model in encoder. Closes #905.

In theory we can get better speedup by compiling all of encode_batch. But this is causing a lot of torch dynamo errors/warnings:

AttributeError: 'UnspecializedNNModuleVariable' object has no attribute 'module_key'

from user code:
   File "/home/aakashdp/.cache/pypoetry/virtualenvs/bliss-deblender-av05Bskt-py3.10/lib/python3.10/site-packages/torch/nn/modules/container.py", line 120, in __getitem__
    return self._get_item_by_idx(self._modules.values(), idx)

Set torch._dynamo.config.verbose=True for more information


You can suppress this exception and fall back to eager by setting:
    torch._dynamo.config.suppress_errors = True

I'm not confident that suppressing them is the right thing to do, so I'm just compiling the yolo model for now (which has more modest speedup, but works without issues).

@codecov
Copy link

codecov bot commented Sep 5, 2023

Codecov Report

Merging #934 (cf2c57f) into master (b65e24c) will decrease coverage by 0.06%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master     #934      +/-   ##
==========================================
- Coverage   95.88%   95.82%   -0.06%     
==========================================
  Files          26       26              
  Lines        3209     3211       +2     
==========================================
  Hits         3077     3077              
- Misses        132      134       +2     
Flag Coverage Δ
unittests 95.82% <50.00%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
bliss/encoder.py 96.77% <50.00%> (-0.44%) ⬇️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@jeff-regier jeff-regier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jeff-regier jeff-regier merged commit 2590a63 into master Sep 5, 2023
3 checks passed
@jeff-regier jeff-regier deleted the pytorch-compile branch September 5, 2023 19:25
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

Successfully merging this pull request may close these issues.

torch.compile
2 participants