-
Notifications
You must be signed in to change notification settings - Fork 275
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
Reduce unnecessary zero-init'd allocations #632
Conversation
Replace superfluous zero-init'd allocs with uninit'd ones
Minor optimization to Ops.gelu_approx
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.
Great idea!
Not sure about the naming - uninitialized
is not the most straightforward to type, but maybe just empty
is too cryptic?
Yeah, I thought I'm open to suggestions/switching to |
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.
Looks good to me!
Could you also update the documentation in /website/docs
?
There are some allocations in |
|
@explosion-bot please test_gpu |
URL: https://buildkite.com/explosion-ai/thinc-gpu-test-suite/builds/36 |
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.
Marked a few cases where I was unsure, but an additional set of eyes would be good!
60cb873
to
26fa753
Compare
26fa753
to
d337312
Compare
@explosion-bot please test_gpu |
URL: https://buildkite.com/explosion-ai/thinc-gpu-test-suite/builds/37 |
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.
Looks great to me! But I'll defer to @svlandeg for a second opinion :).
Whoops! Clicked on the wrong "Re-request review" button. Only mean to do so for @svlandeg. |
Merged! |
* `NumpyOps`: Revert uninit'd alloc in `reduce_max` * Test `which` in `test_reduce_max`
I've added a new keyword arg
uninitialized
to the allocator methods in theNumpyOps
andOps
classes. Also replaced some zero-init'd allocations where the elements in the destination array were immediately replaced.