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

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

Merged
merged 1 commit into from
Dec 2, 2020

Conversation

benvanik
Copy link
Collaborator

@benvanik benvanik commented Nov 20, 2020

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 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
Copy link
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.
iree/hal/drivers/init.h Show resolved Hide resolved
iree/hal/api.h Show resolved Hide resolved
iree/hal/api.c Show resolved Hide resolved
iree/hal/api.h Show resolved Hide resolved
Copy link
Contributor

@KoolJBlack KoolJBlack left a comment

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
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