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

How to revert the mutated IR into source code? #2

Open
cicilzx opened this issue May 29, 2023 · 5 comments
Open

How to revert the mutated IR into source code? #2

cicilzx opened this issue May 29, 2023 · 5 comments

Comments

@cicilzx
Copy link

cicilzx commented May 29, 2023

Hi, I have read your OOPSLA paper and I find the work very interesting!
I would like to ask, after doing mutation on IR, how do you revert to the kind of source code in the bug report? I haven't looked at the code in this repo carefully, can you briefly describe the process or tell me where the code is located? Thanks in advance!

@ganler
Copy link
Member

ganler commented May 29, 2023

@cicilzx
Copy link
Author

cicilzx commented May 29, 2023

Hi, thanks for your interest. https://github.com/ise-uiuc/tzer/blob/main/src/tzer/context.py#L238

Thanks, I guess this is the code related to ${BUG_TYPE}_${BUG_ID}.ctx in output folder? But I'm curious how to generate the corresponding python code (as a test program that can be submit to the compiler developer) based on this context?

@ganler
Copy link
Member

ganler commented May 29, 2023

In theory you can just print the TIR and rematerialize it with TVM script. I cannot recall the details since it has been a while. I guess the worst case is to manually construct the Python code according to the printed text. Good luck!

@KuiliangL
Copy link

KuiliangL commented Jun 12, 2023

Hello, if I reproduce the error code, how can I find the root causes? It seems that you used GDB to find errors, do you use other tips and tools? Thanks

@ganler
Copy link
Member

ganler commented Jun 13, 2023

Oftentimes we just compile TVM with debug mode and do gdb --args python YOUR_SCRIPT.py and it can show you the point it crashed. But of course if you can get the original TIR then you may simply do mod = tvm.lower(f) and tvm.build(mod) to see if it can be reproduced -- if reproduced you can just file a bug to the TVM community. Also note that Tzer does not guarantee that generated TIR is runtime-valid -- as such if it crashed at execution time it might not be a real bug.

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

No branches or pull requests

3 participants