Hey, about about using NEC Frovedis (https://github.com/frovedis/frovedis) framework for the same.
Refer: https://github.com/frovedis/frovedis/blob/master/src/foreign_if/python/examples/unsupervised_knn_demo.py
It works on a distributed framework (...