Describe the bug
SparseMatrix build_from_ndarray error when triplets shape lager than 85
To Reproduce
import taichi as ti
ti.init(arch=ti.cpu)
N = 20
l=86
triplets = ti.Vector.ndarray(n=3, dtype=ti.f32, shape=l)
@ti.kernel
def fill(triplets: ti.types.ndarray()):
for i in range(l):
triplets[i] = ti.Vector([i // N, i % N, i+1], dt=ti.f32)
fill(triplets)
A = ti.linalg.SparseMatrix(n=N, m=N, dtype=ti.f32)
A.build_from_ndarray(triplets)
print(A)
Log/Screenshots
Please post the full log of the program (instead of just a few lines around the error message, unless the log is > 1000 lines). This will help us diagnose what's happening. For example:
$ python my_sample_code.py
[Taichi] version 1.7.2, llvm 15.0.1, commit 0131dce9, win, python 3.11.5
[Taichi] Starting on arch=x64
If ti.init(arch=ti.cpu,debug=True) the log is
$ python my_sample_code.py
[Taichi] version 1.7.2, llvm 15.0.1, commit 0131dce9, win, python 3.11.5
[Taichi] Starting on arch=x64
[E 08/27/24 01:14:08.440 57076] Received signal 11 (SIGSEGV)
***********************************
* Taichi Compiler Stack Traceback *
***********************************
0x7ffbabf64dad: taichi::Time::wait_until in taichi_python.cp311-win_amd64.pyd
0x7ffbabf3f4d0: taichi::lang::Texture::get_device_allocation_ptr_as_int in taichi_python.cp311-win_amd64.pyd
0x7ffbabf3f283: taichi::lang::Texture::get_device_allocation_ptr_as_int in taichi_python.cp311-win_amd64.pyd
0x7ffbabf3fada: taichi::lang::Texture::get_device_allocation_ptr_as_int in taichi_python.cp311-win_amd64.pyd
0x7ffbabd8cede: taichi::lang::Callable::pop_argpack_stack in taichi_python.cp311-win_amd64.pyd
0x7ffbad0c20d4: taichi::Logger::error in taichi_python.cp311-win_amd64.pyd
0x7ffbabf3fc12: taichi::lang::Texture::get_device_allocation_ptr_as_int in taichi_python.cp311-win_amd64.pyd
0x7ffc500c0ef5: seh_filter_exe in ucrtbase.dll
0x7ff692f71f58: OPENSSL_Applink in python.exe
0x7ffc277ae390: _C_specific_handler in VCRUNTIME140.dll
0x7ffc5233292f: _chkstk in ntdll.dll
0x7ffc522e2554: RtlRaiseException in ntdll.dll
0x7ffc5233143e: KiUserExceptionDispatcher in ntdll.dll
0x7ffbabdf4a5d: taichi::lang::vulkan::VulkanDevice::vk_physical_device in taichi_python.cp311-win_amd64.pyd
0x7ffbabe323c0: taichi::lang::vulkan::VulkanDevice::vk_physical_device in taichi_python.cp311-win_amd64.pyd
0x7ffbac3a8c15: taichi::ui::vulkan::Gui::render_pass in taichi_python.cp311-win_amd64.pyd
0x7ffbac1c2f96: taichi::ui::vulkan::Gui::render_pass in taichi_python.cp311-win_amd64.pyd
0x7ffbac1a7d20: taichi::ui::vulkan::Gui::render_pass in taichi_python.cp311-win_amd64.pyd
0x7ffbac39f043: taichi::ui::vulkan::Gui::render_pass in taichi_python.cp311-win_amd64.pyd
0x7ffbac14634f: taichi::ui::vulkan::Gui::render_pass in taichi_python.cp311-win_amd64.pyd
0x7ffbac0a7994: taichi::Time::wait_until in taichi_python.cp311-win_amd64.pyd
0x7ffc0a13392c: PyCFunction_GetFlags in python311.dll
0x7ffc0a0eea11: PyObject_MakeTpCall in python311.dll
0x7ffc0a0eebd1: PyObject_Vectorcall in python311.dll
0x7ffc0a1e6c5a: PyEval_EvalFrameDefault in python311.dll
0x7ffc0a1eaa4e: PyEval_EvalFrameDefault in python311.dll
0x7ffc0a1e2180: PyEval_EvalCode in python311.dll
0x7ffc0a261e1e: PyRun_FileExFlags in python311.dll
0x7ffc0a261ef8: PyRun_FileExFlags in python311.dll
0x7ffc0a261a28: PyRun_StringFlags in python311.dll
0x7ffc0a25f5f5: PyRun_SimpleFileObject in python311.dll
0x7ffc0a25e864: PyRun_AnyFileObject in python311.dll
0x7ffc0a070abc: Py_gitidentifier in python311.dll
0x7ffc0a071493: Py_gitidentifier in python311.dll
0x7ffc0a071830: Py_Main in python311.dll
0x7ff692f71494: OPENSSL_Applink in python.exe
0x7ffc502d7374: BaseThreadInitThunk in KERNEL32.DLL
0x7ffc522dcc91: RtlUserThreadStart in ntdll.dll
Internal error occurred. Check out this page for possible solutions:
https://docs.taichi-lang.org/docs/install
Describe the bug SparseMatrix build_from_ndarray error when triplets shape lager than 85
To Reproduce
Log/Screenshots Please post the full log of the program (instead of just a few lines around the error message, unless the log is > 1000 lines). This will help us diagnose what's happening. For example:
If ti.init(arch=ti.cpu,debug=True) the log is