You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using LLaVA with freeze-LM, training text only sample occurs error.
To Reproduce
Base code use VQASample for training LLaVA. But, if you use TextSample or samples with text only, it will occur following error.
Stack trace/logs
File "/workspace/megatron/core/pipeline_parallel/schedules.py", line 365, in backward_step
custom_backward(output_tensor[0], output_tensor_grad[0])
File "/workspace/megatron/core/pipeline_parallel/schedules.py", line 149, in custom_backward
Variable._execution_engine.run_backward(
RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn
Expected behavior
I think output_tensor[0] always has grad_fn, but it doesn't have grad_fn if any of sample uses parameters with grad.
Environment (please complete the following information):
Additional context @trintamaki could you help to fix this issue?
The text was updated successfully, but these errors were encountered:
liveseongho
changed the title
[BUG] When training LLaVA with freeze-LM, text only sample occurs error.
[BUG] When using LLaVA with freeze-LM, training text only sample occurs error.
Dec 6, 2024
Describe the bug
When using LLaVA with freeze-LM, training text only sample occurs error.
To Reproduce
Base code use VQASample for training LLaVA. But, if you use TextSample or samples with text only, it will occur following error.
Stack trace/logs
Expected behavior
I think
output_tensor[0]
always has grad_fn, but it doesn't have grad_fn if any of sample uses parameters with grad.Environment (please complete the following information):
Proposed fix
Fix following code
Megatron-LM/megatron/core/pipeline_parallel/schedules.py
Lines 364 to 367 in bd677bf
as follows
Additional context
@trintamaki could you help to fix this issue?
The text was updated successfully, but these errors were encountered: