About
scikit-learn-intelex is a stable Scikit-learn extension developed by Intel to seamlessly speed up traditional ML such as PCA, t-SNE, KMeans that are used in emb-explorer. In our benchmark, sklearnex patched code provided
- ~4x speedup on PCA
- ~7x speedup on t-SNE
- ~12x speedup on KMeans
Tests are performed on OSC Ascend cluster 2 CPU cores, 16 GB RAM, on 2,000 x 768 float32 embeddings.
When GPU is available, cuML is set as the default backend for significant accelerations performance. However, when emb-explorer is being executed on machines that
- does not have GPU available (standard workstations, hf demo space)
- has GPU but not enough VRAM to fit data
CPU cores becomes the only option for projection & clustering operations. The emb-explorer backend resolves to sklearn.
Proposed Changes
- Patch
sklearn with sklearnex.
- Remove
faiss entirely from backend.
Currently, faiss is used only for KMeans acceleration. However, it adds meaningful installation weight and startup import noise for a marginal benefit.
With sklearnex patching, we can achieve great acceleration not only on KMeans, but also on projecting operations. Removing faiss simplifies the backend selection logic to two cases:
cuML if GPU is avaiable
sklearn with patching, otherwise
About
scikit-learn-intelexis a stable Scikit-learn extension developed by Intel to seamlessly speed up traditional ML such as PCA, t-SNE, KMeans that are used inemb-explorer. In our benchmark,sklearnexpatched code providedTests are performed on OSC Ascend cluster 2 CPU cores, 16 GB RAM, on
2,000 x 768 float32embeddings.When GPU is available,
cuMLis set as the default backend for significant accelerations performance. However, whenemb-exploreris being executed on machines thatCPU cores becomes the only option for projection & clustering operations. The
emb-explorerbackend resolves tosklearn.Proposed Changes
sklearnwithsklearnex.faissentirely from backend.Currently,
faissis used only for KMeans acceleration. However, it adds meaningful installation weight and startup import noise for a marginal benefit.With
sklearnexpatching, we can achieve great acceleration not only on KMeans, but also on projecting operations. Removingfaisssimplifies the backend selection logic to two cases:cuMLif GPU is avaiablesklearnwith patching, otherwise