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
i try to use QAT to quantize qwen2 1.5B model
The error raise from function training.load_from_full_model_state_dict( model, model_state_dict, self._device, self._is_rank_zero, strict=True ) from recipes/qat_distributed
Then i find error caused by
# torchtune/torchtune/training/_distributed.py
def load_from_full_model_state_dict(
model: "FSDPModule", # noqa
full_sd: Dict[str, Any],
device: torch.device,
is_rank_zero: bool,
strict: bool = False,
cpu_offload: bool = False,
):
"""
Converting full state dict into a sharded state dict
and loading it into FSDP model
- 'full' means plain tensor
- 'sharded' means `DTensor` where reach rank has a shard of the plain tensor
- `is_rank_zero` matters if only rank 0 pass in non-empty `full_sd` and
we need to broadcast from rank 0
"""
meta_sharded_sd = model.state_dict()
sharded_sd = {}
for param_name, full_tensor in full_sd.items():
sharded_meta_param = meta_sharded_sd.get(param_name)
full_tensor = full_tensor.to(sharded_meta_param.dtype).to(device)
it shows us that shared_meta_param.dtype is None.
By adding printing function, i find meta_shared_sd doesn‘t have bias layer
I have submitted a PR ( pytorch/ao#1087 ) to torchao to skip Linear layers with bias set to True during quantization.
But i find After training, quantized qwen model cann't not been loaded. I hope you can take a look at it. @joecummings@ebsmothers
i try to use QAT to quantize qwen2 1.5B model
The error raise from function
training.load_from_full_model_state_dict( model, model_state_dict, self._device, self._is_rank_zero, strict=True )
from recipes/qat_distributedThen i find error caused by
it shows us that shared_meta_param.dtype is None.
By adding printing function, i find
meta_shared_sd
doesn‘t have bias layermy yaml file is as follows:
The text was updated successfully, but these errors were encountered: