mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Do not forward parent's value range to CSE variable for variables created within codegen. (#123099)
Consider we are generating code for `ops.gt`, and within it we call `ops.to_dtype`. Before, we would forward the bounds from `gt` to the to the result of `to_dtype`, which is wrong. Pull Request resolved: https://github.com/pytorch/pytorch/pull/123099 Approved by: https://github.com/jgong5, https://github.com/peterbell10
This commit is contained in:
parent
edcd968b51
commit
9a5b4d2403
|
|
@ -1456,8 +1456,9 @@ class Kernel(CodeGen):
|
|||
def inner(*args, **kwargs):
|
||||
# TritonTemplateKernel has no current_node
|
||||
buf_bounds = ValueRanges.unknown()
|
||||
if hasattr(V.interpreter, "current_node"):
|
||||
fx_node = V.interpreter.current_node
|
||||
if (
|
||||
fx_node := getattr(V.interpreter, "current_node", None)
|
||||
) and fx_node.target == name:
|
||||
assert isinstance(self.node_to_bounds, dict)
|
||||
buf_bounds = self.node_to_bounds.get(
|
||||
fx_node, ValueRanges.unknown()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user