-
Notifications
You must be signed in to change notification settings - Fork 584
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. (#9330)
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(device_uri) * iree.runtime.get_device(device_uri) * iree.runtime.get_first_device(device_uris) * iree.runtime.Config(, device: HalDevice) (to configure with an explicit device) * HalDriver.create_device(device_id: Union[int, tuple]) * HalDriver.query_available_devices() * HalDriver.create_device_by_uri(device_uri: str) Both driver and device lookup is done by a device URI, as defined by the runtime (when creating a driver, only the 'scheme' is used). Driver instances are cached by name in the native code, which should avoid various bad behavior in terms of driver lifetimes and lack of care to process state. Devices are optionally (default True) cached at the Python level. Fixes #9277 Expected to fix #9936
- Loading branch information
Stella Laurenzo
authored
Jul 29, 2022
1 parent
3326029
commit 3813758
Showing
16 changed files
with
394 additions
and
92 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,5 @@ | |
import sys | ||
|
||
from iree import _runtime | ||
|
||
sys.modules[__name__] = _runtime |
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.