You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mxnet.apache.org by Anton Chernov <me...@gmail.com> on 2018/03/14 18:07:49 UTC

MXNet C++ package improvements

Dear MxNet Community,

please find here
<https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=75976112> the
design document for the proposed MXNet C++ package improvements for review
and consideration.

Feedback is welcome and highly appreciated. Thank you!

BR
Anton

Re: MXNet C++ package improvements

Posted by Pedro Larroy <pe...@gmail.com>.
About MinGW, most windows users will use our binary versions which we can
compile with the supported platform tool by Microsoft which is visual
studio. Do we have data on how many people is using MinGW? We can't support
every possible toolchain available. I'm not sure the GNU tools for windows
such as MinGW are really something that is used in production, I always
thought they were quite hacky and limited, but maybe I'm wrong.

On Mon, Mar 26, 2018 at 1:47 PM, Pedro Larroy <pe...@gmail.com>
wrote:

> Thank you for your feedback and comments on the document. Seems we have to
> iterate more.
> I want to point out that using the pimpl idiom we wouldn't have the
> problem of breaking backward compatibility, since the internal C++ API is
> not really exposed.
>
> Only the public facing one of the pimpl facade which calls the internal
> C++ API on the private implementation. (That's the whole point of PIMPL, to
> hide the implementation and provide binary compatibility on top as it's
> done in many commercial libraries like QT).  It would provide the same
> benefit as the  hour glass design. Why are you so keen on keeping the C
> interface then?
>
>
> Pedro.
>
>
> On Fri, Mar 23, 2018 at 8:21 PM, Tianqi Chen <tq...@cs.washington.edu>
> wrote:
>
>> One quote that I really liked and related to this topic “the best design
>> is
>> achieved not when you have nothing to add, but when there is nothing to be
>> taken away”.
>>
>> Most of the stable api decision we put into a project will become a
>> technical debt, and a minimum clean design with equally powerful api adds
>> more value than a bigger one
>> On Fri, Mar 23, 2018 at 12:11 PM Tianqi Chen <tq...@cs.washington.edu>
>> wrote:
>>
>> > +1 for hour-glass CAPI design. It is there for very good reason. For
>> > example, if you are windows user an want to build your app using mingw,
>> > current way works. While the raw c++ approach won’t due to the fact
>> cuda is
>> > only supported by MSVC.
>> >
>> > The argument that c++ api itself is more elegant and fast is not
>> > necessarily valid. Always remember Amdahl’s Law, the additional overhead
>> > saved by directly using are not the bottleneck.
>> >
>> > The effectiveness of core engine, on the other hand will be on the
>> > critical path, and we rely on constantly improving this which can mean
>> > break backward compatibility if C++ api layer is exposed
>> >
>> > Tianqi
>> >
>> >
>> > On Fri, Mar 23, 2018 at 11:45 AM Eric Xie <jx...@apache.org> wrote:
>> >
>> >> I see several issues with the design. I've commented in the document
>> but
>> >> for record here:
>> >>
>> >> 1. cpp-package is almost only used for inference. since you are
>> planning
>> >> a rewrite that's almost certainly non-backward-compatible, we might as
>> well
>> >> create a new interface that's inference only.
>> >>
>> >> 2. The hour-glass CAPI design should be kept.
>> >>
>> >> On 2018/03/14 18:07:49, Anton Chernov <me...@gmail.com> wrote:
>> >> > Dear MxNet Community,
>> >> >
>> >> > please find here
>> >> > <
>> >> https://cwiki.apache.org/confluence/pages/viewpage.action?
>> pageId=75976112>
>> >> the
>> >> > design document for the proposed MXNet C++ package improvements for
>> >> review
>> >> > and consideration.
>> >> >
>> >> > Feedback is welcome and highly appreciated. Thank you!
>> >> >
>> >> > BR
>> >> > Anton
>> >> >
>> >>
>> >
>>
>
>

Re: MXNet C++ package improvements

Posted by Pedro Larroy <pe...@gmail.com>.
Thank you for your feedback and comments on the document. Seems we have to
iterate more.
I want to point out that using the pimpl idiom we wouldn't have the problem
of breaking backward compatibility, since the internal C++ API is not
really exposed.

Only the public facing one of the pimpl facade which calls the internal C++
API on the private implementation. (That's the whole point of PIMPL, to
hide the implementation and provide binary compatibility on top as it's
done in many commercial libraries like QT).  It would provide the same
benefit as the  hour glass design. Why are you so keen on keeping the C
interface then?


Pedro.


On Fri, Mar 23, 2018 at 8:21 PM, Tianqi Chen <tq...@cs.washington.edu>
wrote:

