Open ZeenSong opened 2 days ago
This also applied to the case when I launched the model worker. When I uploaded the images, the same error occurs, saying that the image and model are on the different devices.
Yes, the current script only works with a single GPU for now. As the device_map
is set to auto
by default, it will try to split the weight when multiple GPUs are available. The reason for this error and a temporary workaround are provided here https://github.com/cambrian-mllm/cambrian/issues/12#issuecomment-2198610750.
Thank you for your quick response. So if I have a different number of GPUs than in #12 , should I only modify the beginning of cambrian/model/builder.py
to my GPU setting?
Yes. I just put all vision encoders on cuda:0 and reserve some memory for cuda:0 in device_map
, so you have to make sure the memory reserved for cuda:0 is enough in your case.
My server has 8 GPUs and when running
It can load all models, but when input with image and question it raises an error with:
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:1 and cuda:0! (when checking argument for argument weight in method wrapper_CUDA__native_layer_norm)
But when I specify only one GPU with
It works well.
Does this script only work with a single GPU?