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

[Bug] Numerical error with Taichi v1.2.0 #6441

Closed
turbo0628 opened this issue Oct 26, 2022 · 1 comment · Fixed by #6462
Closed

[Bug] Numerical error with Taichi v1.2.0 #6441

turbo0628 opened this issue Oct 26, 2022 · 1 comment · Fixed by #6462
Labels
bug We've confirmed that this is an BUG

Comments

@turbo0628
Copy link
Member

Thanks to @lucifer1004 who encountered this bug in his development.

This bug is backend neural: cpu / cuda / vulkan all behave consistently.

Minimal reproduction

Briefings:

The init part is good, but the main function adj_cellwise_hlpr gets unexpected value in the field self.f_r if you comment out the print statement at this line.

The v1.1.3 has no numerical problem. We should check which newly added pass caused the error.

@turbo0628 turbo0628 added the bug We've confirmed that this is an BUG label Oct 26, 2022
@taichi-gardener taichi-gardener moved this to Untriaged in Taichi Lang Oct 26, 2022
@lin-hitonami
Copy link
Contributor

It's my fault. cache_loop_invariant_global_vars pass does not set the init value to the cached variable if the first instruction in the block accessing the variable is store (in this case it may not be executed because it is after a conditional break). The easiest fix is setting the init value all the time.

@neozhaoliang neozhaoliang moved this from Untriaged to In Progress in Taichi Lang Oct 28, 2022
lin-hitonami added a commit that referenced this issue Oct 28, 2022
Issue: fixes #6441

### Brief Summary

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Repository owner moved this from In Progress to Done in Taichi Lang Oct 28, 2022
jim19930609 pushed a commit to jim19930609/taichi that referenced this issue Oct 31, 2022
Issue: fixes taichi-dev#6441

### Brief Summary

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug We've confirmed that this is an BUG
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants