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

RuntimeError: [auto_diff.cpp:taichi::lang::IndependentBlocksJudger::visit@57] Assertion failure: stmt->dest->is<GlobalPtrStmt>() #89

Open
OAc1 opened this issue Nov 13, 2023 · 3 comments

Comments

@OAc1
Copy link

OAc1 commented Nov 13, 2023

RuntimeError: [auto_diff.cpp:taichi::lang::IndependentBlocksJudger::visit@57] Assertion failure: stmt->dest->is()

how can i solve this problem???

@bobcao3
Copy link

bobcao3 commented Nov 13, 2023

Hi, can you post a code snippet that reproduces this error?

@Gxinhu
Copy link

Gxinhu commented Dec 13, 2023

Hi, can you post a code snippet that reproduces this error?

I have met this problem too, here is the log, and I did not change the original code.

Taichi] version 1.6.0, llvm 15.0.4, commit f1c6fbbd, linux, python 3.11.5
[Taichi] Starting on arch=cuda
Loading 100 train images ...
100it [00:01, 56.59it/s]
Loading 200 test images ...
200it [00:03, 56.61it/s]
Hash Encoder: base_res=16 max_res=1024 hash_level=16 feat_per_level=2 per_level_scale=0.2772588722239781 total_hash_size=5710032 
Failed to import apex FusedAdam, use torch Adam instead.
[E 12/13/23 07:36:09.728 2276023] [auto_diff.cpp:visit@57] Assertion failure: stmt->dest->is<GlobalPtrStmt>()


Traceback (most recent call last):
  File "/workspace/taichi/taichi-nerfs/train.py", line 325, in <module>
    main()
  File "/workspace/taichi/taichi-nerfs/train.py", line 198, in main
    grad_scaler.scale(loss).backward()
  File "/opt/miniconda/lib/python3.11/site-packages/torch/_tensor.py", line 492, in backward
    torch.autograd.backward(
  File "/opt/miniconda/lib/python3.11/site-packages/torch/autograd/__init__.py", line 251, in backward
    Variable._execution_engine.run_backward(  # Calls into the C++ engine to run the backward pass
  File "/opt/miniconda/lib/python3.11/site-packages/torch/autograd/function.py", line 288, in apply
    return user_fn(self, *args)
           ^^^^^^^^^^^^^^^^^^^^
  File "/workspace/taichi/taichi-nerfs/modules/volume_train.py", line 160, in backward
    self._volume_rendering_kernel.grad(
  File "/opt/miniconda/lib/python3.11/site-packages/taichi/lang/kernel_impl.py", line 906, in __call__
    return self.runtime.compiled_functions[key](*args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda/lib/python3.11/site-packages/taichi/lang/kernel_impl.py", line 817, in func__
    raise e from None
  File "/opt/miniconda/lib/python3.11/site-packages/taichi/lang/kernel_impl.py", line 814, in func__
    t_kernel(launch_ctx)
RuntimeError: [auto_diff.cpp:visit@57] Assertion failure: stmt->dest->is<GlobalPtrStmt>()

@Gxinhu
Copy link

Gxinhu commented Dec 13, 2023

Hi, can you post a code snippet that reproduces this error?

I have met this problem too, here is the log, and I did not change the original code.

Taichi] version 1.6.0, llvm 15.0.4, commit f1c6fbbd, linux, python 3.11.5
[Taichi] Starting on arch=cuda
Loading 100 train images ...
100it [00:01, 56.59it/s]
Loading 200 test images ...
200it [00:03, 56.61it/s]
Hash Encoder: base_res=16 max_res=1024 hash_level=16 feat_per_level=2 per_level_scale=0.2772588722239781 total_hash_size=5710032 
Failed to import apex FusedAdam, use torch Adam instead.
[E 12/13/23 07:36:09.728 2276023] [auto_diff.cpp:visit@57] Assertion failure: stmt->dest->is<GlobalPtrStmt>()


Traceback (most recent call last):
  File "/workspace/taichi/taichi-nerfs/train.py", line 325, in <module>
    main()
  File "/workspace/taichi/taichi-nerfs/train.py", line 198, in main
    grad_scaler.scale(loss).backward()
  File "/opt/miniconda/lib/python3.11/site-packages/torch/_tensor.py", line 492, in backward
    torch.autograd.backward(
  File "/opt/miniconda/lib/python3.11/site-packages/torch/autograd/__init__.py", line 251, in backward
    Variable._execution_engine.run_backward(  # Calls into the C++ engine to run the backward pass
  File "/opt/miniconda/lib/python3.11/site-packages/torch/autograd/function.py", line 288, in apply
    return user_fn(self, *args)
           ^^^^^^^^^^^^^^^^^^^^
  File "/workspace/taichi/taichi-nerfs/modules/volume_train.py", line 160, in backward
    self._volume_rendering_kernel.grad(
  File "/opt/miniconda/lib/python3.11/site-packages/taichi/lang/kernel_impl.py", line 906, in __call__
    return self.runtime.compiled_functions[key](*args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda/lib/python3.11/site-packages/taichi/lang/kernel_impl.py", line 817, in func__
    raise e from None
  File "/opt/miniconda/lib/python3.11/site-packages/taichi/lang/kernel_impl.py", line 814, in func__
    t_kernel(launch_ctx)
RuntimeError: [auto_diff.cpp:visit@57] Assertion failure: stmt->dest->is<GlobalPtrStmt>()

After upgrade to taichi 1.7.0, the error is gone.

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