larroy commented on issue #17097: [RFC][mxnet 2.0][item 10.1] MXNet Imperative 
Op Invocation Overhead
URL: 
https://github.com/apache/incubator-mxnet/issues/17097#issuecomment-569135990
 
 
   Pybind is nice, I used Boost python many years ago, which I think is based
   on. The problem with this is the hourglass C bindings, you have to go from
   Python to C++ / Pybind, down to C and to the engine, this seems like a lot
   of boilerplate.
   
   On Mon, Dec 16, 2019 at 10:02 PM reminisce <[email protected]> wrote:
   
   > MXNet imperative operator invocation overhead is as large as 30-60us,
   > which is significant compared to the official NumPy operators with ~600ns
   > overhead. This has negatively impacted the performance of applying MXNet to
   > the models where many operators' kernel runtime duration is short,
   > especially in the area of classic machine learning. We plan to address the
   > problem in two steps:
   >
   >    1.
   >
   >    Short term: Use pybind11 to replace Python op API and ctypes/c api.
   >    Preliminary experiments show that the pure Python-C++ turnaround time by
   >    using Pybind is between 400-600ns, while the current Python op API using
   >    ctypes/c api costs more than 10us. We believe with the correct
   >    implementation, we can reduce the op invocation overhead to 2us 
including
   >    the time on FFI and engine.
   >    2.
   >
   >    Long term: Adopt Python's C extension interface. NumPy did this by
   >    developing its own C API. This provides considerably less overhead 
compared
   >    to other solutions. However, it would cost much more engineering 
efforts by
   >    integrating this with our existing operator workflow in C++.
   >
   > @hzfan <https://github.com/hzfan> @hgt312 <https://github.com/hgt312>
   >
   > —
   > You are receiving this because you are subscribed to this thread.
   > Reply to this email directly, view it on GitHub
   > 
<https://github.com/apache/incubator-mxnet/issues/17097?email_source=notifications&email_token=AAHCV2KR5Z4L2T62UJCEVPTQZBTOZA5CNFSM4J3WHPZ2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IA6JXSA>,
   > or unsubscribe
   > 
<https://github.com/notifications/unsubscribe-auth/AAHCV2J7KYUKKTFZTKN6TB3QZBTOZANCNFSM4J3WHPZQ>
   > .
   >
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to