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

zero3 training hangs with mixed multimodal dataset #7170

Open
zhangyuygss opened this issue Mar 24, 2025 · 0 comments
Open

zero3 training hangs with mixed multimodal dataset #7170

zhangyuygss opened this issue Mar 24, 2025 · 0 comments
Labels
bug Something isn't working training

Comments

@zhangyuygss
Copy link

Describe the bug
zero3 qwen2-vl training hangs when with mixed multimodal dataset.
When different GPUs have different modalities of mini-batch, multimodal related variables have different shapes among GPUs.
For example, video related tensor video_grid_thw have values on GPU0, but is None on GPU1.
The training hangs when dealing with this variable.

The hanging DOES NOT occur when using zero-2.
Is it caused by variable comunication between GPUs in zero-3?
What's the right way to train mixed modality data with zero-3?

dataset: mixure of pure-text, image-text
model: qwen2-vl
training on: 8xA100
stage3 config:

{
  "fp16": {
    "enabled": "auto",
    "loss_scale": 0,
    "loss_scale_window": 1000,
    "initial_scale_power": 16,
    "hysteresis": 2,
    "min_loss_scale": 1
  },
  "bf16": {
    "enabled": "auto"
  },
  "optimizer": {
    "type": "AdamW",
    "params": {
      "lr": "auto",
      "betas": "auto",
      "eps": "auto",
      "weight_decay": "auto"
    }
  },
  "zero_optimization": {
    "stage": 3,
    "overlap_comm": true,
    "contiguous_gradients": true,
    "sub_group_size": 1e9,
    "reduce_bucket_size": "auto",
    "stage3_prefetch_bucket_size": "auto",
    "stage3_param_persistence_threshold": "auto",
    "stage3_max_live_parameters": 1e9,
    "stage3_max_reuse_distance": 1e9,
    "stage3_gather_16bit_weights_on_model_save": true
  },
  "gradient_accumulation_steps": "auto",
  "gradient_clipping": "auto",
  "steps_per_print": 100,
  "train_batch_size": "auto",
  "train_micro_batch_size_per_gpu": "auto",
  "wall_clock_breakdown": false
}
@zhangyuygss zhangyuygss added bug Something isn't working training labels Mar 24, 2025
@zhangyuygss zhangyuygss changed the title zero3 training hangs when with mixed multimodal dataset zero3 training hangs with mixed multimodal dataset Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working training
Projects
None yet
Development

No branches or pull requests

1 participant