CUDA illegal memory access
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- python, pytorch
- Ambito
- machine-learning
Direzione di ricerca
Inizia da multi_modality/models/backbones/internvideo2/internvideo2.py, in particolare dai percorsi di attention e LayerNorm mostrati nei trace, quindi confronta internvideo2_stage2_config.py predefinito, il checkpoint pretrained e le modifiche al tokenizer. Riproduci la demo di video text retrieval con e senza DeepSpeed e verifica che venga completata senza gli errori CUDA segnalati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hello,
I tried running the video text retrieval demo and I'm running into this error:
File "/home/saumya/miniconda3/lib/python3.12/site-packages/torch/utils/checkpoint.py", line 481, in checkpoint
return CheckpointFunction.apply(function, preserve, *args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/saumya/miniconda3/lib/python3.12/site-packages/torch/autograd/function.py", line 574, in apply
return super().apply(*args, **kwargs) # type: ignore[misc]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/saumya/miniconda3/lib/python3.12/site-packages/torch/utils/checkpoint.py", line 255, in forward
outputs = run_function(*args)
^^^^^^^^^^^^^^^^^^^
File "/home/saumya/InternVideoClean/InternVideo2/multi_modality/models/backbones/internvideo2/internvideo2.py", line 305, in _inner_forward
x = x + self.drop_path2(self.ls2(self.mlp(self.norm2(x))))
^^^^^^^^^^^^^
File "/home/saumya/miniconda3/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/saumya/miniconda3/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/saumya/InternVideoClean/InternVideo2/multi_modality/models/backbones/internvideo2/internvideo2.py", line 138, in forward
return self.weight * hidden_states.to(input_dtype)
~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RuntimeError: CUDA error: an illegal memory access was encountered
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.
I'm using the default internvideo2_stage2_config.py with pretrained='InternVideo2-stage2_1b-224p-f4.pt'. When I turn off deepspeed I get this error instead:
File "/home/saumya/InternVideoClean/InternVideo2/multi_modality/models/backbones/internvideo2/internvideo2.py", line 302, in _inner_forward
x = x + self.drop_path1(self.ls1(self.attn(self.norm1(x))))
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/saumya/miniconda3/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/saumya/miniconda3/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/saumya/InternVideoClean/InternVideo2/multi_modality/models/backbones/internvideo2/internvideo2.py", line 227, in forward
x = self._naive_attn(x) if not self.use_flash_attn else self._flash_attn(x)
^^^^^^^^^^^^^^^^^^^
File "/home/saumya/InternVideoClean/InternVideo2/multi_modality/models/backbones/internvideo2/internvideo2.py", line 186, in _naive_attn
qkv = self.qkv(x).reshape(B, N, 3, self.num_heads, C // self.num_heads).permute(2, 0, 3, 1, 4)
^^^^^^^^^^^
File "/home/saumya/miniconda3/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/saumya/miniconda3/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/saumya/miniconda3/lib/python3.12/site-packages/torch/nn/modules/linear.py", line 117, in forward
return F.linear(input, self.weight, self.bias)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: CUDA error: CUBLAS_STATUS_EXECUTION_FAILED when calling `cublasSgemm( handle, opa, opb, m, n, k, &alpha, a, lda, b, ldb, &beta, c, ldc)`
The only other notable thing I changed was loading the BERT tokenizer:
tokenizer = AutoTokenizer.from_pretrained("google-bert/bert-large-uncased")
# tokenizer = BertTokenizer.from_pretrained(config.model.text_encoder.pretrained, local_files_only=False)
model = InternVideo2_Stage2(config=config, tokenizer=tokenizer, is_pretrain=True)
- Lingua principale
- Python
- Stelle
- 2.4k
- Fork
- 160
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di OpenGVLab/InternVideo
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
OpenGVLab/InternVideo#324 · 1 commento ·
-
InternVideo2 stage-1 weights Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
OpenGVLab/InternVideo#323 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
OpenGVLab/InternVideo#322 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
OpenGVLab/InternVideo#321 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
OpenGVLab/InternVideo#319 · 1 commento ·
Tutte le issue di OpenGVLab/InternVideo
Issue simili
-
essnmx good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
-
[Feature] 奇物选择添加优先级 Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
syfoud/Simulated_Scepter#174 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Giskard-AI/giskard-oss#2840 · 1 commento ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Apertaarea: repo bug perceived difficulty: 2
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
yeti-platform/yeti#1380 ·