-
Notifications
You must be signed in to change notification settings - Fork 17
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
Changes in Matrix 1.6-2 breaking irlba: function 'as_cholmod_sparse' not provided by package 'Matrix'
#70
Comments
function 'as_cholmod_sparse' not provided by package 'Matrix'
function 'as_cholmod_sparse' not provided by package 'Matrix'
Thanks for reporting this!
This will force me to revisit a project we started a while back at
re-implementing the sparse parts of the code in a more generic way.
I'll try and get that ready as soon as I can.
…On 11/8/23, Peter Hickey ***@***.***> wrote:
Hi @bwlewis,
Changes in **Matrix** 1.6-2 seem to have broken `irlba::irlba()` for at
least some types of sparse matrices.
I'm afraid I don't understand enough of **Matrix** and **irlba** to provide
much help at this stage.
Cheers,
Pete
---------
# With **Matrix** 1.6-2
``` r
# Example taken from help("sparseMatrix", package = "Matrix").
i <- c(1,3:8); j <- c(2,9,6:10); x <- 7 * (1:7)
A <- Matrix::sparseMatrix(i, j, x = x)
irlba::irlba(A)
#> Warning in irlba::irlba(A): You're computing too large a percentage of
total
#> singular values, use a standard svd instead.
#> Error in irlba::irlba(A): function 'as_cholmod_sparse' not provided by
package 'Matrix'
```
<details style="margin-bottom:10px;">
<summary>
Session info
</summary>
``` r
sessionInfo()
#> R version 4.3.1 (2023-06-16)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: CentOS Linux 7 (Core)
#>
#> Matrix products: default
#> BLAS: /stornext/System/data/apps/R/R-4.3.1/lib64/R/lib/libRblas.so
#> LAPACK: /stornext/System/data/apps/R/R-4.3.1/lib64/R/lib/libRlapack.so;
LAPACK version 3.11.0
#>
#> locale:
#> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
#> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
#> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
#> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
#> [9] LC_ADDRESS=C LC_TELEPHONE=C
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
#>
#> time zone: Australia/Melbourne
#> tzcode source: system (glibc)
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> loaded via a namespace (and not attached):
#> [1] digest_0.6.33 fastmap_1.1.1 Matrix_1.6-2 xfun_0.41
#> [5] lattice_0.21-8 glue_1.6.2 knitr_1.45
htmltools_0.5.7
#> [9] rmarkdown_2.25 lifecycle_1.0.4 cli_3.6.1 grid_4.3.1
#> [13] reprex_2.0.2 withr_2.5.2 compiler_4.3.1
rstudioapi_0.15.0
#> [17] tools_4.3.1 irlba_2.3.5.1 evaluate_0.23 yaml_2.3.7
#> [21] rlang_1.1.2 fs_1.6.3
```
</details>
-------
# With **Matrix** 1.6-1
``` r
# Example taken from help("sparseMatrix", package = "Matrix").
i <- c(1,3:8); j <- c(2,9,6:10); x <- 7 * (1:7)
A <- Matrix::sparseMatrix(i, j, x = x)
irlba::irlba(A)
#> Warning in irlba::irlba(A): You're computing too large a percentage of
total
#> singular values, use a standard svd instead.
#> $d
#> [1] 49.00000 44.27189 35.00000 28.00000 21.00000
#>
#> $u
#> [,1] [,2] [,3] [,4]
[,5]
#> [1,] 1.179612e-16 -6.418477e-17 -1.942890e-16 6.938894e-17
1.110223e-16
#> [2,] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
0.000000e+00
#> [3,] 3.105155e-16 3.162278e-01 -6.245005e-17 1.110223e-16
-3.816392e-17
#> [4,] -1.734723e-16 -2.428613e-17 -3.885781e-16 5.273559e-16
1.000000e+00
#> [5,] -1.942890e-16 -2.602085e-16 9.436896e-16 1.000000e+00
-3.608225e-16
#> [6,] -2.498002e-16 -2.012279e-16 -1.000000e+00 1.054712e-15
2.775558e-17
#> [7,] 9.419548e-16 9.486833e-01 -1.318390e-16 2.914335e-16
-1.734723e-17
#> [8,] 1.000000e+00 -1.334002e-15 -3.885781e-16 -3.053113e-16
8.326673e-17
#>
#> $v
#> [,1] [,2] [,3] [,4]
[,5]
#> [1,] -6.938894e-17 -1.474515e-16 -1.665335e-16 -1.387779e-16
0.000000e+00
#> [2,] -9.714451e-17 -9.020562e-17 2.220446e-16 5.551115e-17
1.665335e-16
#> [3,] 6.071532e-18 1.192622e-17 2.081668e-17 1.040834e-17
1.734723e-18
#> [4,] 1.127570e-17 1.474515e-17 3.122502e-17 2.775558e-17
-1.040834e-17
#> [5,] -1.994932e-17 -4.770490e-17 -4.857226e-17 -1.734723e-17
-1.040834e-17
#> [6,] -7.632783e-17 5.898060e-17 -3.330669e-16 6.938894e-16
1.000000e+00
#> [7,] -8.326673e-17 -5.898060e-17 1.249001e-15 1.000000e+00
-3.053113e-16
#> [8,] -3.816392e-16 -1.734723e-16 -1.000000e+00 9.714451e-16
2.775558e-17
#> [9,] 1.065120e-15 1.000000e+00 -1.474515e-16 2.029626e-16
-1.908196e-16
#> [10,] 1.000000e+00 -1.234689e-15 -5.134781e-16 2.012279e-16
2.463307e-16
#>
#> $iter
#> [1] 1
#>
#> $mprod
#> [1] 16
```
<details style="margin-bottom:10px;">
<summary>
Session info
</summary>
``` r
sessionInfo()
#> R version 4.3.1 (2023-06-16)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: CentOS Linux 7 (Core)
#>
#> Matrix products: default
#> BLAS: /stornext/System/data/apps/R/R-4.3.1/lib64/R/lib/libRblas.so
#> LAPACK: /stornext/System/data/apps/R/R-4.3.1/lib64/R/lib/libRlapack.so;
LAPACK version 3.11.0
#>
#> locale:
#> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
#> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
#> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
#> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
#> [9] LC_ADDRESS=C LC_TELEPHONE=C
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
#>
#> time zone: Australia/Melbourne
#> tzcode source: system (glibc)
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> loaded via a namespace (and not attached):
#> [1] digest_0.6.33 fastmap_1.1.1 Matrix_1.6-1 xfun_0.41
#> [5] lattice_0.21-8 glue_1.6.2 knitr_1.45
htmltools_0.5.7
#> [9] rmarkdown_2.25 lifecycle_1.0.4 cli_3.6.1 grid_4.3.1
#> [13] reprex_2.0.2 withr_2.5.2 compiler_4.3.1
rstudioapi_0.15.0
#> [17] tools_4.3.1 irlba_2.3.5.1 evaluate_0.23 yaml_2.3.7
#> [21] rlang_1.1.2 fs_1.6.3
```
</details>
--
Reply to this email directly or view it on GitHub:
#70
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
Re-installing irlba from source after upgrading to Matrix v1.6-2 seems to have resolved the error. # Example taken from help("sparseMatrix", package = "Matrix").
i <- c(1,3:8); j <- c(2,9,6:10); x <- 7 * (1:7)
A <- Matrix::sparseMatrix(i, j, x = x)
irlba::irlba(A)
#> Warning in irlba::irlba(A): You're computing too large a percentage of total
#> singular values, use a standard svd instead.
#> $d
#> [1] 49.00000 44.27189 35.00000 28.00000 21.00000
#>
#> $u
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] -4.076600e-17 -1.873501e-16 -1.387779e-17 -2.775558e-17 1.387779e-16
#> [2,] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
#> [3,] 8.023096e-18 -3.162278e-01 -1.942890e-16 -1.873501e-16 1.040834e-16
#> [4,] 3.469447e-18 -1.665335e-16 7.216450e-16 1.426637e-14 -1.000000e+00
#> [5,] -3.122502e-17 -1.249001e-16 -4.440892e-16 1.000000e+00 1.459943e-14
#> [6,] 1.301043e-16 5.689893e-16 -1.000000e+00 -4.440892e-16 -8.881784e-16
#> [7,] -6.938894e-18 -9.486833e-01 -4.857226e-16 -5.273559e-16 8.326673e-17
#> [8,] 1.000000e+00 -1.656661e-16 1.578598e-16 -2.081668e-17 -5.551115e-17
#>
#> $v
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] -7.047314e-18 1.214306e-17 3.469447e-18 6.938894e-18 6.938894e-18
#> [2,] 2.081668e-17 -9.020562e-17 3.053113e-16 1.110223e-16 1.110223e-16
#> [3,] 8.890458e-18 -1.214306e-17 1.387779e-17 -3.469447e-18 -5.551115e-17
#> [4,] -4.250073e-17 5.204170e-17 -3.469447e-17 6.938894e-18 0.000000e+00
#> [5,] -2.222614e-17 3.122502e-17 -1.734723e-17 -3.469447e-18 1.387779e-17
#> [6,] -3.729655e-17 -5.551115e-17 1.054712e-15 1.915135e-14 -1.000000e+00
#> [7,] -1.175275e-16 -9.714451e-17 -6.522560e-16 1.000000e+00 1.948441e-14
#> [8,] -2.211772e-17 3.920475e-16 -1.000000e+00 -7.563394e-16 -1.415534e-15
#> [9,] 3.642919e-17 -1.000000e+00 -8.187895e-16 -3.677614e-16 2.012279e-16
#> [10,] 1.000000e+00 -5.204170e-18 1.600282e-16 5.854692e-17 -8.847090e-17
#>
#> $iter
#> [1] 1
#>
#> $mprod
#> [1] 16 Session infosessionInfo()
#> R version 4.3.1 (2023-06-16)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: CentOS Linux 7 (Core)
#>
#> Matrix products: default
#> BLAS: /stornext/System/data/apps/R/R-4.3.1/lib64/R/lib/libRblas.so
#> LAPACK: /stornext/System/data/apps/R/R-4.3.1/lib64/R/lib/libRlapack.so; LAPACK version 3.11.0
#>
#> locale:
#> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
#> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
#> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
#> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
#> [9] LC_ADDRESS=C LC_TELEPHONE=C
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
#>
#> time zone: Australia/Melbourne
#> tzcode source: system (glibc)
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> loaded via a namespace (and not attached):
#> [1] digest_0.6.33 fastmap_1.1.1 Matrix_1.6-2 xfun_0.41
#> [5] lattice_0.22-5 glue_1.6.2 knitr_1.45 htmltools_0.5.7
#> [9] rmarkdown_2.25 lifecycle_1.0.4 cli_3.6.1 grid_4.3.1
#> [13] reprex_2.0.2 withr_2.5.2 compiler_4.3.1 rstudioapi_0.15.0
#> [17] tools_4.3.1 irlba_2.3.5.1 evaluate_0.23 yaml_2.3.7
#> [21] rlang_1.1.2 fs_1.6.3 I never fully understand when packages have to be re-built/re-installed when dependencies like Matrix update. |
Also good to know.
There is a re-write of the sparse/Matrix-dependency code that has been
planned for a long time that will simplify installation and handle
more special structured matrix cases. I will work on this this fall.
…On 11/9/23, Peter Hickey ***@***.***> wrote:
Re-installing *irlba* from source after upgrading to *Matrix* v1.6-2 seems
to have resolved the error.
``` r
# Example taken from help("sparseMatrix", package = "Matrix").
i <- c(1,3:8); j <- c(2,9,6:10); x <- 7 * (1:7)
A <- Matrix::sparseMatrix(i, j, x = x)
irlba::irlba(A)
#> Warning in irlba::irlba(A): You're computing too large a percentage of
total
#> singular values, use a standard svd instead.
#> $d
#> [1] 49.00000 44.27189 35.00000 28.00000 21.00000
#>
#> $u
#> [,1] [,2] [,3] [,4]
[,5]
#> [1,] -4.076600e-17 -1.873501e-16 -1.387779e-17 -2.775558e-17
1.387779e-16
#> [2,] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
0.000000e+00
#> [3,] 8.023096e-18 -3.162278e-01 -1.942890e-16 -1.873501e-16
1.040834e-16
#> [4,] 3.469447e-18 -1.665335e-16 7.216450e-16 1.426637e-14
-1.000000e+00
#> [5,] -3.122502e-17 -1.249001e-16 -4.440892e-16 1.000000e+00
1.459943e-14
#> [6,] 1.301043e-16 5.689893e-16 -1.000000e+00 -4.440892e-16
-8.881784e-16
#> [7,] -6.938894e-18 -9.486833e-01 -4.857226e-16 -5.273559e-16
8.326673e-17
#> [8,] 1.000000e+00 -1.656661e-16 1.578598e-16 -2.081668e-17
-5.551115e-17
#>
#> $v
#> [,1] [,2] [,3] [,4]
[,5]
#> [1,] -7.047314e-18 1.214306e-17 3.469447e-18 6.938894e-18
6.938894e-18
#> [2,] 2.081668e-17 -9.020562e-17 3.053113e-16 1.110223e-16
1.110223e-16
#> [3,] 8.890458e-18 -1.214306e-17 1.387779e-17 -3.469447e-18
-5.551115e-17
#> [4,] -4.250073e-17 5.204170e-17 -3.469447e-17 6.938894e-18
0.000000e+00
#> [5,] -2.222614e-17 3.122502e-17 -1.734723e-17 -3.469447e-18
1.387779e-17
#> [6,] -3.729655e-17 -5.551115e-17 1.054712e-15 1.915135e-14
-1.000000e+00
#> [7,] -1.175275e-16 -9.714451e-17 -6.522560e-16 1.000000e+00
1.948441e-14
#> [8,] -2.211772e-17 3.920475e-16 -1.000000e+00 -7.563394e-16
-1.415534e-15
#> [9,] 3.642919e-17 -1.000000e+00 -8.187895e-16 -3.677614e-16
2.012279e-16
#> [10,] 1.000000e+00 -5.204170e-18 1.600282e-16 5.854692e-17
-8.847090e-17
#>
#> $iter
#> [1] 1
#>
#> $mprod
#> [1] 16
```
<details style="margin-bottom:10px;">
<summary>
Session info
</summary>
``` r
sessionInfo()
#> R version 4.3.1 (2023-06-16)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: CentOS Linux 7 (Core)
#>
#> Matrix products: default
#> BLAS: /stornext/System/data/apps/R/R-4.3.1/lib64/R/lib/libRblas.so
#> LAPACK: /stornext/System/data/apps/R/R-4.3.1/lib64/R/lib/libRlapack.so;
LAPACK version 3.11.0
#>
#> locale:
#> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
#> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
#> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
#> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
#> [9] LC_ADDRESS=C LC_TELEPHONE=C
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
#>
#> time zone: Australia/Melbourne
#> tzcode source: system (glibc)
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> loaded via a namespace (and not attached):
#> [1] digest_0.6.33 fastmap_1.1.1 Matrix_1.6-2 xfun_0.41
#> [5] lattice_0.22-5 glue_1.6.2 knitr_1.45
htmltools_0.5.7
#> [9] rmarkdown_2.25 lifecycle_1.0.4 cli_3.6.1 grid_4.3.1
#> [13] reprex_2.0.2 withr_2.5.2 compiler_4.3.1
rstudioapi_0.15.0
#> [17] tools_4.3.1 irlba_2.3.5.1 evaluate_0.23 yaml_2.3.7
#> [21] rlang_1.1.2 fs_1.6.3
```
</details>
I never fully understand when packages have to be re-built/re-installed when
dependencies like *Matrix* update.
But if I had to guess, perhaps these remaps
(https://github.com/cran/Matrix/blob/323f4d9b0722ba6f61682874a8d92ebdbf93d8fa/inst/include/Matrix/remap.h)
are picked up when *irlba* is re-installed from source.
--
Reply to this email directly or view it on GitHub:
#70 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
And a bit more info now posted by the Matrix developers: https://stat.ethz.ch/pipermail/r-package-devel/2023q4/010051.html |
Thanks @PeteHaitch. @bwlewis Note that it's enough for you to bump irlba version and resubmit to CRAN. The new version will then propagate to the user machine which will trigger a reinstallation. The problem affects any user who installed irlba before Matrix 1.6-2 got into the wild and landed on their machine. Unfortunately the info posted by the Matrix developers won't help them, and it's not realistic to expect that the thousands of users in that situation reinstall irlba manually. Most users will see the error in a context involving many packages and won't have a clue what package is actually the culprit. This is the case for Bioconductor users where 40+ Bioconductor packages are affected indirectly via irlba. However, if a new version of irlba shows up on CRAN, then the problem will be solved for all the users and system admins that run Thanks, |
Is there any update on how to solve this problem? |
I tried reinstalling irlba, but the issue persists with Matrix 1.6-3. Major issue for anyone running UMAP. |
@sfplab Did you re-install both from source? install.packages("Matrix", type = "source")
install.packages("irlba", type = "source") |
Hi @PeteHaitch - I hadn't installed from source, because it threw an error on my M1: ld: warning: search path '/opt/R/arm64/gfortran/lib/gcc/aarch64-apple-darwin20.2.0/11.0.0' not found After going down some rabbit holes, I finally found this page on CRAN - downloading the gnu fortran package at the top of the page solved my issues installing Matrix and irlba from source: Leaving this info here in case anyone else has issues with fortran-dependent source install in R. And yes, RunUMAP calls to Matrix & irlba now work as expected. Thank you, @PeteHaitch! |
I use an M1 and I know that there's a lot of conflicting advice online re macOS, arm64 and R. |
I have an R package that depends on irlba working - is there any solution on the horizon that does not require all my users to install from source? |
Yes, I am preparing an update for CRAN presently.
…On Tue, Nov 28, 2023 at 6:33 AM Kristoffer Vitting-Seerup < ***@***.***> wrote:
I have an R package that depends on irlba working - is there any solution
on the horizon that does not require all my users to install from source?
—
Reply to this email directly, view it on GitHub
<#70 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABCZHR4FZBBTYAO2ILXV3TYGXDY7AVCNFSM6AAAAAA7DXI7PGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRZGY2DINRUGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
reinstall Matrix version = 1.6_1.1 can solve this problem. |
Is there any solutions now ? I meet the same problem and it does not work even I changed Matrix version changes to 1.6-1.1.
Warning: The default method for RunUMAP has changed from calling Python UMAP via reticulate to the R-native UWOT using the cosine metric |
@bwlewis Any ETA for a new version of irlba on CRAN? Just to be clear, you don't need to make any change to the package, only bump its version and resubmit to CRAN. Thanks! |
I am using mac M3, after install gfortran-12.2-universal.pkg
|
I also met the same problem and your method solved it, thanks! |
Installing gfortran-ARM-13.2-Sonoma.dmg for Sonoma 14 macOS made it possible for me to install the Matrix and irlba packages from source and this in turn solved the error "function 'as_cholmod_sparse' not provided by package 'Matrix'".
Thank you all! |
@VitorAguiar Your comment is very misleading! Nobody said that you had to install Matrix v1.6_1.1 to fix the "as_cholmod_sparse" issue. If your version of Matrix is >= 1.6.2, all you need to do to fix this issue is reinstall irlba from source. And that does solve the problem. Also why would you install an archived version of Matrix? Current version is 1.6-5 and this is what everybody uses so it should work with Seurat. The fact that Seurat v4.1.1 required at least v1.6-3 doesn't mean that you must install this exact version. Anyways it's unfortunate that 5 months have passed and irlba version still didn't get bumped (with resubmission to CRAN) as this would have solved the problem once for all, and by doing so avoided a lot of confusion and frustration. |
@hpages I was just sharing what worked for me. Your suggestion to reinstall irlba from source and current version of Matrix did not solve the problem for me. That's why I had to install an archived version of Matrix, one that was new enough to work with Seurat. Since you feel that my comment was misleading, I am deleting it. |
@VitorAguiar The breaking change in Matrix happened when they went from version 1.6.1 to 1.6.2. So why installing Matrix 1.6.5 (current version) vs 1.6-3 would make any difference as far as the "as_cholmod_sparse" issue is concerned? Therefore when you say that
didn't fix the problem for you, but that specifically installing Matrix 1.6.3 did solve it, I suspect that something else was going on in your case. And since we don't have the full story (i.e. output of commands + In any case it is very very unlikely that installing Matrix 1.6.3 instead of the current Matrix was necessary. Just wanted to clarify this in case other people seeing your comment might think this is a good idea . |
In case anyone is having issues with this solution and also has renv installed, beware that the source install may be ignored in favor of a cached version. This solved the issue for me: |
Solved matrix errors by downgrading to version 1.6-5 and then installing irlba from source
|
Hi @bwlewis,
Changes in Matrix 1.6-2 seem to have broken
irlba::irlba()
for at least some types of sparse matrices.I'm afraid I don't understand enough of Matrix and irlba to provide much help at this stage.
Cheers,
Pete
With Matrix 1.6-2
Session info
With Matrix 1.6-1
Session info
The text was updated successfully, but these errors were encountered: