Add support for apple silicon
Macでuse-gpuを指定した時にmpsバックエンドを使うようにします。
M3 Ultra環境だとデフォルトネットワークで16ワーカー32visitsで22kgames/hourくらい自己対局出来ています。
学習側は2.6.0では未対応の処理があってワークアラウンドが必要でした。
https://github.com/pytorch/pytorch/issues/142397
requirements.txtのtorchのバージョンを合わせておいていただけますか。
PyTorchのmainブランチでは修正されていますが、その後リリースされた 2.7.0 や 2.7.1-rc1 は別ブランチでの開発らしく反映されていません。 マージはPyTorch 2.8以降がリリースされてからのほうが良いかもしれません。
ちなみに修正はこれです。 https://discuss.pytorch.org/t/gradscaler-typeerror-cannot-convert-a-mps-tensor-to-float64-dtype-as-the-mps-framework-doesnt-support-float64-please-use-float32-instead/213206
ありがとうございます。問題点を理解できました。 PyTorchの修正が済んでからマージします。