-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onnxruntime-rsからortに乗り換える #725
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
以下のAPI削除のため、warn
未満のログを抑える役目をここに移動させる。
Environment-level logging configuration (i.e.
EnvironmentBuilder::with_log_level
) has been removed because it could cause unnecessary confusion with ourtracing
integration.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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という単語からするとこれがかなり自然で良いと思います。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!!
ありがとうございます!!!
1箇所コメントしてますが、問題なさそうならそのままマージで!
リポジトリ変える場合も変えた後マージでお願いできれば!
内容
関連 Issue
Resolves #718, resolves #307.
その他