Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[WIP] Add Large Tensor Test for linalg_syrk #18767

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion tests/nightly/test_large_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
LARGE_SIZE = LARGE_X * SMALL_Y
LARGE_TENSOR_SHAPE = 2**32
RNN_LARGE_TENSOR = 2**28
LARGE_SQ_X = 80000


@pytest.mark.timeout(0)
Expand Down Expand Up @@ -1754,4 +1755,17 @@ def test_sparse_dot():
out = nd.dot(sp_mat1, mat2)
assert out.asnumpy()[0][0] == 2
assert out.shape == (2, 2)



def test_linalg_operators():
def check_syrk_batch():
A = nd.zeros((2, LARGE_SQ_X, LARGE_SQ_X))
for i in range(LARGE_SQ_X):
A[0,i,i] = 1
A[1,i,i] = 0.1
out = nd.linalg.syrk(A, alpha=2, transpose=False)
for i in range(LARGE_SQ_X):
assert out[0,i,i] == 2
assert_almost_equal(out[1,i,i], nd.array([0.02]), rtol=1e-3, atol=1e-5)

check_syrk_batch()