Skip to content

[BUG] "model parallel size" is always 1 with zero3 enabled #3889

@i4never

Description

@i4never

Describe the bug
I'm using zero stage3 with optimizer & parameter offloading. The memory used by each gpu should decrease if more gpu is used. (which is not happening). After adding flops_profiler to ds_config, model parallel size remains 1 and params per gpu is not dropping.

  • 1 node 1 gpu
world size:                                                   1       
data parallel size:                                           1       
model parallel size:                                          1       
batch size per GPU:                                           2       
params per gpu:                                               83.81 M 
params of model = params per GPU * mp_size:                   83.81 M
  • 1 node 4 gpu
world size:                                                   4       
data parallel size:                                           4       
model parallel size:                                          1       
batch size per GPU:                                           2       
params per gpu:                                               83.81 M 
params of model = params per GPU * mp_size:                   83.81 M 

To Reproduce
NA

Expected behavior
Training with bigger batch_size will not cause cuda OOM.
model parallel size printed by flops_profiler should equal to world size.

ds_report output

--------------------------------------------------
DeepSpeed C++/CUDA extension op report
--------------------------------------------------
NOTE: Ops not installed will be just-in-time (JIT) compiled at
      runtime if needed. Op compatibility means that your system
      meet the required dependencies to JIT install the op.
--------------------------------------------------
JIT compiled ops requires ninja
ninja .................. [OKAY]
--------------------------------------------------
op name ................ installed .. compatible
--------------------------------------------------
 [WARNING]  async_io requires the dev libaio .so object and headers but these were not found.
 [WARNING]  async_io: please install the libaio-devel package with yum
 [WARNING]  If libaio is already installed (perhaps from source), try setting the CFLAGS and LDFLAGS environment variables to where it can be found.
async_io ............... [NO] ....... [NO]
cpu_adagrad ............ [NO] ....... [OKAY]
cpu_adam ............... [YES] ...... [OKAY]
fused_adam ............. [NO] ....... [OKAY]
fused_lamb ............. [NO] ....... [OKAY]
quantizer .............. [NO] ....... [OKAY]
random_ltd ............. [NO] ....... [OKAY]
 [WARNING]  sparse_attn requires a torch version >= 1.5 and < 2.0 but detected 2.0
 [WARNING]  using untested triton version (2.0.0), only 1.0.0 is known to be compatible
sparse_attn ............ [NO] ....... [NO]
spatial_inference ...... [NO] ....... [OKAY]
transformer ............ [NO] ....... [OKAY]
stochastic_transformer . [NO] ....... [OKAY]
transformer_inference .. [NO] ....... [OKAY]
--------------------------------------------------
DeepSpeed general environment info:
torch install path ............... ['/data/apps/anaconda3/envs/py38_test1/lib/python3.8/site-packages/torch']
torch version .................... 2.0.1+cu117
deepspeed install path ........... ['/data/apps/anaconda3/envs/py38_test1/lib/python3.8/site-packages/deepspeed']
deepspeed info ................... 0.9.5, unknown, unknown
torch cuda version ............... 11.7
torch hip version ................ None
nvcc version ..................... 11.6
deepspeed wheel compiled w. ...... torch 2.0, cuda 11.7

System info (please complete the following information):

  • Ubuntu 18.04
  • one machines with x8 A100s
  • Python 3.8

Launcher context

python -u -m deepspeed.launcher.launch

Docker context
NO

Additional context
NA

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtraining

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions