Hash a model's bytes once, at open, not on every acquire
A border fill acquires the filler once a tile, and each acquire hashed the 28 MB model twice — 60 ms a tile, a third of the tile's run on a throttled TensorRT. The Model keeps its hash from open.
This commit is contained in:
@@ -29,7 +29,12 @@ pub fn hash(bytes: &[u8]) -> u64 {
|
||||
|
||||
/// The cache entry for `bytes` compiled on `rung`.
|
||||
pub fn key(rung: Rung, bytes: &[u8]) -> String {
|
||||
format!("{}:{:016x}", rung.label(), hash(bytes))
|
||||
key_of(rung, hash(bytes))
|
||||
}
|
||||
|
||||
/// The same, from a hash already taken.
|
||||
pub fn key_of(rung: Rung, hash: u64) -> String {
|
||||
format!("{}:{:016x}", rung.label(), hash)
|
||||
}
|
||||
|
||||
/// Where QNN's compiled context for `bytes` lives.
|
||||
|
||||
Reference in New Issue
Block a user