fix: macOS MPS support improvements (dtype, xpu safety, memory)#382
fix: macOS MPS support improvements (dtype, xpu safety, memory)#382takayamaekawa wants to merge 1 commit into
Conversation
- torch_dtype引数名の修正 (dtype -> torch_dtype) - torch.backends.xpuをhasattrで安全にチェック(macOSクラッシュ修正) - MPS dtype をfloat32からfloat16に変更(メモリ使用量14GB→28GB削減) - _convert_dtype_to_stringをネストdictに再帰対応 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@takayamaekawa please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
Note from automated reviewmacOS MPS support improvements (dtype, xpu safety, memory). I don't have a macOS/MPS environment to verify these changes. The diff looks like targeted fixes for Metal Performance Shaders compatibility. Verdict: Left for Rick or an Apple Silicon specialist to confirm. If tested on MPS, ready to merge. |
Summary
macOS (Apple Silicon) でVibeVoiceを動作させる際のバグ修正と改善です。
torch_dtype引数名の修正:from_pretrainedにdtype=を渡していたのを正しいtorch_dtype=に修正torch.backends.xpuの安全なチェック: macOSではxpu属性が存在しないためAttributeErrorが発生していた。hasattrチェックを追加して修正float16に変更:float32のままだとメモリ使用量が約28GBとなりM-series Mac上ではOOMになるケースがあった。float16にすることで約14GBに削減_convert_dtype_to_stringをネスト辞書に対応: ネストされたdict内のtorch.dtypeが変換されずJSON直列化エラーが発生していた問題を修正 (ref: Object of type dtype is not JSON serializable #199)Test plan
demo/vibevoice_asr_inference_from_file.pyが正常に動作することを確認--device mps指定時にメモリ使用量が float16 で約14GB以内に収まることを確認🤖 Generated with Claude Code