Skip to content
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

How to offload when using multi GPU (NeMo) #71

Open
clairelee5740 opened this issue Jan 20, 2025 · 1 comment
Open

How to offload when using multi GPU (NeMo) #71

clairelee5740 opened this issue Jan 20, 2025 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@clairelee5740
Copy link

clairelee5740 commented Jan 20, 2025

As in https://github.com/NVIDIA/Cosmos/tree/main/cosmos1/models/diffusion/nemo/inference#run-the-inference-script-with-base-model, I run
NVTE_FUSED_ATTN=0 \ torchrun --nproc_per_node=$NUM_DEVICES cosmos1/models/diffusion/nemo/inference/general.py \ --model Cosmos-1.0-Diffusion-7B-Text2World \ --cp_size $NUM_DEVICES \ --num_devices $NUM_DEVICES \ --video_save_path "Cosmos-1.0-Diffusion-7B-Text2World.mp4" \ --guidance 7 \ --seed 1 \ --prompt "$PROMPT" \ --enable_prompt_upsampler

I got cuda out of memory error, so I tried
NVTE_FUSED_ATTN=0 \ torchrun --nproc_per_node=$NUM_DEVICES cosmos1/models/diffusion/nemo/inference/general.py \ --model Cosmos-1.0-Diffusion-7B-Text2World \ --cp_size $NUM_DEVICES \ --num_devices $NUM_DEVICES \ --video_save_path "Cosmos-1.0-Diffusion-7B-Text2World.mp4" \ --guidance 7 \ --seed 1 \ --prompt "$PROMPT" \ --enable_prompt_upsampler \ --offload_tokenizer \ --offload_diffusion_transformer \ --offload_text_encoder_model \ --offload_prompt_upsampler \ --offload_guardrail_models

but it says
general.py: error: unrecognized arguments: --offload_tokenizer --offload_diffusion_transformer --offload_text_encoder_model --offload_prompt_upsampler --offload_guardrail_models

Did anyone encounter similar question when using NeMo framework? Is there any solution?
btw I am using 4 RTX 4090 24G and there is still not enough GPU memory

@sophiahhuang sophiahhuang added the question Further information is requested label Jan 27, 2025
@ethanhe42
Copy link
Member

ethanhe42 commented Feb 4, 2025

it is currently not supported yet. you can try modify the code to delete models after they're used. e.g. del t5_model

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants