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

matmul expreval cannot handle output stride order #2427

Open
jjsjann123 opened this issue Jun 14, 2024 · 0 comments
Open

matmul expreval cannot handle output stride order #2427

jjsjann123 opened this issue Jun 14, 2024 · 0 comments
Assignees

Comments

@jjsjann123
Copy link
Collaborator

This is to follow up with #2426 's comment #2354 (comment)

import torch
from nvfuser import FusionDefinition, DataType

def fusion_func(fd: FusionDefinition):
    T0 = fd.define_tensor(shape=[-1, -1], contiguity=[True, True], dtype=DataType.Float, is_cpu=False, stride_order=[1, 0])
    T1 = fd.define_tensor(shape=[-1, -1, -1], contiguity=[True, True, True], dtype=DataType.Float, is_cpu=False, stride_order=[2, 1, 0])                                                                                                                                  
    T2 = fd.ops.linear(T1, T0)
    S3 = fd.define_scalar(1.41421, dtype=DataType.Double)
    T4 = fd.ops.mul(T2, S3)
    fd.add_output(T2, (2, 1, 0))
    fd.add_output(T4)

with FusionDefinition() as fd:
    fusion_func(fd)
                                                                                                                 
inputs = [
    torch.randn((8, 4), dtype=torch.float32, device='cuda:0'),
    torch.randn((6, 8, 4,), dtype=torch.float32, device='cuda:0')
]
fd.execute(inputs)
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

No branches or pull requests

2 participants