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

prims.div inconsistencies between executors for integer tensors #818

Closed
nikitaved opened this issue Jul 22, 2024 · 0 comments · Fixed by #821
Closed

prims.div inconsistencies between executors for integer tensors #818

nikitaved opened this issue Jul 22, 2024 · 0 comments · Fixed by #821
Assignees
Labels
bug Something isn't working operators

Comments

@nikitaved
Copy link
Contributor

nikitaved commented Jul 22, 2024

Likely the cause of #808

In [1]: import torch, thunder

In [2]: def f(x, y):
   ...:     return thunder.prims.div(x, y)
   ...: 

In [3]: x = torch.randint(1, 10, (3, 3), device="cuda")

In [4]: y = torch.randint(1, 10, (3, 3), device="cuda")

In [5]: jf = thunder.jit(f)

In [6]: jf(x.cpu(), y.cpu())
Out[6]: 
tensor([[0, 1, 1],
        [0, 0, 2],
        [0, 0, 0]])

In [7]: jf(x, y)
Out[7]: 
tensor([[0.2500, 1.3333, 1.0000],
        [0.3333, 0.1250, 2.2500],
        [0.1429, 0.3750, 0.5000]], device='cuda:0')

In [8]: trace = thunder.last_traces(jf)[-1]

In [9]: print(trace)
# Constructed by Delete Last Used (took 0 milliseconds)
import torch
from thunder.executors.torchex import no_autocast

@torch.no_grad()
@no_autocast
def computation(x, y):
  # x: "cuda:0 i64[3, 3]"
  # y: "cuda:0 i64[3, 3]"
  [t0] = nvFusion0(x, y)
    # t0 = prims.div(x, y)  # t0: "cuda:0 i64[3, 3]"
  del x, y
  return t0

cc @apaz-cli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working operators
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant