The pylibraft library has implementations of pairwise distance which run on GPU. Trying this on colab gives 45s on CPU versus <1s on GPU for ~6000 haplotypes. GPUs are free on colab, so this would be relatively accessible to most users, and would make analysing large numbers of haplotypes very amenable.
Installing pylibraft requires a slightly different pip command, and so this probably should be an optional dependancy. I.e., user has to manually install pylibraft, and then if detected it can be used, but fall back to existing CPU implementation.
The pylibraft library has implementations of pairwise distance which run on GPU. Trying this on colab gives 45s on CPU versus <1s on GPU for ~6000 haplotypes. GPUs are free on colab, so this would be relatively accessible to most users, and would make analysing large numbers of haplotypes very amenable.
Installing pylibraft requires a slightly different pip command, and so this probably should be an optional dependancy. I.e., user has to manually install pylibraft, and then if detected it can be used, but fall back to existing CPU implementation.