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

Out of memory #12

Open
Yurri-hub opened this issue Dec 29, 2023 · 1 comment
Open

Out of memory #12

Yurri-hub opened this issue Dec 29, 2023 · 1 comment

Comments

@Yurri-hub
Copy link

I use 2 RTX3090 for block-nerf dataset training, and I find that it runs out of memory in moe module. Is that normal?
image
Althought I decrease the batch_size, even to batch_size=2312, it still went out of memory.
And my scripts are like:

CUDA_VISIBLE_DEVICES=0,1 python -m torch.distributed.launch \
    --use_env --master_port=12345 --nproc_per_node=2 -m \
    switch_nerf.train \
    --config=switch_nerf/configs/switch_nerf/mission_bay.yaml \
    --use_moe --exp_name=data/outputs \
    --dataset_path=data/datasets/waymo-block-nerf/v1.0 \
    --block_train_list_path=switch_nerf/datasets/lists/block_nerf_train_val.txt \
    --block_image_hash_id_map_path=switch_nerf/datasets/lists/block_nerf_id_map.json \
    --chunk_paths=data/chunks/mission_bay_chunk_radii_1 \
    --no_bg_nerf --near=0.01 --far=10.0 \
    --use_balance_loss \
    --i_print=200 \
    --batch_size=12312 \
    --moe_expert_type=expertmlp \
    --moe_train_batch \
    --moe_test_batch \
    --model_chunk_size=212992 \
    --coarse_samples=257 \
    --fine_samples=257 \
    --moe_capacity_factor=1.0 \
    --batch_prioritized_routing \
    --moe_l_aux_wt=0.0005 \
    --amp_use_bfloat16 \
    --use_moe_external_gate \
    --use_gate_input_norm \
    --use_sigma_noise \
    --sigma_noise_std=1.0
@MiZhenxing
Copy link
Owner

Hi, batch size of 12312 for 2 3090 is very large. I typically use 13312 for 8 GPUs, i.e. 1664 for each GPU. You may need to decrease the batch size.

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

No branches or pull requests

2 participants