I am currently looking into providing dlpack conversions to mdspan, specifically the device-portable version in https://github.com/kokkos/mdspan. This could help e.g. scipy to consolidate implementations, see scipy/scipy#21798
But for our Kokkos users, the more pressing usecase is calling python-based ML models from large c++ codes running in high performance computing environments.
Would you agree, that for the usecase of converting a mdspan via dlpack for passing data from c++ to python, the mutability should be in agreement with the const-ness of the producer? Meaning if c++ manages the memory and the mdspan is non-const, it should be a mutable dlpack? This is with the assumption that the c++ and python are in sequential order.
For potentially using mdspan in implementations in e.g. interpolate in scipy, the semantics that dlpack spells out in https://dmlc.github.io/dlpack/latest/python_spec.html#semantics are definitely the way to go.
Originated from a discussion with @rgommers in scipy/scipy#21798 (comment)
I am currently looking into providing
dlpackconversions tomdspan, specifically the device-portable version in https://github.com/kokkos/mdspan. This could help e.g.scipyto consolidate implementations, see scipy/scipy#21798But for our Kokkos users, the more pressing usecase is calling python-based ML models from large c++ codes running in high performance computing environments.
Would you agree, that for the usecase of converting a
mdspanviadlpackfor passing data from c++ to python, the mutability should be in agreement with the const-ness of the producer? Meaning if c++ manages the memory and themdspanis non-const, it should be a mutabledlpack? This is with the assumption that the c++ and python are in sequential order.For potentially using
mdspanin implementations in e.g.interpolatein scipy, the semantics thatdlpackspells out in https://dmlc.github.io/dlpack/latest/python_spec.html#semantics are definitely the way to go.Originated from a discussion with @rgommers in scipy/scipy#21798 (comment)