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

Use runtime value of NumberProxy if it is produced by an operator (#231) #244

Merged
merged 7 commits into from
Jun 13, 2024

Conversation

kiya00
Copy link
Collaborator

@kiya00 kiya00 commented Apr 22, 2024

What does this PR do?

Try to fix #231.

The changes in this PR go through all the NumberProxy in saved_for_backward, replace it with the value in NumberProxy if it has no producer in the forward trace, otherwise keep the NumberProxy

@IvanYashchuk
Copy link
Collaborator

Could you please explain in the issue why is it a problem and what do you want to achieve?

@IvanYashchuk
Copy link
Collaborator

@jjsjann123, with this PR your example script from #541 (comment) works!

@IvanYashchuk IvanYashchuk reopened this Jun 11, 2024
Copy link
Collaborator

@IvanYashchuk IvanYashchuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kiya00, I have reopened this pull request because I think this is the correct fix for the bugs we have. I'm sorry that I missed it somehow.

Could you please add this example #541 (comment) as a test case.

thunder/core/transforms.py Show resolved Hide resolved
thunder/core/transforms.py Show resolved Hide resolved
@kiya00
Copy link
Collaborator Author

kiya00 commented Jun 12, 2024

Hi @IvanYashchuk , I have added the test, please take another look~

@t-vi t-vi enabled auto-merge (squash) June 12, 2024 11:18
@IvanYashchuk
Copy link
Collaborator

@t-vi, could you please merge this PR?

Copy link
Collaborator

@t-vi t-vi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@t-vi t-vi merged commit 69e80f0 into main Jun 13, 2024
36 checks passed
@t-vi t-vi deleted the trytofix231 branch June 13, 2024 07:40
@jjsjann123 jjsjann123 mentioned this pull request Jun 26, 2024
4 tasks
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 this pull request may close these issues.

If saved_for_backward returns NumberProxy, the value is taken from compile time, not runtime
4 participants