You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MatrixFree is not working
by following the blog (https://mp.weixin.qq.com/s/BrgY5U4WBjqPo1smf4DkbA) of MatrixFreeCG in taichi . we test the matrix free cg solver.
none of api(taichi_cg_solver or MatrixFreeCG) is working.
[Taichi] Starting on arch=cuda
[1. 1. 1. 1.]
---------------------------------------------------------------------------
TaichiIndexError Traceback (most recent call last)
Cell In[4], line 22
19 init_b()
20 print(b)
---> 22 ti.linalg.taichi_cg_solver(A, b, x)
File [~/anaconda2/envs/taichi16/lib/python3.10/site-packages/taichi/linalg/taichi_cg.py:100](https://vscode-remote+ssh-002dremote-002bdlhome-002elocal.vscode-resource.vscode-cdn.net/home/fliu/taichisparse_test/~/anaconda2/envs/taichi16/lib/python3.10/site-packages/taichi/linalg/taichi_cg.py:100), in taichi_cg_solver(A, b, x, tol, maxiter, quiet)
97 if not quiet:
98 print(f">>> Iter = {i+1:4}, Residual = {sqrt(new_rTr):e}")
--> 100 solve()
101 vector_fields_snode_tree.destroy()
102 scalar_snode_tree.destroy()
File [~/anaconda2/envs/taichi16/lib/python3.10/site-packages/taichi/linalg/taichi_cg.py:75](https://vscode-remote+ssh-002dremote-002bdlhome-002elocal.vscode-resource.vscode-cdn.net/home/fliu/taichisparse_test/~/anaconda2/envs/taichi16/lib/python3.10/site-packages/taichi/linalg/taichi_cg.py:75), in taichi_cg_solver..solve()
74 def solve():
---> 75 init()
76 initial_rTr = reduce(r, r)
77 if not quiet:
File [~/anaconda2/envs/taichi16/lib/python3.10/site-packages/taichi/lang/kernel_impl.py:976](https://vscode-remote+ssh-002dremote-002bdlhome-002elocal.vscode-resource.vscode-cdn.net/home/fliu/taichisparse_test/~/anaconda2/envs/taichi16/lib/python3.10/site-packages/taichi/lang/kernel_impl.py:976), in _kernel_impl..wrapped(*args, **kwargs)
974 return primal(*args, **kwargs)
975 except (TaichiCompilationError, TaichiRuntimeError) as e:
--> 976 raise type(e)("\n" + str(e)) from None
TaichiIndexError:
File "/home/fliu/anaconda2/envs/taichi16/lib/python3.10/site-packages/taichi/linalg/taichi_cg.py", line 48, in init:
r[I] = b[I]
^^^^
Field with dim 2 accessed with indices of dim 1
we also test the new name api as
ti.linalg.MatrixFreeCG(A,x)
MatrixFree is not named,output as follows
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[7], line 1
----> 1 ti.linalg.MatrixFreeCG(A,x)
AttributeError: module 'taichi.linalg' has no attribute 'MatrixFreeCG'
Additional comments
If possible, please also consider attaching the output of command ti diagnose. This produces the detailed environment information and hopefully helps us diagnose faster.
If you have local commits (e.g. compile fixes before you reproduce the bug), please make sure you first make a PR to fix the build errors and then report the bug.
The text was updated successfully, but these errors were encountered:
Hi @fangde ! Thank you for trying out our MatrixFreeCG. The issue was two-fold:
MatrixFreeCG does not exist in 1.6.0 and will be released in 1.7.0. That's why you saw the following error message
AttributeError: module 'taichi.linalg' has no attribute 'MatrixFreeCG'
The RuntimeError is caused by a previous (known) bug in our CG solver, fortunately it's solved by PR#8070([bug] Fix MatrixFreeCG so it can handle multiple input sizes. #8070). Again, this bug fix will come with 1.7.0. For the moment, please try to use shape=(n,1) instead of shape=n for one-dimension vectors.
MatrixFree is not working
by following the blog (https://mp.weixin.qq.com/s/BrgY5U4WBjqPo1smf4DkbA) of MatrixFreeCG in taichi . we test the matrix free cg solver.
none of api(taichi_cg_solver or MatrixFreeCG) is working.
To Reproduce
we use the sample code in the blog
the output is
we also test the new name api as
MatrixFree is not named,output as follows
Additional comments
If possible, please also consider attaching the output of command
ti diagnose
. This produces the detailed environment information and hopefully helps us diagnose faster.If you have local commits (e.g. compile fixes before you reproduce the bug), please make sure you first make a PR to fix the build errors and then report the bug.
The text was updated successfully, but these errors were encountered: