Use -O1 for sleef build in Debug mode#11942
Closed
jamesr66a wants to merge 2 commits intopytorch:masterfrom
Closed
Use -O1 for sleef build in Debug mode#11942jamesr66a wants to merge 2 commits intopytorch:masterfrom
jamesr66a wants to merge 2 commits intopytorch:masterfrom
Conversation
Member
|
This seems like a very good idea. I think we may want to do the same thing for everything in |
Contributor
|
@colesbury - this should include that, no? |
orionr
approved these changes
Sep 21, 2018
Contributor
facebook-github-bot
left a comment
There was a problem hiding this comment.
jamesr66a is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
zdevito
pushed a commit
to zdevito/ATen
that referenced
this pull request
Sep 21, 2018
Summary: `-O0` is problematic for compiling sleef kernels since they consist of a bunch of vector intrinsics. In `-O0`, the compiler spills *every* intermediate value to the stack. In one example (TestEndToEndHybridFrontendModels.test_snli in test_jit.py) the function `Sleef_tanhf8_u10avx2` would spill 30kB of AVX registers onto the stack and run two orders of magnitude slower than in opt mode, causing the test to take minutes rather than seconds. I've verified that this behavior is not present with `-O1` Pull Request resolved: pytorch/pytorch#11942 Differential Revision: D9994658 Pulled By: jamesr66a fbshipit-source-id: cdd9474c6ae3aa9898d5715ac19a900f5f90468a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
-O0is problematic for compiling sleef kernels since they consist of a bunch of vector intrinsics. In-O0, the compiler spills every intermediate value to the stack. In one example (TestEndToEndHybridFrontendModels.test_snli in test_jit.py) the functionSleef_tanhf8_u10avx2would spill 30kB of AVX registers onto the stack and run two orders of magnitude slower than in opt mode, causing the test to take minutes rather than seconds. I've verified that this behavior is not present with-O1