FSDP2 integration: torch.chunks(Params4bit) not returning Params4bit subclass #1424
Labels
bug
Something isn't working
FSDP
help wanted
Extra attention is needed
high priority
(first issues that will be worked on)
System Info
Hi, I'am trying to make FSDP2 work with a llama model quantized with bitsandbytes but it seems that bitsandbytes' tensor subclasses like Params4bit are not compatible with the way FSDP2 shards the model.
When creating the DTensors to shard the model FSDP2 applies torch.chunk to the parameters which get returned by torch.chunk as ordinary Tensors instead of the original subclass (like Params4bit) which leads to errors down the line.
Is this a known issue and are there plans to make bitsandbytes composable with FSDP2?
Reproduction
Created a simple repro:
Output:
Expected behavior
Expecting the output of torch.chunk to be a a tuple of Params4bits instead of a Tensors.
The text was updated successfully, but these errors were encountered: