taichi-dev / taichi-nerfs

Implementations of NeRF variants based on Taichi + PyTorch
Apache License 2.0
726 stars 49 forks source link

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

Open OAc1 opened 10 months ago

OAc1 commented 10 months ago

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

how can i solve this problem???

bobcao3 commented 10 months ago

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

Gxinhu commented 9 months ago

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 commented 9 months ago

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.