[mlpack] Introduction of ExecutionPolicy

Shikhar Bhardwaj shikharbhardwaj68 at gmail.com
Tue May 16 11:22:44 EDT 2017


Hello everyone,

Yannis and I were discussing about the introduction of an
ExecutionPolicy policy parameter in algorithms implemented by mlpack
to provide parallel overloads of the algorithms as template
specializations.

This approach is a bit similar to C++'s planned support for
"Extensions of Parallelism"
<http://en.cppreference.com/w/cpp/experimental/parallelism>,
describing 3 types of execution policies and overloads of various std
algorithms with these execution policies.

In addition to describing the type of execution(parallel/sequential
etc), this parameter can also be used to describe other
characteristics of the execution, the number of threads used during
the execution being an example.

A rough demo of how the interface would look from the user's
perspective is here.
<https://gist.github.com/shikharbhardwaj/ff7e35ae7085881588f3ca254ce887ac>

We wanted to have further discussion about this design. A few existing
issues include the current interface, which is quite crude. For
example, we need to hardcode the value of the number of threads in the
parallel execution policy, instead of taking it directly from
somewhere like std::thread::hardware_concurrency.

Would this design be a good one?

Any thoughts?

Thanks

-- 
Shikhar Bhardwaj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://knife.lugatgt.org/pipermail/mlpack/attachments/20170516/bde11b81/attachment.html>


More information about the mlpack mailing list