Skip to content

Exposing/implementing the HAL driver registry via the C API. - #3937

Merged
ScottTodd merged 1 commit into
mainfrom
benvanik-driver-registry
Dec 2, 2020
Merged

ScottTodd merged 1 commit into
mainfrom
benvanik-driver-registry

Conversation

@benvanik

@benvanik benvanik commented Nov 20, 2020 •

Copy link
Copy Markdown
Collaborator

Enables drivers to be provided externally by callers and discovered/loaded dynamically. Zero cost when applications explicitly create their own drivers directly (LTO stripped).

Example use cases are compiling LLVM JIT in its own dylib, remote/sandboxed drivers enumerated based on availability, driver multiversioning, and out-of-tree drivers from downstream projects. Hooray for having a story that will prevent us from ever needing to link CUDA into our binaries ;)

This also let me clean up some of the duplication that had crept in with multiple places all doing driver querying/filtering/etc (and sometimes in slightly different ways). It's intentional that we don't have a non-test utility for that, as non-test targets should not be trying to create all drivers and ignoring any of the metadata the driver registry is now able to provide.

@google-cla google-cla Bot added the cla: yes label Nov 20, 2020
@benvanik benvanik added the runtime Relating to the IREE runtime library label Nov 20, 2020
@benvanik benvanik added this to the 2020Q4 Core milestone Nov 20, 2020
@benvanik
benvanik force-pushed the benvanik-driver-registry branch 4 times, most recently from 9487e50 to 2106f4f Compare November 20, 2020 09:13
@benvanik benvanik added the runtime/api IREE's public C runtime API and iree-run-module label Nov 20, 2020
@benvanik
benvanik marked this pull request as ready for review November 20, 2020 09:24
@benvanik
benvanik requested a review from ScottTodd November 20, 2020 09:25
@benvanik
benvanik force-pushed the benvanik-hack-and-slash branch 2 times, most recently from 855884c to 7b8e9f7 Compare November 21, 2020 01:38
Base automatically changed from benvanik-hack-and-slash to main November 21, 2020 02:10
@benvanik
benvanik requested a review from KoolJBlack November 21, 2020 02:59
@benvanik
benvanik force-pushed the benvanik-driver-registry branch from 2106f4f to b1bfbc7 Compare November 21, 2020 03:00
@benvanik

Copy link
Copy Markdown
Collaborator Author

@KoolJBlack scott mentioned you may be looking at HAL+android stuff soon - this is probably going to be very useful for you :) Happy to gvc and walk through this if you have questions (about this or the HAL API in general).

Enables drivers to be provided externally by callers and
discovered/loaded dynamically. Zero cost when applications
explicitly create their own drivers directly (LTO stripped).

Example use cases are compiling LLVM JIT in its own dylib,
remote/sandboxed drivers enumerated based on availability,
driver multiversioning, and out-of-tree drivers from
downstream projects.
@benvanik
benvanik force-pushed the benvanik-driver-registry branch from b1bfbc7 to 0e7dfa0 Compare November 22, 2020 06:52
Comment thread iree/hal/drivers/init.h Resolved
Comment thread iree/hal/api.h Resolved
Comment thread iree/hal/api.c Resolved
@benvanik
benvanik requested a review from ScottTodd December 1, 2020 18:22
Comment thread iree/hal/api.h Resolved

@KoolJBlack KoolJBlack left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've looked through this. Would like to have more discussion with Ben, but it looks good.

Thanks.

@ScottTodd
ScottTodd merged commit aaeebf4 into main Dec 2, 2020
@ScottTodd
ScottTodd deleted the benvanik-driver-registry branch December 2, 2020 17:41
This was referenced Dec 2, 2020
@ScottTodd ScottTodd mentioned this pull request Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

runtime/api IREE's public C runtime API and iree-run-module runtime Relating to the IREE runtime library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants