Conversation
| pub const ORT_LOGGING_LEVEL: &str = if cfg!(debug_assertions) { | ||
| "info" | ||
| } else { | ||
| "warn" | ||
| }; | ||
| format!("error,voicevox_core=info,voicevox_core_c_api=info,ort={ORT_LOGGING_LEVEL}") | ||
| .into() |
There was a problem hiding this comment.
以下のAPI削除のため、warn未満のログを抑える役目をここに移動させる。
Environment-level logging configuration (i.e.
EnvironmentBuilder::with_log_level) has been removed because it could cause unnecessary confusion with ourtracingintegration.
https://ort.pyke.io/migrating/v2#changes-to-logging
(言っていることは真っ当だと思う)
libonnxruntimeのWARNING未満のログだけ、ひとまずはortの中でせきとめる。ort自体のwarn以下のログについては、明示的に出すことができる分にはかまわないものしかないはず。
| let cpu_num_threads = options.cpu_num_threads.try_into().unwrap_or_else(|_| { | ||
| warn!( | ||
| "`cpu_num_threads={}` is too large. Setting it to 32767", | ||
| options.cpu_num_threads, | ||
| ); | ||
| i16::MAX | ||
| }); |
There was a problem hiding this comment.
ortはi16を要求するため、変換を入れる。
ortの実装はこうなっており、コメントを考慮すると意味がわからない。
https://github.com/pykeio/ort/blob/2fdba8f021924d40c6281427b4f8142e932d9bfb/src/session/mod.rs#L175-L177
(旧onnxruntime-rsの時点であちこちこんな感じだったらしい?)
|
正しいバージョンのCUDAを入れずににCUDA版のセッションを開始しようとしたときの様子。 ortってこういうとこにも変化が入っているんですね。 Before (エラー): [INFO] __main__: Loading `../../model/sample.vvm`
Exception: Failed to create session options: Error calling ONNX Runtime C function: /onnxruntime_src/onnxruntime/core/session/provider_bridge_ort.cc:1103 onnxruntime::Provider& onnxruntime::ProviderLibrary::Get() [ONNXRuntimeError] : 1 : FAIL : Failed to load library libonnxruntime_providers_cuda.so with error: libcublasLt.so.11: cannot open shared object file: No such file or directory
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "./run.py", line 98, in <module>
main()
File "./run.py", line 41, in main
synthesizer.load_voice_model(model)
voicevox_core.InvalidModelDataError: `../../model/sample.vvm`の読み込みに失敗しました: モデルデータを読むことができませんでしたAfter (CPU版にフォールバックして継続): [WARNING] ort.execution_providers: An error occurred when attempting to register `CUDAExecutionProvider`: /home/runner/work/onnxruntime-builder/onnxruntime-builder/onnxruntime/core/session/provider_bridge_ort.cc:1209 onnxruntime::Provider& onnxruntime::ProviderLibrary::Get() [ONNXRuntimeError] : 1 : FAIL : Failed to load library libonnxruntime_providers_cuda.so with error: libcublasLt.so.11: cannot open shared object file: No such file or directory
[WARNING] ort.execution_providers: No execution providers registered successfully. Falling back to CPU. |
こちら VOICEVOX/voicevox_engine#709 (comment) で議論されていた CUDA バージョン不一致に関して、実際に不一致が起きた場合に |
|
まあコア的にも
|
|
コアAPI的には、 |
|
これでエラー挙動になるはず。 |
Autoという単語からするとこれがかなり自然で良いと思います。 |
内容
関連 Issue
Resolves #718, resolves #307.
その他