scientific-python / specs

Scientific Python Ecosystem Coordination (SPEC) documents
https://scientific-python.org/specs/
BSD 3-Clause "New" or "Revised" License
59 stars 45 forks source link

Handle SPEC 2 #229

Closed stefanv closed 4 months ago

stefanv commented 1 year ago
MridulS commented 7 months ago

I think we can handle this in a new way:

A successful prototype implementation of this SPEC (at least in spirit) is already available inside NetworkX.

NetworkX has developed a dispatching layer which can plug into multiple backends. Currently we have backends which can dispatch to CuGraph, GraphBLAS and a joblib backed parallel implementation of algorithms in NetworkX.

One of the goals here is to provide drop in replacement for old code written with NetworkX. Users should be able to set a config option/env variable and dispatch their code to different backends. These backends could be hardware specific ones, reimplementations in other languages (hello rust!) or using a totally new data structure (GraphBLAS in the case of NetworkX).

On the NetworkX side we are still ironing out more details, and we are still missing out on a detailed spec (or SPEC). I think other projects in the scientific python ecosystem could also benefit from some kind of dispatching along these lines. There is some progress towards creating an engine API in scikit-learn which follows similar rational.

Getting a SPEC together with all the experiments across the ecosystem could be a fruitful task. Maybe this SPEC could be more of an informational document about various efforts across the ecosystem and we can extract the common bits to form some recommendations?

rgommers commented 7 months ago

That sounds like a great idea @MridulS. It'd be useful to have an overview of which projects are trying what, and some learnings. It's still early days in a way, but hopefully at some point one or a couple of patterns appear that can be adopted by others.