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

[Lang] Fix python AST print format issues in python/taichi/lang/transformer.py #3061

Merged
merged 1 commit into from
Oct 1, 2021

Conversation

gaocegege
Copy link
Collaborator

@gaocegege gaocegege commented Sep 30, 2021

Test case:

ti.init(print_ir=True,print_preprocessed=True)
@ti.kernel
def func():
    (a, b) = (1, 2)
    print(a, b)

There are formatting inconsistencies between print_ir and print_preprocess. The output before the PR looks like:

[Taichi] version 0.8.1, llvm 10.0.0, commit cc2dd342, osx, python 3.7.9
[Taichi] Starting on arch=x64
Initial AST:
def func():
...
Preprocessed:
def func():
...
[I 09/30/21 16:42:14.133 16716489] [compile_to_offloads.cpp:operator()@22] [func_c4_0] Initial IR:
kernel {
...
[I 09/30/21 16:42:14.134 16716489] [compile_to_offloads.cpp:operator()@22] [func_c4_0] Lowered:
...

This PR is to make it consistent (with) logic here https://github.com/taichi-dev/taichi/blob/master/taichi/transforms/compile_to_offloads.cpp#L17:

[Taichi] version 0.8.1, llvm 10.0.0, commit cc2dd342, osx, python 3.7.9
[Taichi] Starting on arch=x64
[I 09/30/21 16:45:23.741 16718700] [transformer.py:print_ast@28] Initial AST:
def func():
...
[I 09/30/21 16:45:35.869 16719262] [transformer.py:print_ast@28] Preprocessed:
def func():
...
[I 09/30/21 16:42:14.133 16716489] [compile_to_offloads.cpp:operator()@22] [func_c4_0] Initial IR:
kernel {
...
[I 09/30/21 16:42:14.134 16716489] [compile_to_offloads.cpp:operator()@22] [func_c4_0] Lowered:
...

@netlify
Copy link

netlify bot commented Sep 30, 2021

✔️ Deploy Preview for jovial-fermat-aa59dc canceled.

🔨 Explore the source changes: f42dca2

🔍 Inspect the deploy log: https://app.netlify.com/sites/jovial-fermat-aa59dc/deploys/6156546438a3b100076b4779

@gaocegege gaocegege changed the title [Lang] fix python AST print format issues in python/taichi/lang/transformer.py [Lang] Fix python AST print format issues in python/taichi/lang/transformer.py Sep 30, 2021
Copy link
Member

@k-ye k-ye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@gaocegege
Copy link
Collaborator Author

The CI https://github.com/taichi-dev/taichi/pull/3061/checks?check_run_id=3753886990 is canceled because of the timeout, what should I do to fix it?

@k-ye
Copy link
Member

k-ye commented Sep 30, 2021

The CI https://github.com/taichi-dev/taichi/pull/3061/checks?check_run_id=3753886990 is canceled because of the timeout, what should I do to fix it?

That's a known problem... Just push something to retrigger it (I've already retriggered this time)

@gaocegege
Copy link
Collaborator Author

Gotcha, thanks for the information.

@gaocegege
Copy link
Collaborator Author

The Windows CI is flaky. I will retry again.

@gaocegege gaocegege force-pushed the preprocess branch 2 times, most recently from 2892dcb to edb028d Compare October 1, 2021 00:20
@gaocegege
Copy link
Collaborator Author

Finally, all tests are passed.

@k-ye k-ye merged commit ae33bb3 into taichi-dev:master Oct 1, 2021
@gaocegege gaocegege deleted the preprocess branch October 1, 2021 09:14
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

Successfully merging this pull request may close these issues.

2 participants