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

Thunder's vjp doesn't compute the result for variadic arguments #1429

Open
IvanYashchuk opened this issue Nov 12, 2024 · 0 comments
Open

Thunder's vjp doesn't compute the result for variadic arguments #1429

IvanYashchuk opened this issue Nov 12, 2024 · 0 comments

Comments

@IvanYashchuk
Copy link
Collaborator

🐛 Bug

import torch
import thunder

def f(*args):
    a, b = args
    c = a + b
    return c

def ff(*args):
    return thunder.core.transforms.value_and_grad(f)(*args)

a = torch.ones(3)
b = torch.ones(3)
cff = thunder.jit(ff)
print(cff(a, b)) # Returns (tensor([2., 2., 2.]), (None, None))

There should be ones instead of Nones.

It's probably happening because "unpacking" operations are ignored in

def backward_pass(forward_env, trace, init_cotangents):

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

No branches or pull requests

1 participant