-
-
Notifications
You must be signed in to change notification settings - Fork 11.7k
[Bugfix]Fix a conditional to not check zero value #28754
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
Conversation
Checking zero value would introduce an unnecessary and failing dynamic shape guard in some cases. In this case, checking nonness is sufficient and correct. Signed-off-by: Yanan Cao <gmagogsfm@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request addresses a subtle bug in the logic for reconstructing compilation inputs during the deserialization of a compiled function. The previous implementation using inp or example_inputs[i] would incorrectly discard falsy values such as 0, which can be valid inputs (e.g., for tensor dimensions). The change to inp if inp is not None else example_inputs[i] is correct, as it explicitly checks for None, which is the intended placeholder for runtime tensor inputs. This fix improves the robustness and correctness of the compilation caching mechanism.
|
@zou3519 @ProExpertProg Could you take a quick look at this one-line change? Thanks |
ProExpertProg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM< cc @zhxchen17 @zou3519
|
@gmagogsfm could you just elaborate what the repro for causing this issue is? |
I discovered this issue when debugging a dynamic shape bug. I think |
zhxchen17
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good.
Signed-off-by: Yanan Cao <gmagogsfm@gmail.com>
Signed-off-by: Yanan Cao <gmagogsfm@gmail.com>
Signed-off-by: Yanan Cao <gmagogsfm@gmail.com> Signed-off-by: Runkai Tao <rt572@physics.rutgers.edu>
Signed-off-by: Yanan Cao <gmagogsfm@gmail.com>
Signed-off-by: Yanan Cao <gmagogsfm@gmail.com>
Signed-off-by: Yanan Cao <gmagogsfm@gmail.com>
if inpunintentionally checks zero value in addition to none-ness. This would introduce an unnecessary and failing dynamic shape guard in some cases. Checking none-ness only is sufficient and correct.