Check how many TPU cores are using
I followed the instruction innotebooks/simple_nlp_example.ipynb at master · huggingface/notebooks · GitHubto setup the environment.Is there a function to check how many TPU cores the model is using? Like XLA’s xm.xrt_world_size()?Thanks
2021-07-30T01:02:52Z
If you follow the notebook, you will see the launcher says: “Launching training on 8 TPUs”. You can printaccelerator.statein yourtraining_functionif you want to be sure of that.
2021-07-30T01:06:34Z
Thanks! Yes I was adapting the code from the tutorial and in mine it doesn’t shows how many cores. I will add that and see if it shows.
2021-07-30T01:14:39Z
Interesting in the tutorial we  don’t need to specifydevice = accelerator.deviceand does not need to push model to devicemodel = model.to(device). Perhaps this is the problem in my script that only uses 1 TPU core?
2021-07-30T01:32:23Z
You should leave the device placement to theAcceleratelibrary, yes.