fix notebook_launcher for Colab TPU compatibility. by BogdanDidenko · Pull Request #3541 · huggingface/accelerate
Conversation
This change enhances the TPU autodetection logic in notebook_launcher and remove call of device_count() before xmp.spawn for avoiding earlier devices initialising for passing check on torch_xla._XLAC._xla_runtime_is_initialized().
- Added a check for PJRT_DEVICE == "TPU" when TPU_NAME is undefined.
- Removed calls to torch_xla.device_count() before xmp.spawn because it initialised devices.
Fixes #3358
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking a look at this. LGTM !
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
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