microsoft / DeepSpeed

DeepSpeed is a deep learning optimization library that makes distributed training and inference easy, efficient, and effective.
https://www.deepspeed.ai/
Apache License 2.0
33.6k stars 3.94k forks source link

[BUG] Logs full of FutureWarning when training with nightly PyTorch #5682

Open rosario-purple opened 1 week ago

rosario-purple commented 1 week ago

Describe the bug When training with nightly PyTorch, the logs are full of deprecation warnings like this:

/home/alyssavance/miniforge3/envs/brr/lib/python3.10/site-packages/deepspeed/runtime/zero/linear.py:49: FutureWarn\
ing: `torch.cuda.amp.custom_fwd(args...)` is deprecated. Please use `torch.amp.custom_fwd(args..., device_type='cu\
da')` instead.
[860302:0]:/home/alyssavance/miniforge3/envs/brr/lib/python3.10/site-packages/deepspeed/runtime/zero/linear.py:67:\
 FutureWarning: `torch.cuda.amp.custom_bwd(args...)` is deprecated. Please use `torch.amp.custom_bwd(args..., devi\
ce_type='cuda')` instead.

To Reproduce Steps to reproduce the behavior: Fine-tune a model with Zero-3 while using nightly PyTorch.

Expected behavior The deprecation warning shouldn't appear.

ds_report output [2024-06-18 08:59:11,766] [INFO] [real_accelerator.py:203:get_accelerator] Setting ds_accelerator to cuda (auto detect) /home/alyssavance/miniforge3/envs/brr/lib/python3.10/site-packages/deepspeed/runtime/zero/linear.py:49: FutureWarning: torch.cuda.amp.custo\ m_fwd(args...) is deprecated. Please use torch.amp.custom_fwd(args..., device_type='cuda') instead. def forward(ctx, input, weight, bias=None): /home/alyssavance/miniforge3/envs/brr/lib/python3.10/site-packages/deepspeed/runtime/zero/linear.py:67: FutureWarning: torch.cuda.amp.custo\ m_bwd(args...) is deprecated. Please use torch.amp.custom_bwd(args..., device_type='cuda') instead. def backward(ctx, grad_output): Warning: The default cache directory for DeepSpeed Triton autotune, /home/alyssavance/.triton/autotune, appears to be on an NFS system. Whil\ e this is generally acceptable, if you experience slowdowns or hanging when DeepSpeed exits, it is recommended to set the TRITON_CACHE_DIR e\ nvironment variable to a non-NFS path. ^[[93m [WARNING] ^[[0m Please specify the CUTLASS repo directory as environment variable $CUTLASS_PATH ^[[93m [WARNING] ^[[0m sparse_attn requires a torch version >= 1.5 and < 2.0 but detected 2.4 ^[[93m [WARNING] ^[[0m using untested triton version (3.0.0+45fff310c8), only 1.0.0 is known to be compatible

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 .................. ^[[92m[OKAY]^[[0m

op name ................ installed .. compatible

op name ................ installed .. compatible

async_io ............... ^[[93m[NO]^[[0m ....... ^[[92m[OKAY]^[[0m fused_adam ............. ^[[93m[NO]^[[0m ....... ^[[92m[OKAY]^[[0m cpu_adam ............... ^[[93m[NO]^[[0m ....... ^[[92m[OKAY]^[[0m cpu_adagrad ............ ^[[93m[NO]^[[0m ....... ^[[92m[OKAY]^[[0m cpu_lion ............... ^[[93m[NO]^[[0m ....... ^[[92m[OKAY]^[[0m ^[[93m [WARNING] ^[[0m Please specify the CUTLASS repo directory as environment variable $CUTLASS_PATH evoformer_attn ......... ^[[93m[NO]^[[0m ....... ^[[93m[NO]^[[0m fp_quantizer ........... ^[[93m[NO]^[[0m ....... ^[[92m[OKAY]^[[0m fused_lamb ............. ^[[93m[NO]^[[0m ....... ^[[92m[OKAY]^[[0m fused_lion ............. ^[[93m[NO]^[[0m ....... ^[[92m[OKAY]^[[0m inference_core_ops ..... ^[[93m[NO]^[[0m ....... ^[[92m[OKAY]^[[0m cutlass_ops ............ ^[[93m[NO]^[[0m ....... ^[[92m[OKAY]^[[0m transformer_inference .. ^[[93m[NO]^[[0m ....... ^[[92m[OKAY]^[[0m quantizer .............. ^[[93m[NO]^[[0m ....... ^[[92m[OKAY]^[[0m ragged_device_ops ...... ^[[93m[NO]^[[0m ....... ^[[92m[OKAY]^[[0m ragged_ops ............. ^[[93m[NO]^[[0m ....... ^[[92m[OKAY]^[[0m random_ltd ............. ^[[93m[NO]^[[0m ....... ^[[92m[OKAY]^[[0m ^[[93m [WARNING] ^[[0m sparse_attn requires a torch version >= 1.5 and < 2.0 but detected 2.4 ^[[93m [WARNING] ^[[0m using untested triton version (3.0.0+45fff310c8), only 1.0.0 is known to be compatible sparse_attn ............ ^[[93m[NO]^[[0m ....... ^[[93m[NO]^[[0m spatial_inference ...... ^[[93m[NO]^[[0m ....... ^[[92m[OKAY]^[[0m transformer ............ ^[[93m[NO]^[[0m ....... ^[[92m[OKAY]^[[0m stochastic_transformer . ^[[93m[NO]^[[0m ....... ^[[92m[OKAY]^[[0m

DeepSpeed general environment info: torch install path ............... ['/home/alyssavance/miniforge3/envs/brr/lib/python3.10/site-packages/torch'] torch version .................... 2.4.0.dev20240609+cu124 deepspeed install path ........... ['/home/alyssavance/miniforge3/envs/brr/lib/python3.10/site-packages/deepspeed'] deepspeed info ................... 0.14.3, unknown, unknown torch cuda version ............... 12.4 torch hip version ................ None nvcc version ..................... 12.5 deepspeed wheel compiled w. ...... torch 2.4, cuda 12.4 shared memory (/dev/shm) size .... 1007.73 GB

System info (please complete the following information):

Launcher context Are you launching your experiment with the deepspeed launcher, MPI, or something else?

Launching with Slurm via HuggingFace "accelerate launch"

Docker context Are you using a specific docker image that you can share?

N/A

Additional context Add any other context about the problem here.

N/A

loadams commented 1 week ago

Thanks @rosario-purple, we will take a look at these