mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 08:14:00 +08:00
onnxruntime: initialize CUDA provider before predictions (#24330)
* initialize CUDA runtime before predictions * dmond pauses modeld execution... * done in other PR old-commit-hash: 60b7114024181f79819c9a8b14863a8f23fb0252
This commit is contained in:
@@ -25,6 +25,11 @@ def write(d):
|
||||
def run_loop(m):
|
||||
ishapes = [[1]+ii.shape[1:] for ii in m.get_inputs()]
|
||||
keys = [x.name for x in m.get_inputs()]
|
||||
|
||||
# run once to initialize CUDA provider
|
||||
if "CUDAExecutionProvider" in m.get_providers():
|
||||
m.run(None, dict(zip(keys, [np.zeros(shp, dtype=np.float32) for shp in ishapes])))
|
||||
|
||||
print("ready to run onnx model", keys, ishapes, file=sys.stderr)
|
||||
while 1:
|
||||
inputs = []
|
||||
|
||||
@@ -224,6 +224,11 @@ def regen_segment(lr, frs=None, outdir=FAKEDATA):
|
||||
}
|
||||
|
||||
try:
|
||||
# TODO: make first run of onnxruntime CUDA provider fast
|
||||
managed_processes["modeld"].start()
|
||||
managed_processes["dmonitoringmodeld"].start()
|
||||
time.sleep(5)
|
||||
|
||||
# start procs up
|
||||
ignore = list(fake_daemons.keys()) + ['ui', 'manage_athenad', 'uploader']
|
||||
ensure_running(managed_processes.values(), started=True, not_run=ignore)
|
||||
|
||||
Reference in New Issue
Block a user