Closed BillXu2000 closed 2 years ago
I had the same issue while running the example billiards.py I'm using Ubuntu 18.04 and python3.6
(taichi) jc@jc-Precision-7530:~/jiacheng/examples$ python billiards.py
[Taichi] version 0.8.10, llvm 10.0.0, commit 016feb38, linux, python 3.6.9
[Taichi] Starting on arch=x64
[E 01/24/22 22:45:51.257 7889] [ir.h:as@226] Assertion failure: is<T>()
***********************************
* Taichi Compiler Stack Traceback *
***********************************
/home/jc/Envs/taichi/lib/python3.6/site-packages/taichi/_lib/core/taichi_core.so: taichi::Logger::error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)
/home/jc/Envs/taichi/lib/python3.6/site-packages/taichi/_lib/core/taichi_core.so: taichi::lang::AdStackAllocaStmt* taichi::lang::IRNode::as<taichi::lang::AdStackAllocaStmt>()
/home/jc/Envs/taichi/lib/python3.6/site-packages/taichi/_lib/core/taichi_core.so: taichi::lang::ControlFlowGraph::determine_ad_stack_size(int)
/home/jc/Envs/taichi/lib/python3.6/site-packages/taichi/_lib/core/taichi_core.so: taichi::lang::irpass::determine_ad_stack_size(taichi::lang::IRNode*, taichi::lang::CompileConfig const&)
/home/jc/Envs/taichi/lib/python3.6/site-packages/taichi/_lib/core/taichi_core.so: taichi::lang::irpass::offload_to_executable(taichi::lang::IRNode*, taichi::lang::CompileConfig const&, taichi::lang::Kernel*, bool, bool, bool, bool, bool)
/home/jc/Envs/taichi/lib/python3.6/site-packages/taichi/_lib/core/taichi_core.so: taichi::lang::irpass::compile_to_executable(taichi::lang::IRNode*, taichi::lang::CompileConfig const&, taichi::lang::Kernel*, bool, bool, bool, bool, bool, bool, bool, bool)
/home/jc/Envs/taichi/lib/python3.6/site-packages/taichi/_lib/core/taichi_core.so: taichi::lang::Kernel::lower(bool)
/home/jc/Envs/taichi/lib/python3.6/site-packages/taichi/_lib/core/taichi_core.so: taichi::lang::LlvmProgramImpl::compile(taichi::lang::Kernel*, taichi::lang::OffloadedStmt*)
/home/jc/Envs/taichi/lib/python3.6/site-packages/taichi/_lib/core/taichi_core.so: taichi::lang::Program::compile(taichi::lang::Kernel&, taichi::lang::OffloadedStmt*)
/home/jc/Envs/taichi/lib/python3.6/site-packages/taichi/_lib/core/taichi_core.so: taichi::lang::Kernel::compile()
/home/jc/Envs/taichi/lib/python3.6/site-packages/taichi/_lib/core/taichi_core.so: taichi::lang::Kernel::operator()(taichi::lang::Kernel::LaunchContextBuilder&)
/home/jc/Envs/taichi/lib/python3.6/site-packages/taichi/_lib/core/taichi_core.so(+0x3fa00a) [0x7f700e0c000a]
/home/jc/Envs/taichi/lib/python3.6/site-packages/taichi/_lib/core/taichi_core.so(+0x3b394e) [0x7f700e07994e]
python(_PyCFunction_FastCallDict+0x35c) [0x5675fc]
python() [0x5953c1]
python() [0x54b0a5]
python(_PyObject_FastCallKeywords+0x19c) [0x5aa2ac]
python() [0x50a7f3]
python(_PyEval_EvalFrameDefault+0x444) [0x50c274]
python() [0x507f94]
python() [0x5894db]
python(PyObject_Call+0x3e) [0x5a00ce]
python(_PyEval_EvalFrameDefault+0x17e7) [0x50d617]
python() [0x507f94]
python(_PyFunction_FastCallDict+0x2e2) [0x509272]
python() [0x595351]
python() [0x54af3f]
python(PyObject_Call+0x3e) [0x5a00ce]
python(_PyEval_EvalFrameDefault+0x17e7) [0x50d617]
python() [0x509989]
python() [0x50a6bd]
python(_PyEval_EvalFrameDefault+0x444) [0x50c274]
python(_PyFunction_FastCallDict+0xf5) [0x509085]
python() [0x595351]
python(_PyObject_FastCallDict+0x17c) [0x5a4cac]
python(PyObject_CallFunctionObjArgs+0xd8) [0x5a5378]
python(_PyEval_EvalFrameDefault+0x1af0) [0x50d920]
python() [0x509989]
python() [0x50a6bd]
python(_PyEval_EvalFrameDefault+0x444) [0x50c274]
python() [0x507f94]
python(PyEval_EvalCode+0x23) [0x50b0d3]
python() [0x634dc2]
python(PyRun_FileExFlags+0x97) [0x634e77]
python(PyRun_SimpleFileExFlags+0x17f) [0x63862f]
python(Py_Main+0x591) [0x6391d1]
python(main+0xe0) [0x4b0d30]
/lib/x86_64-linux-gnu/libc.so.6: __libc_start_main
python(_start+0x2a) [0x5b2a5a]
Internal error occurred. Check out this page for possible solutions:
https://docs.taichi.graphics/lang/articles/misc/install
Traceback (most recent call last):
File "billiards.py", line 212, in <module>
optimize()
File "billiards.py", line 169, in optimize
forward(visualize=True, output=output)
File "/home/jc/Envs/taichi/lib/python3.6/site-packages/taichi/lang/tape.py", line 18, in __exit__
self.grad()
File "/home/jc/Envs/taichi/lib/python3.6/site-packages/taichi/lang/tape.py", line 27, in grad
func.grad(*args)
File "/home/jc/Envs/taichi/lib/python3.6/site-packages/taichi/lang/kernel_impl.py", line 665, in __call__
return self.compiled_functions[key](*args)
File "/home/jc/Envs/taichi/lib/python3.6/site-packages/taichi/lang/kernel_impl.py", line 617, in func__
t_kernel(launch_ctx)
RuntimeError: [ir.h:as@226] Assertion failure: is<T>()
I had the same issue while running the example billiards.py I'm using Ubuntu 18.04 and python3.6
I think it is a different problem. The bug I reported is directly cause by #3989 , which is closely related to mesh-for features in Taichi.
It seems that as<MeshRelationAccessStmt>()
in mesh_bls_analyzer.cpp
will cause assertion failure when idx
is not a MeshRelationAccessStmt
.
@g1n0st
fixed by #4529.
Describe the bug It seems that #3989 cause the problem. See code and results below.
To Reproduce
Log/Screenshots Before #3989:
After #3989: