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

[BUG] Training crashes with "'Tensor' object has no attribute 'ds_id'" #5495

Open
oscarkey opened this issue May 2, 2024 · 0 comments
Open
Labels
bug Something isn't working training

Comments

@oscarkey
Copy link

oscarkey commented May 2, 2024

Describe the bug
Setting both offload_optimizer.device = "nvme" and offload_param.device = "nvme" results in the following exception:

[rank0]: Traceback (most recent call last):
...
[rank0]:   File "/home/oscar/Documents/repos/pipelinedft/deepspeed_repro.py", line 67, in main
[rank0]:     trainer.train()
...
[rank0]:   File "/home/oscar/.cache/pypoetry/virtualenvs/pippysinglegpu-DD8dToGi-py3.11/lib/python3.11/site-packages/deepspeed/runtime/swap_tensor/optimizer_utils.py", line 441, in _create_param_swap_info
[rank0]:     param_id = OptimizerSwapper.parameter_id(parameter)
[rank0]:                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/home/oscar/.cache/pypoetry/virtualenvs/pippysinglegpu-DD8dToGi-py3.11/lib/python3.11/site-packages/deepspeed/runtime/swap_tensor/optimizer_utils.py", line 117, in parameter_id
[rank0]:     return param.ds_id
[rank0]:            ^^^^^^^^^^^
[rank0]: AttributeError: 'Tensor' object has no attribute 'ds_id'

See full_logs.txt.

This already seems to have been fixed in #5193, which is waiting to be reviewed.

To Reproduce
See minimal_repro.txt.
Setting both offload_optimizer.device = "nvme" and offload_param.device = "nvme" and then training triggers the bug.

Expected behavior
No crash.

ds_report output

[2024-05-02 15:00:56,321] [INFO] [real_accelerator.py:203:get_accelerator] Setting ds_accelerator to cuda (auto detect)
 [WARNING]  Please specify the CUTLASS repo directory as environment variable $CUTLASS_PATH
 [WARNING]  sparse_attn requires a torch version >= 1.5 and < 2.0 but detected 2.3
 [WARNING]  using untested triton version (2.3.0), only 1.0.0 is known to be compatible
WARNING:root:Setting PiPPy logging level to: WARNING
--------------------------------------------------
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
--------------------------------------------------
async_io ............... [NO] ....... [OKAY]
fused_adam ............. [NO] ....... [OKAY]
cpu_adam ............... [NO] ....... [OKAY]
cpu_adagrad ............ [NO] ....... [OKAY]
cpu_lion ............... [NO] ....... [OKAY]
 [WARNING]  Please specify the CUTLASS repo directory as environment variable $CUTLASS_PATH
evoformer_attn ......... [NO] ....... [NO]
fp_quantizer ........... [NO] ....... [OKAY]
fused_lamb ............. [NO] ....... [OKAY]
fused_lion ............. [NO] ....... [OKAY]
inference_core_ops ..... [NO] ....... [OKAY]
cutlass_ops ............ [NO] ....... [OKAY]
transformer_inference .. [NO] ....... [OKAY]
quantizer .............. [NO] ....... [OKAY]
ragged_device_ops ...... [NO] ....... [OKAY]
ragged_ops ............. [NO] ....... [OKAY]
random_ltd ............. [NO] ....... [OKAY]
 [WARNING]  sparse_attn requires a torch version >= 1.5 and < 2.0 but detected 2.3
 [WARNING]  using untested triton version (2.3.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]
--------------------------------------------------
DeepSpeed general environment info:
torch install path ............... ['/home/oscar/.cache/pypoetry/virtualenvs/pippysinglegpu-DD8dToGi-py3.11/lib/python3.11/site-packages/torch']
torch version .................... 2.3.0+cu121
deepspeed install path ........... ['/home/oscar/.cache/pypoetry/virtualenvs/pippysinglegpu-DD8dToGi-py3.11/lib/python3.11/site-packages/deepspeed']
deepspeed info ................... 0.14.2, unknown, unknown
torch cuda version ............... 12.1
torch hip version ................ None
nvcc version ..................... 12.4
deepspeed wheel compiled w. ...... torch 0.0, cuda 0.0
shared memory (/dev/shm) size .... 62.82 GB

System info (please complete the following information):

  • OS: Arch Linux
  • GPU count and types: 1 machine with 1 nvidia 3090
  • Python version: Python 3.11.8
  • Any other relevant info about your setup:

Launcher context
With the Python script provided above.

@oscarkey oscarkey added bug Something isn't working training labels May 2, 2024
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