DeepSpeed
c84c28d2 - Support cpu tensors without direct device invocation (#3842)

Comment changes are shownComment changes are hidden
Commit
1 year ago
Support cpu tensors without direct device invocation (#3842) Motivation: Fix for reproducible issue #3837 on cpu. On cpus direct invocation of torch.cpu.tensor leads to dtype mismatch. Another way would be to have something like : ["torch.DoubleTensor" if device_type == 'cpu else '"torch.{}.DoubleTensor".format(device_type)] for all elements in the supported list , but that would eliminate "torch.cpu.DoubleTensor" ,etc from the scope. @jeffra requesting review. CLA is signed --------- Co-authored-by: Olatunji Ruwase <olruwase@microsoft.com> Co-authored-by: inkcherry <mingzhi.liu@intel.com>
Author
Parents
  • deepspeed/runtime
    • File
      engine.py
    • File
      sparse_tensor.py