Summary: In multi-threaded applications where we have multiple inferences on the same model in parallel (consider e.g. a TTS system handling multiple requests), it can be useful to share the parameters of a model amongst these multiple instances. This improves the cache utilization behaviour of the system, as multiple cores can use the same set of weights instead of evicting the identical copies of weights in a shared cache. As the underlying `NDArray` instances in `data_entry_` implement a ref-counted based sharing system, this is a simple modification of the `GraphRuntime::LoadParams` logic to instead copy parameters from an existing GraphRuntime instance. This is a little ugly in that we need both the pre-existing GraphRuntime instance, as well as the 'serialized' params (since we need to know the set of names we should copy), but without imposing additional assumptions (i.e. storing the set of param names in GraphRuntime, and enforcing that shared param names are identical to the parameters set in the preceding `LoadParams` call), this seems unavoidable. Test Plan: Unit test added.
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
debugger | Loading commit data... | |
__init__.py | Loading commit data... | |
cblas.py | Loading commit data... | |
cc.py | Loading commit data... | |
clang.py | Loading commit data... | |
cublas.py | Loading commit data... | |
cudnn.py | Loading commit data... | |
dlpack.py | Loading commit data... | |
download.py | Loading commit data... | |
emscripten.py | Loading commit data... | |
graph_runtime.py | Loading commit data... | |
miopen.py | Loading commit data... | |
mps.py | Loading commit data... | |
mxnet.py | Loading commit data... | |
ndk.py | Loading commit data... | |
nnpack.py | Loading commit data... | |
nvcc.py | Loading commit data... | |
peak.py | Loading commit data... | |
pickle_memoize.py | Loading commit data... | |
random.py | Loading commit data... | |
rocblas.py | Loading commit data... | |
rocm.py | Loading commit data... | |
rpc.py | Loading commit data... | |
sdaccel.py | Loading commit data... | |
sparse.py | Loading commit data... | |
spirv.py | Loading commit data... | |
tar.py | Loading commit data... | |
util.py | Loading commit data... | |
verilog.py | Loading commit data... | |
xcode.py | Loading commit data... |