-
Notifications
You must be signed in to change notification settings - Fork 13
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
Performance improvement in kernel launches by using lighter NumPy APIs #258
Conversation
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.
Test (commit 00a575a) passed in titanv.
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.
Test (commit 00a575a) passed in vega.
@LWisteria I'd appreciate your review. |
The issue discussing the change: #257 |
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.
@ybsh I reviewed. Change PR's title. It describes nothing now.
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.
Test (commit 99d45fe) failed in titanv.
============================= test session starts ==============================
platform linux -- Python 3.6.5, pytest-4.3.0, py-1.8.0, pluggy-0.13.0
rootdir: /home/clpy-jenkins-slave/workspace/clpy_testing_titan, inifile: setup.cfg
collected 0 items / 23 errors
==================================== ERRORS ====================================
_________ ERROR collecting tests/clpy_tests/core_tests/test_carray.py __________
test_carray.py:3: in <module>
import clpy
../../../clpy/__init__.py:17: in <module>
from clpy import core # NOQA
../../../clpy/core/__init__.py:1: in <module>
from clpy.core import core # NOQA
clpy/backend/function.pxd:4: in init clpy.core.core
???
../../../clpy/backend/__init__.py:3: in <module>
from clpy.backend import compiler # NOQA
clpy/backend/function.pxd:4: in init clpy.backend.compiler
???
clpy/backend/function.pyx:38: in init clpy.backend.function
???
E AttributeError: module 'clpy' has no attribute 'core'
__________ ERROR collecting tests/clpy_tests/core_tests/test_core.py ___________
test_core.py:3: in <module>
import clpy
../../../clpy/__init__.py:17: in <module>
from clpy import core # NOQA
../../../clpy/core/__init__.py:1: in <module>
from clpy.core import core # NOQA
clpy/core/carray.pxi:14: in init clpy.core.core
???
E AttributeError: type object 'clpy.core.core.Indexer' has no attribute '__reduce_cython__'
__ ERROR collecting tests/clpy_tests/core_tests/test_cupy_aliased_ndarray.py ___
test_cupy_aliased_ndarray.py:6: in <module>
import clpy # NOQA
../../../clpy/__init__.py:17: in <module>
from clpy import core # NOQA
../../../clpy/core/__init__.py:1: in <module>
from clpy.core import core # NOQA
clpy/core/carray.pxi:14: in init clpy.core.core
???
E AttributeError: type object 'clpy.core.core.Indexer' has no attribute '__reduce_cython__'
_______ ERROR collecting tests/clpy_tests/core_tests/test_elementwise.py _______
test_elementwise.py:6: in <module>
import clpy
../../../clpy/__init__.py:17: in <module>
from clpy import core # NOQA
../../../clpy/core/__init__.py:1: in <module>
from clpy.core import core # NOQA
clpy/core/carray.pxi:14: in init clpy.core.core
... and more 1221 lines
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.
Test (commit 99d45fe) failed in vega.
============================= test session starts ==============================
platform linux -- Python 3.6.5, pytest-4.3.0, py-1.8.0, pluggy-0.13.0
rootdir: /home/clpy-jenkins-slave/workspace/clpy_testing_vega, inifile: setup.cfg
collected 0 items / 23 errors
==================================== ERRORS ====================================
_________ ERROR collecting tests/clpy_tests/core_tests/test_carray.py __________
test_carray.py:3: in <module>
import clpy
../../../clpy/__init__.py:17: in <module>
from clpy import core # NOQA
../../../clpy/core/__init__.py:1: in <module>
from clpy.core import core # NOQA
clpy/backend/function.pxd:4: in init clpy.core.core
???
../../../clpy/backend/__init__.py:3: in <module>
from clpy.backend import compiler # NOQA
clpy/backend/function.pxd:4: in init clpy.backend.compiler
???
clpy/backend/function.pyx:38: in init clpy.backend.function
???
E AttributeError: module 'clpy' has no attribute 'core'
__________ ERROR collecting tests/clpy_tests/core_tests/test_core.py ___________
test_core.py:3: in <module>
import clpy
../../../clpy/__init__.py:17: in <module>
from clpy import core # NOQA
../../../clpy/core/__init__.py:1: in <module>
from clpy.core import core # NOQA
clpy/core/carray.pxi:14: in init clpy.core.core
???
E AttributeError: type object 'clpy.core.core.Indexer' has no attribute '__reduce_cython__'
__ ERROR collecting tests/clpy_tests/core_tests/test_cupy_aliased_ndarray.py ___
test_cupy_aliased_ndarray.py:6: in <module>
import clpy # NOQA
../../../clpy/__init__.py:17: in <module>
from clpy import core # NOQA
../../../clpy/core/__init__.py:1: in <module>
from clpy.core import core # NOQA
clpy/core/carray.pxi:14: in init clpy.core.core
???
E AttributeError: type object 'clpy.core.core.Indexer' has no attribute '__reduce_cython__'
_______ ERROR collecting tests/clpy_tests/core_tests/test_elementwise.py _______
test_elementwise.py:6: in <module>
import clpy
../../../clpy/__init__.py:17: in <module>
from clpy import core # NOQA
../../../clpy/core/__init__.py:1: in <module>
from clpy.core import core # NOQA
clpy/core/carray.pxi:14: in init clpy.core.core
... and more 1221 lines
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.
Test (commit 2e2f173) passed in titanv.
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.
Test (commit 2e2f173) passed in vega.
@LWisteria I appreciate your review. |
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.
Test (commit 53c1d5f) passed in vega.
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.
Test (commit 53c1d5f) passed in titanv.
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.
LGTM
@ybsh Can you report how the performance is improveed by this PR? I will merge after the report. |
I ran again
The configuration is the same as shown in this report. The execution times (in seconds) are as follows.
These figures look slower overall compared to the report and I have not found the definitive cause with a quick investigation. Still, this is enough to show the modified ClPy runs faster. |
@LWisteria Please check my new report. |
@ybsh Thank you for your report! This PR makes the difference from CuPy less than a half. Nice work! |
Thank you for merging. |
I have replaced two heavy numpy function calls with lighter operations.
This reduced the
train_mnist.py
runtime by 20% (with the configuration shown here, noprof-nosync).I have checked that
clpy/tests/example_tests/test_gemm.py
has passed.