You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't have a failing case with devel, but encountered a problem with #2480.
ValReplacementMutator traverses all fusion vals and exprs from inputs to outputs. For an expression, mutate is called for its inputs, and then mutate is called for the expression itself, and then finally it's called for the outputs. This means that when mutating an expression, its outputs are not yet mutated. However, in OptOutMutator::mutate(Expr*), it seems it assumes the outputs are already mutated:
Since they are not yet mutated, maybeMutated should always just return the original (unmutated) output, even when they may eventually be mutated when mutate is called for them. This could obviously result in inconsistent states. For example, if an output is indeed mutated, its defining expression may not be created since when mutating the expression it may determine nothing is mutated.
I encountered some strange error due to this when ValReplacementMutator was used by replaceSymbolicSizes.
I think ValReplacementMutator should first visit all vals and mutate them as needed, and then visit all exprs.
The text was updated successfully, but these errors were encountered:
pytorch/third_party/nvfuser/csrc/ir_utils.cpp
Line 435 in 8ed9540
I don't have a failing case with devel, but encountered a problem with #2480.
ValReplacementMutator
traverses all fusion vals and exprs from inputs to outputs. For an expression,mutate
is called for its inputs, and thenmutate
is called for the expression itself, and then finally it's called for the outputs. This means that when mutating an expression, its outputs are not yet mutated. However, inOptOutMutator::mutate(Expr*)
, it seems it assumes the outputs are already mutated:https://github.com/csarofeen/pytorch/blob/devel/third_party/nvfuser/csrc/mutator.cpp#L131
Since they are not yet mutated,
maybeMutated
should always just return the original (unmutated) output, even when they may eventually be mutated whenmutate
is called for them. This could obviously result in inconsistent states. For example, if an output is indeed mutated, its defining expression may not be created since when mutating the expression it may determine nothing is mutated.I encountered some strange error due to this when
ValReplacementMutator
was used byreplaceSymbolicSizes
.I think
ValReplacementMutator
should first visit all vals and mutate them as needed, and then visit all exprs.The text was updated successfully, but these errors were encountered: