Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Colab TPU notebook_launcher doesn't work #3358

Open
2 of 4 tasks
matinmoezzi opened this issue Jan 21, 2025 · 0 comments
Open
2 of 4 tasks

Google Colab TPU notebook_launcher doesn't work #3358

matinmoezzi opened this issue Jan 21, 2025 · 0 comments

Comments

@matinmoezzi
Copy link

System Info

- `Accelerate` version: 1.4.0.dev0
- Platform: Linux-6.1.85+-x86_64-with-glibc2.35
- `accelerate` bash location: /usr/local/bin/accelerate
- Python version: 3.11.11
- Numpy version: 1.26.4
- PyTorch version (GPU?): 2.5.1+cpu (False)
- PyTorch XPU available: False
- PyTorch NPU available: False
- PyTorch MLU available: False
- PyTorch MUSA available: False
- System RAM: 334.56 GB
- `Accelerate` default config:
	Not found

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • One of the scripts in the examples/ folder of Accelerate or an officially supported no_trainer script in the examples folder of the transformers repo (such as run_no_trainer_glue.py)
  • My own task or dataset (give details below)

Reproduction

Google Colab with TPUv2-8

! pip install datasets diffusers[training]
! pip install cloud-tpu-client==0.10 torch==2.0.0
! pip install https://storage.googleapis.com/tpu-pytorch/wheels/colab/torch_xla-2.0-cp310-cp310-linux_x86_64.whl
! pip install git+https://github.com/huggingface/accelerate
from accelerate import Accelerator, notebook_launcher
notebook_launcher(train_loop, args)

FileNotFoundError: [Errno 2] No such file or directory: 'nvidia-smi'

Expected behavior

notebook_launcher doesn't work with TPU in Google Colab. The reason is that os environment variable TPU_NAME is not set and launchers.py@line:135 returns False. Setting manually by os.environ["TPU_NAME"]="dummy", raises another error

RuntimeError: Runtime is already initialized. Do not use the XLA device before calling xmp.spawn.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant