Hi,

I am new to MAGMA. I noticed that some routines have _mgpu version while some not. For example there is no _mgpu function in LU inverse:

magma_cgetri_gpu, magma_dgetri_gpu, magma_sgetri_gpu, magma_zgetri_gpu.

There is also no relevant input parameter to indicate the number of GPUs. Does this mean these functions cannot use multiple GPUs? If no, how to do it?

Thank you very much!

## Can routine getri: LU inverse use multiple GPUs?

### Re: Can routine getri: LU inverse use multiple GPUs?

There are several possible interfaces in MAGMA, for instance:
If environment variable $MAGMA_NUM_GPUS is set, magma_zgetrf will call magma_zgetrf_m. Also, if matrix A doesn't fit in GPU memory, magma_zgetrf will call magma_zgetrf_m for the out-of-GPU-memory capability. So usually, just call magma_zgetrf. Using magma_zgetrf_mgpu is more difficult because you have to distribute the matrix to multiple GPUs beforehand.

There is currently no multi-GPU getri. Only the first step (getrf) is multi-GPU. (I just noticed there is no magma_zgetri CPU interface, either. Hopefully we can remedy that before the next release.)

Incidentally, why do you want getri? It is usually a bad idea to explicitly invert a matrix. If you are computing X = A^{-1}*B, which is the same as solving A*X = B, it is both faster and more accurate to use gesv, which is getrf + getrs, rather than getrf + getri + gemm.

-mark

Code: Select all

```
magma_zgetrf # matrix A in CPU memory; single or multi-GPU.
magma_zgetrf_m # matrix A in CPU memory, internal multi-GPU, out-of-GPU-memory implementation.
magma_zgetrf_gpu # matrix dA in GPU memory.
magma_zgetrf_mgpu # matrix dA distributed over multiple GPU memories, multi-GPU implementation.
```

There is currently no multi-GPU getri. Only the first step (getrf) is multi-GPU. (I just noticed there is no magma_zgetri CPU interface, either. Hopefully we can remedy that before the next release.)

Incidentally, why do you want getri? It is usually a bad idea to explicitly invert a matrix. If you are computing X = A^{-1}*B, which is the same as solving A*X = B, it is both faster and more accurate to use gesv, which is getrf + getrs, rather than getrf + getri + gemm.

-mark

### Re: Can routine getri: LU inverse use multiple GPUs?

Hi Mark,

I see. I'll take you advice and have a try.

Thank you very much!

I see. I'll take you advice and have a try.

Thank you very much!