Personal tracking issue for the SPy-side prerequisites to a paper on SPy as a basis for the scientific Python ecosystem. Potentially targeting MPLR 2027 (Prague), work-in-progress research paper track?
The same content can be presented at EuroPython/EuroScipy 2027.
Scientific/technical question. Can SPy — a statically-compilable subset of Python — serve as the implementation language for the basis of the scientific Python ecosystem (NumPy/SciPy-like array libraries), rather than requiring a C/C++/Cython/Rust layer underneath?
Content. Demonstrations of SPy's suitability for numerical-kernel implementation:
- metaprogramming (blue, metafunc, blue unroll, variadic
*args) as the mechanism behind array-API-style generic functions;
- loop fusion of array expressions;
- SIMD vectorization via
vectorize, itself written in pure SPy rather than hand-written intrinsics;
- a short section on simple parallelism.
We do NOT want loop fusion itself landed in SPy, only what loop fusion needs.
See the existing checklist for the loop-fusion demo itself:
https://github.com/paugier/spy-demos/tree/loop-fusion/loop-fusion
Use more generic classes
Less repetitions
Of course, we could also use Protocol but it has to be supported by SPy.
Cleaner redshift output
UnrollFor (blue unroll)
Starred / SpliceUnroll (*args)
Depends on UnrollFor landing. Relatively big but shouldn't need months once
UnrollFor is done. See https://fluiddyn.pages.heptapod.net/spy-book/design-more-metaprog/
Use new meta programming in stdlib/array.spy
SIMD / vectorize
Parallelism
I don't think the paper should include a demo on parallelism but it can discussed in the conclusions/perspectives. There is an AI generated plan for simple parallelism strategy (not yet discussed with Antonio).
Personal tracking issue for the SPy-side prerequisites to a paper on SPy as a basis for the scientific Python ecosystem. Potentially targeting MPLR 2027 (Prague), work-in-progress research paper track?
The same content can be presented at EuroPython/EuroScipy 2027.
Scientific/technical question. Can SPy — a statically-compilable subset of Python — serve as the implementation language for the basis of the scientific Python ecosystem (NumPy/SciPy-like array libraries), rather than requiring a C/C++/Cython/Rust layer underneath?
Content. Demonstrations of SPy's suitability for numerical-kernel implementation:
*args) as the mechanism behind array-API-style generic functions;vectorize, itself written in pure SPy rather than hand-written intrinsics;We do NOT want loop fusion itself landed in SPy, only what loop fusion needs.
See the existing checklist for the loop-fusion demo itself:
https://github.com/paugier/spy-demos/tree/loop-fusion/loop-fusion
Use more generic classes
nonlocal A = ndarray[DTYPE, NDIM]syntax for generic struct (see draft: Generic class type alias spylang/spy#529)Less repetitions
__add__ = make_add_metafunc(DTYPE, NDIM)?Of course, we could also use
Protocolbut it has to be supported by SPy.Cleaner redshift output
UnrollFor(blue unroll)Starred/SpliceUnroll(*args)Depends on
UnrollForlanding. Relatively big but shouldn't need months onceUnrollForis done. See https://fluiddyn.pages.heptapod.net/spy-book/design-more-metaprog/StarredinTuple.elts/Call.args/SubscriptargsStarred/SpliceUnrollmarkers)m_args.types*args: <type-tuple-expr>sugarUse new meta programming in stdlib/array.spy
SIMD /
vectorizeshouldn't take months once aligned pointers are merged
Parallelism
I don't think the paper should include a demo on parallelism but it can discussed in the conclusions/perspectives. There is an AI generated plan for simple parallelism strategy (not yet discussed with Antonio).