Use the Chapel to process a massive matrix

I recently met the Chapel, and I really want to try it. I have a twofold problem, I hope that she can solve it.

I usually work in Python or C ++. Java with support in the corner.

I have two matrices Iand V. Both of them are sparse and have a dimension of about 600K x 600K, filled with a density of about 1%.

First, using SciPy, I can load both from the SQL database into memory for now. However, I expect our next iteration to be too large for our machines. Perhaps 1.5M ^ 2. In this case, Spark RDDs can work for load. I could not get PyTables to do this. I understand that this is described as an “extraordinary” problem.

Even if they load, I'IVOOM runs in minutes. (It I'is transposed here), so I am studying the distribution of this multiplication to several kernels (which SciPy can do) and several machines (which it cannot, as far as I know). Here the spark falls, but the chapel seems to answer my prayers, so to speak.

A serious limitation is the budget on the machines. For example, I cannot afford Cray. Does the Chapel community have a sample for this?

+4
source share
1 answer

Starting at several high-level points:

  • , ( ), ( ), , , . (, , vs. , - ).
  • , .
  • / .
  • / , . , - , Chapel , Chapel 1.15, , .

:

:

use BlockDist;
config const n = 10;

const D = {1..n, 1..n} dmapped Block({1..n, 1..n});  // distributed dense index set
var A: [D] real;                                     // distributed dense array

// assign the array elements in parallel based on the owning locale (compute node's) ID 
forall a in A do
  a = here.id;

// print out the array
writeln(A);

, 6 (./myProgram -nl 6) :

0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0 1.0
0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0 1.0
0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0 1.0
0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0 1.0
2.0 2.0 2.0 2.0 2.0 3.0 3.0 3.0 3.0 3.0
2.0 2.0 2.0 2.0 2.0 3.0 3.0 3.0 3.0 3.0
2.0 2.0 2.0 2.0 2.0 3.0 3.0 3.0 3.0 3.0
4.0 4.0 4.0 4.0 4.0 5.0 5.0 5.0 5.0 5.0
4.0 4.0 4.0 4.0 4.0 5.0 5.0 5.0 5.0 5.0
4.0 4.0 4.0 4.0 4.0 5.0 5.0 5.0 5.0 5.0

, Chapel . Crays.

, :

use BlockDist;

config const n = 10;

const D = {1..n, 1..n} dmapped Block({1..n, 1..n});  // distributed dense index set
var SD: sparse subdomain(D);                         // distributed sparse subset
var A: [SD] real;                                    // distributed sparse array

// populate the sparse index set
SD += (1,1);
SD += (n/2, n/4);
SD += (3*n/4, 3*n/4);
SD += (n, n);

// assign the sparse array elements in parallel
forall a in A do
  a = here.id + 1;

// print a dense view of the array
for i in 1..n {
  for j in 1..n do
    write(A[i,j], " ");
  writeln();
}

:

1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 
0.0 3.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 
0.0 0.0 0.0 0.0 0.0 0.0 4.0 0.0 0.0 0.0 
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 6.0 

forall / node .

:

  • Chapel 1.15.0, parallelism . + , " GraphBLAS " , -, - . - .

  • , . Chapel BLAS LAPACK. 1.15 LinearAlgebra. (BLAS LAPACK , LinearAlgebra, ).

  • SQL (), . / Chapel . Chapel C, SQL.

+3

Source: https://habr.com/ru/post/1681726/


All Articles