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

Less strict in enforcing a Tensor being used in forward pass? #4325

Open
ziliangpeng opened this issue Apr 27, 2024 · 1 comment
Open

Less strict in enforcing a Tensor being used in forward pass? #4325

ziliangpeng opened this issue Apr 27, 2024 · 1 comment

Comments

@ziliangpeng
Copy link
Contributor

It seems tinygrad is being quite strict in ensuring a Tensor has grad (used in forward). https://github.com/tinygrad/tinygrad/blob/master/tinygrad/tensor.py#L652

    for t0 in reversed(self.deepwalk()):
      if t0.grad is None: raise RuntimeError(f"tensor {t0} has no grad")

This makes it less easy to play with stuff (running WIP model, having unused Tensor lingering as part of model).

Can we make it less strict about this validation, at least in some sort of debug mode (DEBUG>3)? Can we skip those tensors during backward, instead of raise?

@chenyuxyz
Copy link
Collaborator

can you provide a full example for what you are trying to do?

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