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

Diffmpm.py crashes during the forward simulation #65

Open
increew opened this issue Mar 18, 2023 · 1 comment
Open

Diffmpm.py crashes during the forward simulation #65

increew opened this issue Mar 18, 2023 · 1 comment

Comments

@increew
Copy link

increew commented Mar 18, 2023

Out-of-bounds Memory Access in the DiffMpm Example

In the example given in diffmpm.py, the code crashes during an iteration of my training process. I found that the there is an array-out-of-bounds access during the forward simulation.

How to reproduce

System specifications

  • OS: Ubuntu 18.04 LTS
  • Taichi version: 1.4.1
  • Python version: 3.9.16

To reproduce the bug, only the forward simulation is needed.

The necessary files are given in https://www.dropbox.com/s/obhpljd9qp8vj10/bug_report.zip?dl=0. The value of parameters weights and bias when the crash happens is given in weights.npy and bias.npy, respectively.

To get a minimal example that reproduces the crash, run the file bug_report.py, which simply loads the value of weights and bias from their corresponding numpy files and run forward simulation for 1500 steps. You would observe the output saying:

[Taichi] version 1.4.1, llvm 15.0.4, commit e67c674e, linux, python 3.9.16
[Taichi] Starting on arch=x64
n_particles 2976
n_solid 2976
Traceback (most recent call last):
  File "/home/user/bug_report.py", line 419, in <module>
    reproduce_bug()
  File "/home/user/bug_report.py", line 364, in reproduce_bug
    forward(1500)
  File "/home/user/bug_report.py", line 254, in forward
    advance(s)
  File "/home/user/miniconda3/envs/tai/lib/python3.9/site-packages/taichi/ad/_ad.py", line 311, in decorated
    func(*args, **kwargs)
  File "/home/user/bug_report.py", line 234, in advance
    p2g(s)
  File "/home/user/miniconda3/envs/tai/lib/python3.9/site-packages/taichi/lang/kernel_impl.py", line 976, in wrapped
    raise type(e)('\n' + str(e)) from None
taichi.lang.exception.TaichiAssertionError:
(kernel=p2g_c82_0) Accessing field (S25place<f32>) of size (128, 128) with indices (-5980, -8119)
@increew increew changed the title Diffmpm.py crashes during the training process Diffmpm.py crashes during the forward simulation Mar 18, 2023
@erizmr
Copy link
Collaborator

erizmr commented Mar 21, 2023

Hi @increew , thanks for reporting this. I can reproduce the bug you mentioned and I think it is induced by simulation numerical overflow.

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

2 participants