-
Notifications
You must be signed in to change notification settings - Fork 84
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
Operator support for F.one_hot
#64
Comments
Hello @kyo-takano , thank you for trying out thunder! This is the thunder way (we should have a FAQ) of saying "this operator is not supported yet in thunder". We are actually working on giving a better error message. If you want to have a comprehensive check on whether a model you want to run has ops we don't support yet, you can use Implementing an operator like |
Thanks @t-vi This is just a heads up, as I'd expect to see many issues of the same kind, given that functional operations like this are used everywhere in PyTorch implementations. This bug is something that does not occur with the native compiler regardless of the chosen backend. So, if |
Thank you @kyo-takano, the limitation is not related to functional operations per se, but the number of ops we currently support. They will grow quickly, but it’ll take a bit. For this reason (and we’ll add a FAQ soon) Thunder is not intended to be a drop in replacement for torch.compile at this stage, with the same coverage of torch.compile. However we do focus on:
What model are you targeting specifically? |
Thank you @lantiga
Understood. Thanks for clarifying these points.
I don't have a particular model I need to compile with |
Hi everyone, I'm new to contributing to open-source and very interested in the Thunder project. I noticed this issue on and I'd love to take on this opportunity to contribute. I have some experience with Python and Pytorch and am eager to learn more about Thunder and PyTorch internals. Could I possibly take on this issue? Any guidance or suggestions on how to get started would be greatly appreciated! |
Thank you for the support. I am starting to work on implementing support for the Could one of the collaborators please assign this issue to me? Thanks! |
Awesome, welcome aboard! Looking forward to your contribution. One super-useful thing you could do is record your journey as a first contributor so we can create more onboarding material and address the papercuts. |
Hey, @kyo-takano , thank you for the issue! Hey, @shaharelys , super excited about your interest in helping us out! A couple of, hopefully, helpful notes:
If you have any questions, do not hesitate to ping me! Have fun and thank you! |
@nikitaved, thank you for the detailed guidance!
Also, I'd like to know the typical timeline for resolving issues like this. Recognizing that I'm new and still catching up, I want to set realistic expectations for my contribution timeline. What is usually anticipated? Thank you for your support! |
Always happy to help!
These should be more than enough to start with operations.
You are correct! This simplifies things a lot!
Take as much time as you need. The outcome may turn out to be just as simple as adding a lightning-thunder/thunder/torch/__init__.py Line 1182 in f2e48b3
In fact, if you think that we are missing some simple activation functions, you could open an issue, work on them, and then return to one_hot back once you are comfortable with the codebase.
|
Hey @lantiga , per your request, I will try to list things that it took some time for me to understand and I think a better onboarding material could help. For me the easiest way is to just write these here under this thread from time to time. Will that work for you guys? Just note that I am very new to open source and I am still a junior so some of my comments might be subject to my lack of experience and not to lack of onboarding material. Anyways, for me it is hard to tell the difference so this is just a little heads up (: Here are my initial comments (some are also questions):
|
Hey, @shaharelys ! Congrats on your |
Hey @nikitaved! Actually, I think I'm handling this for now. We will likely have the PR for this ready soon, I believe. But since you asked, just a quick question; I've already got the basic structure set up:
I could find all needed methods as building blocks, but not |
@shaharelys I guess we should have argmax. |
@shaharelys , I also suspect that we might have issues with |
I believe the latest is that we treat numeric inputs as constants, and NumberProxies should only be generated for numbers whose value is only determined at runtime (like those coming from calls to
|
🐛 Bug
thunder
fails When attempting to compile a graph containingtorch.nn.functional.one_hot
within the forward pass.The error message indicates that the input to the method must be a
Tensor
, but aTensorProxy
is received instead.To Reproduce
Steps to reproduce the behavior:
F.one_hot
to convert the input tensor to a one-hot encoded representation.thunder.jit
.Example
Output
Environment
Additional context
F.relu
doesn't seem to raise the issue.The text was updated successfully, but these errors were encountered: