-
Notifications
You must be signed in to change notification settings - Fork 585
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework Python driver/device creation.
APIs removed: * HalDriver.create() (use iree.runtime.get_driver(driver_name) to get a cached instance). * Environment variable IREE_DEFAULT_DRIVER renamed to IREE_DEFAULT_DEVICE to better reflect the new syntax. * Config.driver attribute (no longer captured by this class) APIs added: * iree.runtime.query_available_drivers() (alias of HalDriver.query()) * iree.runtime.get_driver(driver_name) * iree.runtime.get_device_by_name(name_spec) * iree.runtime.get_first_device_by_name(name_specs) * iree.runtime.Config(, device: HalDevice) (to configure with an explicit device) * HalDriver.create_device(device_id: Union[int, tuple]) * HalDriver.query_available_devices() Devices can now be queried/constructed explicitly using HalDriver.query_available_devices() and passing found device_ids to HalDriver.create_device. Default configuration is extended to take "name specs" instead of driver name. This can either be a raw driver name (i.e. "vmvx") but can also be driver:index (i.e. "vulkan:3"). Some logging is added to make it clearer what was selected. Devices created in this way are cached now, since this facility is meant to be used for trivial/default configuration. If explicitly creating devices, the user is on their own to cache as desired. Fixes #9277
- Loading branch information
Stella Laurenzo
committed
Jun 4, 2022
1 parent
a30c840
commit a55003d
Showing
11 changed files
with
328 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.