Skip to content

onemkl_gemv example expanded: iterative linear solver example working #821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Apr 28, 2022

Conversation

oleksandr-pavlyk
Copy link
Contributor

@oleksandr-pavlyk oleksandr-pavlyk commented Apr 24, 2022

This is the example with Chebyshev solver and conjugate gradient descent solver based on oneMKL gemv call.

@github-actions
Copy link

@coveralls
Copy link
Collaborator

coveralls commented Apr 24, 2022

Coverage Status

Coverage remained the same at 82.918% when pulling fc7041e on chebyshev_example into 22d231c on master.

@oleksandr-pavlyk oleksandr-pavlyk changed the title onemkl_gemv example expanded: chebyshev example working onemkl_gemv example expanded: iterative linear solver example working Apr 25, 2022
@oleksandr-pavlyk
Copy link
Contributor Author

oleksandr-pavlyk commented Apr 26, 2022

I think this PR completes #749

The header and routines defined there are also used in standalone_cpp
target built from cpp/main.cpp

```
(idp_2022) [08:27:56 ansatnuc04 onemkl_gemv]$ $(find . -name cmake-build)/standalone_cpp 1000 11
Solving 1000 by 1000 diagonal system with rank-11 perturbation.
Converged in : 11 , 11 , 11 , 11 , 11 , 11 ,
Wall-clock cg_solve execution times: 683.416 , 408.391 , 411.849 , 412.661 , 412.317 , 412.658 ,
Redisual norm squared: 9.15541e-25
(idp_2022) [08:28:20 ansatnuc04 onemkl_gemv]$ python sycl_timing_solver.py 1000 11
Solving 1000 by 1000 diagonal linear system with rank 11 perturbation.
    Name            Intel(R) UHD Graphics [0x9bca]
    Driver version  1.3.22992
    Vendor          Intel(R) Corporation
    Profile         FULL_PROFILE
    Filter string   level_zero:gpu:0

Using not in-order queue
0 (host_dt, device_dt)= (1156.8981241434813, 404.2941620000001)
1 (host_dt, device_dt)= (422.38221131265163, 404.5959500000001)
2 (host_dt, device_dt)= (423.1058154255152, 404.4037220000001)
3 (host_dt, device_dt)= (422.79740050435066, 403.78802800000005)
4 (host_dt, device_dt)= (424.4473725557327, 404.0881560000001)
5 (host_dt, device_dt)= (425.1241758465767, 404.55793600000004)
Converged in:  [11, 11, 11, 11, 11, 11]
Python solution residual norm squared: 3.5289368114384933e-25
```

README is also expanded.
Expose cpp_cg_solve used in standalone_cpp executable from Python.
Invoked that from Python script sycl_timing_solver.py

```bash
$ python sycl_timing_solver.py 1000 11
Solving 1000 by 1000 diagonal linear system with rank 11 perturbation.
    Name            Intel(R) UHD Graphics [0x9bca]
    Driver version  1.3.22992
    Vendor          Intel(R) Corporation
    Profile         FULL_PROFILE
    Filter string   level_zero:gpu:0

Using not in-order queue
0 (host_dt, device_dt)= (1157.4030127376318, 403.9605020000001)
1 (host_dt, device_dt)= (421.32044583559036, 403.45619400000004)
2 (host_dt, device_dt)= (420.66121101379395, 402.57058400000005)
3 (host_dt, device_dt)= (421.5433243662119, 402.9254920000001)
4 (host_dt, device_dt)= (421.9988752156496, 402.8818340000001)
5 (host_dt, device_dt)= (422.3589450120926, 402.63814600000006)
Converged in:  [11, 11, 11, 11, 11, 11]
Python solution residual norm squared: 3.2839902926527995e-25
0 (host_dt, device_dt)= (412.9443597048521, 403.6290000000001)
1 (host_dt, device_dt)= (413.7023724615574, 403.8434720000001)
2 (host_dt, device_dt)= (413.4188834577799, 403.1985620000001)
3 (host_dt, device_dt)= (413.85203413665295, 402.70404800000006)
4 (host_dt, device_dt)= (416.2806496024132, 404.0513040000001)
5 (host_dt, device_dt)= (417.43320040404797, 404.74999800000006)
Converged in:  [11, 11, 11, 11, 11, 11]
cpp_cg_solve solution residual norm squared: 3.218393087932091e-25
```
@oleksandr-pavlyk oleksandr-pavlyk merged commit abcfc5d into master Apr 28, 2022
@oleksandr-pavlyk oleksandr-pavlyk deleted the chebyshev_example branch April 28, 2022 00:58
@github-actions
Copy link

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants