fix: macOS MPS support improvements (dtype, xpu safety, memory)#382
Open
takayamaekawa wants to merge 1 commit into
Open
fix: macOS MPS support improvements (dtype, xpu safety, memory)#382takayamaekawa wants to merge 1 commit into
takayamaekawa 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”),
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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