-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add overload for runtime::init/distr_queue ctor that accepts a device selector #113
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.
Looks quite promising, however I have some remarks and questions.
cb0b74e
to
782deb4
Compare
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.
Looks good to me, I just found one minor detail which should be changed to be in-line with previous changes:
782deb4
to
a8f0237
Compare
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.
Thanks, I've added some notes!
a8f0237
to
5d116fd
Compare
As already mentioned offline, while doing another review of this PR I noticed several opportunities for streamlining the tests, as well as some brittle constructs and redundant test cases. As it would've taken me about the same time to write these things down as to actually implement them, I chose the latter approach. In total I was able to remove about 180 lines of code. Semi-complete changelog:
|
55dc365
to
e9514d4
Compare
e9514d4
to
b081340
Compare
b081340
to
e9514d4
Compare
This feature adds the option to pass a device selector to the
distr_queue
, according to which devices get selected. Previously, asycl::device
could be passed (now deprecated). The device or the selector is then passed to thedevice_queue.h/pick_device
function, which accepts a variant for either automatic device selection or the device selector or thesycl::device
itself.The
pick_device
function has in total 4 branches in which a device can be selected. The first one is choosing the providedsycl::device
, the second one is, choosing the device with theCELERITY_DEVICES
environment variable. If in case none of those two options are taken, we then have another branch that either chooses the device automatically or uses the selector to choose the device.The logic for automatic device selection:
try_find_device_per_node
function takes in the type of device which should be selected and checks if any platform has enough devices of the same type to assign a unique device to each local node.The automatic selection first checks for all the unique devices to be GPUs, if not, it checks for any type of enough devices.
try_find_one_device
.The logic for device selection with the selector:
The same two functions as above are called, however, the type of device doesn't matter here.
try_find_device_per_node
all the devices are collected and are sorted using the device selector. If enough devices of the same type belong to one platform, they are selected.try_find_one_device
, all the devices are collected and sorted and the device with the highest score is selected.-1
is excluded from the selection.In case, no device gets selected according to the selector, the selection does not fall back to any random device.