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
[MLIR][XLA] Fix ops erase bug in DeadTempBufferRemoval #37687
[MLIR][XLA] Fix ops erase bug in DeadTempBufferRemoval #37687
Conversation
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.
Probably safer to do it this way, thanks. Have you seen this fail for some real example? Just curious.
The reason this works currently is that we only remove the current operation and operations that are later, i.e., not the next operation. So we never delete the operation the walk is pointing to (which is the next one).
Still worth doing. Could you address the one comment and re-upload?
// TODO(herhut): There should be a generic helper for this. | ||
recursiveErase(op); | ||
} | ||
opsToErase.clear(); |
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.
This is not really needed, as opsToErase
is going out of scope here.
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.
done
882c731
to
9a7ad6f
Compare
below is a real example
Fatal Python error: Segmentation fault |
Another question, how to add UT for the passes? |
Thanks for the example. It has a store directly after the alloc, which makes this fail. Thanks for catching this.
Currently these cannot be tested, as they are not visible at all. They all have TODOs to turn them into real implementations as opposed to the prototype state they are currently in. A first step would be to move them into a separate file, adding a In the meantime, this should still land. |
This is a PR from JIZHI, the AI platform in Tencent.
@sherhut @River707
I think it will break the DAG struct that recursiveErase called directly when function.walk
The operation which needs erasing should be put in a vector when function.walk firstly and erased after function.walk