-
Notifications
You must be signed in to change notification settings - Fork 14
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
Improve Batched GEMV Speed #113
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Shaun Ren <[email protected]>
In addition, run GEMV multiple times to improve the accuracy of the result. Signed-off-by: Shaun Ren <[email protected]>
Signed-off-by: Shaun Ren <[email protected]>
Signed-off-by: Shaun Ren <[email protected]>
Signed-off-by: Shaun Ren <[email protected]>
Signed-off-by: Shaun Ren <[email protected]>
Signed-off-by: Shaun Ren <[email protected]>
Signed-off-by: Shaun Ren <[email protected]>
Signed-off-by: Shaun Ren <[email protected]>
Signed-off-by: Shaun Ren <[email protected]>
Signed-off-by: Shaun Ren <[email protected]>
nengo_ocl/raggedarray.py
Outdated
def __init__(self, arrays, names=None, dtype=None, align=False): | ||
arrays = [np.asarray(a) for a in arrays] | ||
def __init__(self, arrays, names=None, dtype=None, align=False, order='C'): | ||
assert order in 'CF' |
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 think assert order in ('C', 'F')
would be better, because 'CF'
would also be accepted with what you have above, right?
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.
You're right, I overlooked this bug. I'll change it in another commit.
Very cool! I'm looking forward to trying this out when I get back. What still needs to be done before this is ready for full review/merge? |
Signed-off-by: Shaun Ren <[email protected]>
There are still some kernels that need to be modified to work with column-major; and an autotuner should be added. |
Signed-off-by: Shaun Ren <[email protected]>
The autotuner is a bigger job, and I think it should be a separate PR. Getting the other kernels work with column-major sounds like the main work needed for this PR. |
This commit implements the more accurate LIF model, implemented in Nengo 2.1.1, in OpenCL. A new boolean argument `fastlif' is also added in plan_lif, which defaults to False. See <nengo/nengo#975> for details regarding the new LIF model. Signed-off-by: Shaun Ren <[email protected]>
3295671
to
41e9e9d
Compare
Signed-off-by: Shaun Ren <[email protected]>
Signed-off-by: Shaun Ren <[email protected]>
Signed-off-by: Shaun Ren <[email protected]>
Signed-off-by: Shaun Ren <[email protected]>
Signed-off-by: Shaun Ren <[email protected]>
Signed-off-by: Shaun Ren <[email protected]>
This patchset is now ready for review/merge. |
Using column-major instead of row-major matrices is found to improve the speed of GEMV in nearly all cases, with improvements in some practical scenarios, such as Spaun 2.0.
Also, the LIF kernel is updated to use the more accurate LIF model in Nengo 2.1.1. This is found to have negligible performance penalties.
The current, non autotuned colmun-major kernel is able to achieve a total of 31 s of Sim time speedup on Spaun 2.0 (202s -> 171s) on a GTX 970.