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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect kernel for binaryOp(scalar, tensor) #1777

Closed
IvanYashchuk opened this issue Jun 27, 2022 · 0 comments 路 Fixed by #1778
Closed

Incorrect kernel for binaryOp(scalar, tensor) #1777

IvanYashchuk opened this issue Jun 27, 2022 · 0 comments 路 Fixed by #1778

Comments

@IvanYashchuk
Copy link
Collaborator

馃悰 Describe the bug

import torch
from torch._C._nvfuser import Fusion, FusionDefinition, DataType

# Construct and Define Fusion
fusion = Fusion()

with FusionDefinition(fusion) as fd :
    t0 = fd.define_tensor(0)
    fd.add_input(t0)
    c0 = fd.define_constant(1.5)
    t1 = fd.Ops.div(c0, t0)
    fd.add_output(t1)

fusion.print_ir()

Output:

Inputs:
  T0_g[ iS0{i0}, iS1{i2} ], float
Outputs:
  T1_g[ iS2{i0}, iS3{i2} ], float

%kernel_math {
T1_g[ iS2{i0}, iS3{i2} ]
   = T0_g[ iS0{i0}, iS1{i2} ] # this should be double(1.5)
   / T0_g[ iS0{i0}, iS1{i2} ];
}

The bug is on this line

BinaryOpType::op_type, v2, v2, TypePromotion::float_op_config); \

Versions

.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant