Skip to content
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

WIP: Distributed infrastructure and algorithms #644

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from

Conversation

jszuppe
Copy link
Contributor

@jszuppe jszuppe commented Aug 16, 2016

This is a "beta" version of distributed work infrastructure: distributed::context, distributed::command_queue, distributed::vector. I'm open to comments and suggestions.

The idea is pretty simple: distributed::context is a wrapper for many OpenCL contexts, distributed::command_queue - for many OpenCL command queues, and distributed::vector is a container that allocates memory across many devices according to certain weight function.

@jszuppe
Copy link
Contributor Author

jszuppe commented Aug 17, 2016

I think about removing blocking argument from distributed::vector ctors and methods and instead use boost::optional for an optional reference to a wait_list object, but that would add additional dependency. Maybe I'll just remove it for first release and later think about this.

I also think I'll remove the queue from distributed::vector. Then I'll also have to change some of its constructors so they don't accept distributed::context but distributed::command_queue (empty ctor and ctor creating vector with count copies of some value).

It's turned out that having queue in distributed::vector may be very problematic... Most methods of boost::compute::command_queue are not const, so distributed::vector would need to have a non-const method that returns reference its distributed queue

@jszuppe
Copy link
Contributor Author

jszuppe commented Aug 22, 2016

I added distributed::copy() algorithm with tests. For now distributed::copy() has many different lists of arguments depending on what your copying and in which way. After I introduce distributed_iterator(), it will be slightly simpler.

@jszuppe
Copy link
Contributor Author

jszuppe commented Aug 22, 2016

Also, there are commits which are present in #648, but I'll remove them before this pull request is ready to be merged. @kylelutz any comments on the code?

@jszuppe
Copy link
Contributor Author

jszuppe commented Aug 22, 2016

In copy_async() I can't use wait_list since it does not support event from different contexts. For example wait() method does not work properly when wait_list contains events from different contexts, which can happen using distributed::vector.

In 2nd half of September I will introduce changes to wait_list so it force user to store only events from the same OpenCL context, and maybe make new class for wrapping many events from different contexts (based on future or wait_list).

Method safe_insert() adds event to wait_list only if
that event is not an empty event.
@jszuppe jszuppe changed the title Distributed work infrastructure (context, queue, vector) Distributed infrastructure and algorithms Aug 26, 2016
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 0601a35 on haahh:pr_distributed into * on boostorg:develop*.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 0601a35 on haahh:pr_distributed into * on boostorg:develop*.

@jszuppe
Copy link
Contributor Author

jszuppe commented Aug 28, 2016

distributed::transform() should have good performance, it's indirectly influenced by the weight function (currently all weights are equal, I will later add weight function based on device performance) since it waits for the slowest device.

distributed::reduce() should have good performance when all used devices (queues) are in the same context, but I have an idea how to make it works with the same speed in other cases.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 56fb881 on haahh:pr_distributed into * on boostorg:develop*.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 43c31b3 on haahh:pr_distributed into * on boostorg:develop*.

@jszuppe jszuppe changed the title Distributed infrastructure and algorithms WIP: Distributed infrastructure and algorithms Apr 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants