[Bug] do not use torch.cuda.current_device() as device, since it only retures an int

Aperta
#130 3 commenti 0 reazioni 2 assegnatari Vedi su GitHub

@sallyjunjun ci sta già lavorando.

Dal 27/3/2024.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

bug
Describe the bug

we have a lot of cases like following:

data = torch.empty(partition_size, dtype=tensor.dtype, device=torch.cuda.current_device(), requires_grad=False)

where we directly use device=torch.cuda.current_device(). However, it is not recommended to do like it, since torch.cuda.current_device() only returns device id. It is OK to run such codes on GPUs. However, maybe there are some problems when running on NPU

Environment

python3.8 + torch2.1

Other information

No response

Lingua principale
Python
Stelle
420
Fork
67
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di InternLM/InternEvo

Tutte le issue di InternLM/InternEvo

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.