If you are looking to use parallelize the work, you could use a python library such as Ray.
Using Ray, you could parallelize your search by partitioning the data into multiple sets and having each thread attempt to find the largest N numbers of each subset. Afterwards, you should have k lists of N 'large' numbers. From there, you can find the largest N numbers.
If you would like to learn more about Ray documentation, you can check out the documentation.
Documentation: https://docs.ray.io/en/latest/
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…