> One quote that I really liked and related to this topic “the best design is
> achieved not when you have nothing to add, but when there is nothing to be
> taken away”.
>
> Most of the stable api decision we put into a project will become a
> technical debt, and a minimum clean design with equally powerful api adds
> more value than a bigger one
> On Fri, Mar 23, 2018 at 12:11 PM Tianqi Chen <tq...@cs.washington.edu>
> wrote:
>
> > +1 for hour-glass CAPI design. It is there for very good reason. For
> > example, if you are windows user an want to build your app using mingw,
> > current way works. While the raw c++ approach won’t due to the fact cuda
> is
> > only supported by MSVC.
> >
> > The argument that c++ api itself is more elegant and fast is not
> > necessarily valid. Always remember Amdahl’s Law, the additional overhead
> > saved by directly using are not the bottleneck.
> >
> > The effectiveness of core engine, on the other hand will be on the
> > critical path, and we rely on constantly improving this which can mean
> > break backward compatibility if C++ api layer is exposed
> >
> > Tianqi
> >
> >
> > On Fri, Mar 23, 2018 at 11:45 AM Eric Xie <jx...@apache.org> wrote:
> >
> >> I see several issues with the design. I've commented in the document but
> >> for record here:
> >>
> >> 1. cpp-package is almost only used for inference. since you are planning
> >> a rewrite that's almost certainly non-backward-compatible, we might as
> well
> >> create a new interface that's inference only.
> >>
> >> 2. The hour-glass CAPI design should be kept.
> >>
> >> On 2018/03/14 18:07:49, Anton Chernov <me...@gmail.com> wrote:
> >> > Dear MxNet Community,
> >> >
> >> > please find here
> >> > <
> >> https://cwiki.apache.org/confluence/pages/viewpage.
> action?pageId=75976112>
> >> the
> >> > design document for the proposed MXNet C++ package improvements for
> >> review
> >> > and consideration.
> >> >
> >> > Feedback is welcome and highly appreciated. Thank you!
> >> >
> >> > BR
> >> > Anton
> >> >
> >>
> >
>

Re: MXNet C++ package improvements

Posted by Tianqi Chen <tq...@cs.washington.edu>.
One quote that I really liked and related to this topic “the best design is
achieved not when you have nothing to add, but when there is nothing to be
taken away”.

Most of the stable api decision we put into a project will become a
technical debt, and a minimum clean design with equally powerful api adds
more value than a bigger one
On Fri, Mar 23, 2018 at 12:11 PM Tianqi Chen <tq...@cs.washington.edu>
wrote:

> +1 for hour-glass CAPI design. It is there for very good reason. For
> example, if you are windows user an want to build your app using mingw,
> current way works. While the raw c++ approach won’t due to the fact cuda is
> only supported by MSVC.
>
> The argument that c++ api itself is more elegant and fast is not
> necessarily valid. Always remember Amdahl’s Law, the additional overhead
> saved by directly using are not the bottleneck.
>
> The effectiveness of core engine, on the other hand will be on the
> critical path, and we rely on constantly improving this which can mean
> break backward compatibility if C++ api layer is exposed
>
> Tianqi
>
>
> On Fri, Mar 23, 2018 at 11:45 AM Eric Xie <jx...@apache.org> wrote:
>
>> I see several issues with the design. I've commented in the document but
>> for record here:
>>
>> 1. cpp-package is almost only used for inference. since you are planning
>> a rewrite that's almost certainly non-backward-compatible, we might as well
>> create a new interface that's inference only.
>>
>> 2. The hour-glass CAPI design should be kept.
>>
>> On 2018/03/14 18:07:49, Anton Chernov <me...@gmail.com> wrote:
>> > Dear MxNet Community,
>> >
>> > please find here
>> > <
>> https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=75976112>
>> the
>> > design document for the proposed MXNet C++ package improvements for
>> review
>> > and consideration.
>> >
>> > Feedback is welcome and highly appreciated. Thank you!
>> >
>> > BR
>> > Anton
>> >
>>
>

Re: MXNet C++ package improvements

Posted by Tianqi Chen <tq...@cs.washington.edu>.
+1 for hour-glass CAPI design. It is there for very good reason. For
example, if you are windows user an want to build your app using mingw,
current way works. While the raw c++ approach won’t due to the fact cuda is
only supported by MSVC.

The argument that c++ api itself is more elegant and fast is not
necessarily valid. Always remember Amdahl’s Law, the additional overhead
saved by directly using are not the bottleneck.

The effectiveness of core engine, on the other hand will be on the critical
path, and we rely on constantly improving this which can mean break
backward compatibility if C++ api layer is exposed

Tianqi


On Fri, Mar 23, 2018 at 11:45 AM Eric Xie <jx...@apache.org> wrote:

> I see several issues with the design. I've commented in the document but
> for record here:
>
> 1. cpp-package is almost only used for inference. since you are planning a
> rewrite that's almost certainly non-backward-compatible, we might as well
> create a new interface that's inference only.
>
> 2. The hour-glass CAPI design should be kept.
>
> On 2018/03/14 18:07:49, Anton Chernov <me...@gmail.com> wrote:
> > Dear MxNet Community,
> >
> > please find here
> > <
> https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=75976112>
> the
> > design document for the proposed MXNet C++ package improvements for
> review
> > and consideration.
> >
> > Feedback is welcome and highly appreciated. Thank you!
> >
> > BR
> > Anton
> >
>

Re: MXNet C++ package improvements

Posted by Eric Xie <jx...@apache.org>.
I see several issues with the design. I've commented in the document but for record here:

