tensil-ai / tensil

Open source machine learning accelerators
https://www.tensil.ai
Other
348 stars 28 forks source link

Drivers to support preloading consts to local #77

Closed petrohi closed 1 year ago

petrohi commented 1 year ago

This PR introduces driver support for models compiled with local-consts and local-vars-and-consts strategies. These models expect Consts to be preloaded in local memory before the program is ran. For these models the compiler will set load_consts_to_local flag to true in .tmodel JSON. When the driver is loading the model it will check if the flag is set to true and then will run a small program to load entire Consts .tdata file to local memory.

This PR, additionally, changes the way drivers do the probe to check for program completion. Previously, the probe was using local memory at offset 0 to pass the probe. If Consts are preloaded this will corrupt them. The drivers will use local_depth - 1 offset instead.

shortcut-integration[bot] commented 1 year ago

This pull request has been linked to Shortcut Story #475: Drivers to support preloading consts to local.