deepspeedai / deepspeedai/DeepSpeed

torch.cdist does not work

Open
#939 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
43.1k
Forks
5k
Avg merge
4d 15h
Merged PRs (30d)
112

Description

Hi - torch cdist cuda is not implemented for fp16. How could I fix?

    return th.cdist(x, y, p=2)
  File "/home/ubuntu/anaconda3/envs/torch/lib/python3.7/site-packages/torch/functional.py", line 1119, in cdist
    return _VF.cdist(x1, x2, p, None)  # type: ignore
RuntimeError: "cdist_cuda" not implemented for 'Half'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure from the reported torch.cdist call with fp16 inputs, then inspect torch/functional.py around line 1119 and the reported cdist_cuda path. Determine the supported behavior for this input and verify that the issue is resolved with a focused regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.