AnswerDotAI / AnswerDotAI/fsdp_qlora

NotImplementedError: c10d::broadcast_: at

Open
#75 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
1.6k
Forks
201
PR merge metrics
No merged PRs in 30d

Description

Hi, I'm running on CUDA 12.0
and torch 2.6.0+cu124
Python 3.10.14
transformers 4.50.1

When i run
python train.py \
--model_name meta-llama/Llama-3.2-1B \
--gradient_accumulation_steps 2 \
--batch_size 8 \
--context_length 512 \
--num_epochs 1 \
--train_type qlora \
--use_gradient_checkpointing False \
--use_cpu_offload False \
--log_to wandb \
--dataset alpaca \
--verbose false \
--save_model true \
--output_dir ~/models/qlora_alpaca

I get

File "$HOME/anaconda3/envs/py10/lib/python3.10/site-packages/torch/distributed/fsdp/fully_sharded_data_parallel.py", line 509, in __init__
_init_param_handle_from_module(
File "$HOME/anaconda3/envs/py10/lib/python3.10/site-packages/torch/distributed/fsdp/_init_utils.py", line 629, in _init_param_handle_from_module
_sync_module_params_and_buffers(
File "$HOME/anaconda3/envs/py10/lib/python3.10/site-packages/torch/distributed/fsdp/_init_utils.py", line 1126, in _sync_module_params_and_buffers
_sync_params_and_buffers(
File "$HOME/anaconda3/envs/py10/lib/python3.10/site-packages/torch/distributed/utils.py", line 334, in _sync_params_and_buffers
dist._broadcast_coalesced(
NotImplementedError: c10d::broadcast_: attempted to run this operator with Meta tensors, but there was no fake impl or Meta kernel registered. You may have run into this message while using an operator with PT2 compilation APIs (torch.compile/torch.export); in order to use this operator with those APIs you'll need to add a fake impl. Please see the following for next steps: https://pytorch.org/tutorials/advanced/custom_ops_landing_page.html

/$HOME/anaconda3/envs/py10/lib/python3.10/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
warnings.warn('resource_tracker: There appear to be %d '

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the failure with the train.py command and environment versions listed in the report. Trace the FSDP initialization through fully_sharded_data_parallel.py, _init_utils.py, and distributed/utils.py, focusing on the broadcast call involving Meta tensors. Done means the reported training command initializes FSDP and proceeds without this exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
distributed-systems, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.