-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Exp, log, sin, cos vectorized #6078
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
Conversation
colesbury
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure these macros made the code easier to read
test/test_torch.py
Outdated
| def _testMathSize(size, self, torchfn, mathfn, dtype, prec): | ||
| # contiguous | ||
| m1 = torch.randn(*size) | ||
| m1 = torch.randn(*size).type(dtype) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
test/test_torch.py
Outdated
| self.assertEqual(res1, res2, prec) | ||
|
|
||
| types = [ | ||
| ('torch.DoubleTensor', precs[0]), |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
test/test_torch.py
Outdated
| ('torch.DoubleTensor', precs[0]), | ||
| ('torch.FloatTensor', precs[1]), | ||
| ] | ||
| for (dtype, prec) in types: |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
aten/src/ATen/native/cpu/Vec256.h
Outdated
| #endif | ||
|
|
||
| #if defined(__GNUC__) | ||
| # define ALIGN32_ __attribute__((aligned(32))) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
aten/src/TH/vector/AVX2.cpp
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
aten/src/ATen/native/cpu/Vec256.h
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
8e40dbd to
ca8a3d1
Compare
Measured perf using this script. The 1GB benchmarks for doubles are still running, but the 100MB benchmarks indicate a slight perf regression using this branch presumably because of the extra store and load within the non-avx2 implementation of vec and vec.
EDIT: Added timings for double
EDIT: Added support for abs for all types
Single core
Master
This branch
Abs Master
Abs This branch