迭代求解矩阵测试

本文通过测试发现CUDA实现的矩阵求解速度比CPU快417倍。针对Poisson问题,使用不同的预条件器进行迭代求解,如CG、GMRES和bicgstab。结果显示,bicgstab无法收敛,而采用AINV预条件器的求解效果较好,尤其是在调整参数后,能在较短时间内达到收敛。预条件器的效率对解决大型矩阵问题至关重要。
部署运行你感兴趣的模型镜像

code of  cuda is 417 times faster than code of cpu

poisson5point(no preconditioner)

1000*1000  cg: 1021 收敛

gmres(50)   261

gmres(100) 217

cg_m  1269  时间都差不多

bicgstab   无穷大,不收敛


smooth_aggregate: 2.9second

Preconditioner statistics
Number of Levels:5
Operator Complexity:1.32831745
Grid Complexity:1.148772
level unknownsnonzeros:
0 10000004996000[75.2832086%]
1 1401101512942[22.7980641%]
2 8289121945[1.83755222%]
3 3565218[0.0786284593%]
4 17169[0.00254660974%]


AINV

Successfully converged after 1269 iterations.
Solver converged to 1.000000e+00 tolerance after 1269 iterations (9.738784e-01 final residual)
In [no preconditer]:6.296808004e+00 seconds


Solving with scaled bridson preconditioner (drop tolerance .1)
Solver converged to 1.000000000e+00 tolerance after 656 iterations (9.973784685e-01 final residual)
In [ainv preconditer(drop .1)]:2.055588698e+01 seconds


Solving with scaled bridson preconditioner (10 nonzeroes per row)
Solver converged to 1.000000000e+00 tolerance after 370 iterations (9.866030216e-01 final residual)
In [ainv preconditer static]:5.647993302e+01 seconds


Solving with AINV preconditioner (Lin strategy, p=2)
Solver converged to 1.000000000e+00 tolerance after 603 iterations (9.798558950e-01 final residual)
In [ainv preconditer static]:4.361557293e+01 seconds

您可能感兴趣的与本文相关的镜像

PyTorch 2.5

PyTorch 2.5

PyTorch
Cuda

PyTorch 是一个开源的 Python 机器学习库,基于 Torch 库,底层由 C++ 实现,应用于人工智能领域,如计算机视觉和自然语言处理

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值