Just documenting this in case others encounter it and find it helpful. I have been using sceasy in R to convert my Seurat objects to Anndata. I had noticed I was getting slow training speeds with scVI.
Not familiar with scipy's sparse matrix formats, I was ignoring a warning message telling me about the issue, but type(adata.X) was CSC sparse, which is apparently inefficient at row splicing. After converting with adata.X = scipy.sparse.csr_matrix(adata.X), scVI training speeds increased 10-fold.
Just documenting this in case others encounter it and find it helpful. I have been using sceasy in R to convert my Seurat objects to Anndata. I had noticed I was getting slow training speeds with scVI.
Not familiar with scipy's sparse matrix formats, I was ignoring a warning message telling me about the issue, but
type(adata.X)
was CSC sparse, which is apparently inefficient at row splicing. After converting withadata.X = scipy.sparse.csr_matrix(adata.X)
, scVI training speeds increased 10-fold.