1. cpp-package is almost only used for inference. since you are planning a rewrite that's almost certainly non-backward-compatible, we might as well create a new interface that's inference only.

2. The hour-glass CAPI design should be kept.

On 2018/03/14 18:07:49, Anton Chernov <me...@gmail.com> wrote: 
> Dear MxNet Community,
> 
> please find here
> <https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=75976112> the
> design document for the proposed MXNet C++ package improvements for review
> and consideration.
> 
> Feedback is welcome and highly appreciated. Thank you!
> 
> BR
> Anton
> 

Re: MXNet C++ package improvements

Posted by Anton Chernov <me...@gmail.com>.
The document has been synced to JIRA
<https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=75976112>.

2018-03-15 17:51 GMT+01:00 Anton Chernov <me...@gmail.com>:

> I've improved the document based on recent comments, please have another
> look. What has been changed so far:
>
> * Fixed unclear formulations
> * Added details about the current state of the library and why is it
> complicated to use
> * Improved the explanation of the piml idiom and provided a code example
> * Added thread safety requirements
>
> Thanks @chris and @naveen for your reviewing efforts!
>
>
> 2018-03-14 21:44 GMT+01:00 Anton Chernov <me...@gmail.com>:
>
>> Sure, here we go:
>> https://docs.google.com/document/d/1Xi0aU9Nks7-GcsJIfcXoEpgP
>> eYnSiEtBpJlhZvMaIb8/edit?usp=sharing
>>
>>
>> 2018-03-14 19:15 GMT+01:00 Chris Olivier <cj...@gmail.com>:
>>
>>> Can you put that on google docs so that it can be commented/edited?
>>>
>>> On Wed, Mar 14, 2018 at 11:07 AM, Anton Chernov <me...@gmail.com>
>>> wrote:
>>>
>>> > Dear MxNet Community,
>>> >
>>> > please find here
>>> > <https://cwiki.apache.org/confluence/pages/viewpage.action?p
>>> ageId=75976112>
>>> > the
>>> > design document for the proposed MXNet C++ package improvements for
>>> review
>>> > and consideration.
>>> >
>>> > Feedback is welcome and highly appreciated. Thank you!
>>> >
>>> > BR
>>> > Anton
>>> >
>>>
>>
>>
>

Re: MXNet C++ package improvements

Posted by Anton Chernov <me...@gmail.com>.
 I've improved the document based on recent comments, please have another
look. What has been changed so far:

* Fixed unclear formulations
* Added details about the current state of the library and why is it
complicated to use
* Improved the explanation of the piml idiom and provided a code example
* Added thread safety requirements

Thanks @chris and @naveen for your reviewing efforts!


2018-03-14 21:44 GMT+01:00 Anton Chernov <me...@gmail.com>:

> Sure, here we go:
> https://docs.google.com/document/d/1Xi0aU9Nks7-
> GcsJIfcXoEpgPeYnSiEtBpJlhZvMaIb8/edit?usp=sharing
>
>
> 2018-03-14 19:15 GMT+01:00 Chris Olivier <cj...@gmail.com>:
>
>> Can you put that on google docs so that it can be commented/edited?
>>
>> On Wed, Mar 14, 2018 at 11:07 AM, Anton Chernov <me...@gmail.com>
>> wrote:
>>
>> > Dear MxNet Community,
>> >
>> > please find here
>> > <https://cwiki.apache.org/confluence/pages/viewpage.action?
>> pageId=75976112>
>> > the
>> > design document for the proposed MXNet C++ package improvements for
>> review
>> > and consideration.
>> >
>> > Feedback is welcome and highly appreciated. Thank you!
>> >
>> > BR
>> > Anton
>> >
>>
>
>

Re: MXNet C++ package improvements

Posted by Anton Chernov <me...@gmail.com>.
Sure, here we go:
https://docs.google.com/document/d/1Xi0aU9Nks7-GcsJIfcXoEpgPeYnSiEtBpJlhZvMaIb8/edit?usp=sharing


2018-03-14 19:15 GMT+01:00 Chris Olivier <cj...@gmail.com>:

> Can you put that on google docs so that it can be commented/edited?
>
> On Wed, Mar 14, 2018 at 11:07 AM, Anton Chernov <me...@gmail.com>
> wrote:
>
> > Dear MxNet Community,
> >
> > please find here
> > <https://cwiki.apache.org/confluence/pages/viewpage.
> action?pageId=75976112>
> > the
> > design document for the proposed MXNet C++ package improvements for
> review
> > and consideration.
> >
> > Feedback is welcome and highly appreciated. Thank you!
> >
> > BR
> > Anton
> >
>

Re: MXNet C++ package improvements

Posted by Chris Olivier <cj...@gmail.com>.
Can you put that on google docs so that it can be commented/edited?

On Wed, Mar 14, 2018 at 11:07 AM, Anton Chernov <me...@gmail.com> wrote:

> Dear MxNet Community,
>
> please find here
> <https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=75976112>
> the
> design document for the proposed MXNet C++ package improvements for review
> and consideration.
>
> Feedback is welcome and highly appreciated. Thank you!
>
> BR
> Anton
>