Uh oh!
There was an error while loading. Please reload this page.
Add new blas extension and update dpnp.matmul func - #1616
Conversation
View rendered docs @ https://intelpython.github.io/dpnp/index.html |
npolina4
left a comment
There was a problem hiding this comment.
The result does not match with numpy
importnumpy, dpnpdefinit():
N=5A=numpy.empty((N, N), dtype=numpy.float32)
foriinrange(N):
A[i, : i+1] =numpy.fromfunction(lambdaj: (-j%N) /N+1, (i+1,))
A[i, i+1 :] =0.0A[i, i+1 :] =0.0returnAdefkernel(A):
foriinrange(A.shape[0]):
forjinrange(i):
A[i, j] -=A[i, :j] @ A[:j, j]
a=init()
b=dpnp.asarray(a)
kernel(a)
kernel(b)
print(a-b.asnumpy())[[0. 0. 0. 0. 0. ]
[0. 0. 0. 0. 0. ]
[0. 0. 0. 0. 0. ]
[0. 0. 0. 0. 0. ]
[0. 0. 0. 1.6 0. ]]
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
* Add new blas extension and update matmul impl * Add support for N-D array add N-dimension * support more special cases + add new tests * fix random behavior on cpu * correct dtypes + support more keywords * add strided support * check input arrays * address comments - first round * address comments - second round * address comments - third round * fix pre-commit * improve test coverage * address comments * update _gemm_res_dtype func * fix a test for result_type * fix minor issues * skip tests for matmul --------- Co-authored-by: Vahid Tavanashad <vahid.tavanashad@intel.com> Co-authored-by: vtavana <120411540+vtavana@users.noreply.github.com> Co-authored-by: Anton <100830759+antonwolfy@users.noreply.github.com> f95ceb9
This PR updates
dpnp.matmulimplementation withgemmfunction call fromoneapi::mkl::blasadded todpnp.backend.extensions.blas.In addition,
gemm_batchfunction is also added which is the batched versions ofgemm, performing multiplegemmoperations in a single call.The implementation is written as a pybind11 extension above required BLAS functions.