-
Notifications
You must be signed in to change notification settings - Fork 986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
does it support multiple gpu #691
Comments
Please check inference/cli_demo.py to see how to distribute to multiple GPUs, but this does not support quantization. |
i have tried and got error pipe = CogVideoXImageToVideoPipeline.from_pretrained( pipe.scheduler = CogVideoXDPMScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing") video = pipe( export_to_video(video, "output.mp4", fps=8) Loading checkpoint shards: 100%|█| 2/2 [00:01<00:00, 1.24it |
it solved when i used this i dont know why it not working on 4 gpus it only working on 2 gpus os.environ["CUDA_VISIBLE_DEVICES"] = "0,1 |
and when i put .to('cuda') igot error also |
System Info / 系統信息
i used i2v and add .to('cuda') with removing offline but it still not using all gpus iam using 4 a10 with 24 vram
Information / 问题信息
Reproduction / 复现过程
text_encoder = T5EncoderModel.from_pretrained("THUDM/CogVideoX-5b-I2V", subfolder="text_encoder", torch_dtype=torch.bfloat16)
quantize_(text_encoder, quantization())
transformer = CogVideoXTransformer3DModel.from_pretrained("THUDM/CogVideoX-5b-I2V",subfolder="transformer", torch_dtype=torch.bfloat16)
quantize_(transformer, quantization())
vae = AutoencoderKLCogVideoX.from_pretrained("THUDM/CogVideoX-5b-I2V", subfolder="vae", torch_dtype=torch.bfloat16)
quantize_(vae, quantization())
Create pipeline and run inference
pipe = CogVideoXImageToVideoPipeline.from_pretrained(
"THUDM/CogVideoX-5b-I2V",
text_encoder=text_encoder,
transformer=transformer,
vae=vae,
torch_dtype=torch.bfloat16,
).to('cuda')
Manually assign components to GPUs
pipe.vae.enable_tiling()
pipe.vae.enable_slicing()
print(pipe.text_encoder.device)
print(pipe.transformer.device)
print(pipe.vae.device)
video = pipe(
prompt='test',
image=image,
num_videos_per_prompt=1,
num_inference_steps=50,
num_frames=49,
guidance_scale=6,
).frames[0]
out = 'temp.mp4'
export_to_video(video, f'{out}', fps=8)
Expected behavior / 期待表现
got only one gpu uitilized
The text was updated successfully, but these errors were encountered: