MOSS-TTS-Nano icon indicating copy to clipboard operation
MOSS-TTS-Nano copied to clipboard

onnx 内存占用非常大

Open 501956430 opened this issue 6 months ago • 1 comments

app_onnx.py 占用 6g内存 app.py 占用 600m内存 差距这么大么

501956430 avatar May 09 '26 10:05 501956430

Yes, the ONNX version can use more memory than the PyTorch version. One thing that can make memory usage worse is changing CPU Threads, because ONNX Runtime sessions are created with a fixed thread count. If the app starts with one thread count but the UI requests another one, the app may create another cached runtime instance.

As a temporary workaround, please start the ONNX app with the same CPU thread count you use in the UI, for example:

python app_onnx.py --cpu-threads 4

and keep CPU Threads = 4 in the web UI.

This should reduce unnecessary extra runtime instances, although the ONNX version may still use more memory than the PyTorch version. We may look into further reducing the ONNX memory usage in the future.

alpacaking avatar May 12 '26 08:05 alpacaking