Skip to content

Roadmap: Next milestone for numpy-quaddtype (post v1.0.0) #68

Open

Description

@SwayamInSync

For the next iteration we can focus on upgrading the dtype API at NumPy and other performance related issues. Listing down some known ones to track progress.

Dtype API upgrades (requires changes at NumPy)

Updates/Fixes in numpy-quaddtype

Activity

  1. SwayamInSync commented on Jan 27, 2026

    @SwayamInSync
    MemberAuthor

    I think we can create separate tracking issues for the numpy API fixes in numpy repo and initiate some forward discussion on each and the potential fixes, so that contributors from both numpy and user-dtypes side can come forward as per the interests.

    cc: @ngoldbaum @seberg

  2. ngoldbaum commented on Jan 27, 2026

    @ngoldbaum
    Member

    Please do open numpy issues for improvements for the user dtype system.

  3. mdhaber commented on Feb 3, 2026

    @mdhaber

    Thanks for working on this! I'm excited about the potential for use in SciPy, especially the elementwise iterative methods like scipy.differentiate.derivative and scipy.integrate.tanhsinh (quadrature), which are written in terms of the array API. How feasible is support throughout NumPy's array API functions? I thought differentiate.derivative might "just work", but I ran into trouble with input validation - np.isdtype(..., "real floating") didn't recognize a QuadPrecDType yet. If it would be helpful, I can try to find pain points in some representative SciPy features.

  4. ngoldbaum commented on Feb 3, 2026

    @ngoldbaum
    Member

    If it would be helpful, I can try to find pain points in some representative SciPy features.

    That would be great, if only to figure out where to focus effort in NumPy.

    I think there are open issues over there about better fleshing out DType hierarchies and adding ways to register dtypes in a hierarchy, but right now there isn't anything like that.

  5. SwayamInSync commented on Feb 3, 2026

    @SwayamInSync
    MemberAuthor

    Thanks @mdhaber for looking into it and definitely it'll be great to get know of more limitations.

    but I ran into trouble with input validation - np.isdtype(..., "real floating") didn't recognize a QuadPrecDType yet.

    I checked isdtype and the docstring stays "This function only supports built-in NumPy's data types". One recommendation might be here to use issubdtype

    In [5]: np.issubdtype(QuadPrecDType(), np.floating)
    Out[5]: True

    but I feel we should also update isdtype function as well inside NumPy

  6. mdhaber commented on Feb 3, 2026

    @mdhaber

    One recommendation might be here to use Issubdtype

    Ah, but that is not part of the array API. I could add a special case temporarily as a workaround, but it's best to minimize that.

  7. mdhaber commented on Feb 5, 2026

    @mdhaber

    It was not too hard to get scipy.differentiate.derivative and scipy.integrate.tanhsinh working with a QuadPrecDType; the only real incompatibility was xp.isdtype in a few places (as discussed above). A few other things I noticed:

    • A quad precision linear solve would be very helpful
    • It looks like str of a quad dtype does not (at least by default) use scientific notation? (e.g. print(np.finfo(QuadPrecDType()).smallest_normal) prints all ~5000 digits, mostly leading zeros.)
    • I'm seeing some warnings from NumPy for valid arithmetic (e.g. np.log(np.asarray(1e-300, dtype=QuadPrecDType())**2))

    Otherwise, I think it will mostly "just work" with these and other features that could really benefit from very high working precision. Thanks!

  8. SwayamInSync commented on Feb 5, 2026

    @SwayamInSync
    MemberAuthor

    Thanks @mdhaber . This might be an important issue, I just checked and np.linalg module only supports hardcoded _real_types and _complex_types and directly calls the LAPACK routines via _umath_linalg gufuncs.

    This is inconsistent with how ufunc works, we need to make _umath_linalg gufuncs support the same loop registration for dtypes that regular ufuncs do. This might require big refactoring of gufunc infrastructure (but should be good plan for long term)

  9. mdhaber commented on Feb 5, 2026

    @mdhaber

    Yeah, I imagine linalg support is a tall order, but thought solve was worth mentioning. If we ever get a special function extension into the array API standard (data-apis/array-api#725), that would be the next thing I'd ask for.
    @steppi any chance that xsf could have quad precision implementations of some functions?

  10. SwayamInSync commented on Feb 5, 2026

    @SwayamInSync
    MemberAuthor

    I think linalg support is worth solving in NumPy as well, I will by this weekend raise all the found issues over NumPy and we can start working towards them.

    @steppi any chance that xsf could have quad precision implementations of some functions?

    The external implementations of routines might not work with our dtype as to ensure cross-compatibility the quaddtype is defined differently over different platforms but this won't be a pain point as its straightforward to implement such operations within the package and then register them in NumPy to use.

  11. steppi commented on Feb 5, 2026

    @steppi

    If we ever get a special function extension into the array API standard (data-apis/array-api#725), that would be the next thing I'd ask for.
    @steppi any chance that xsf could have quad precision implementations of some functions?

    From a numerical perspective, I know that the main thing we'd need to do that would take more than minimal work is to fit some quad specific mini-max polynomial approximations. We could use Boost's or Cephes' implementation of Remez-exchange for this. I don't know enough about numpy-quaddtype yet to know how defining ufuncs would work for the quad dtype, but expanding dtype support in xsf by fitting more minimax approximations is planned.

  12. juntyr commented on Sep 8, 2026

    @juntyr
    Contributor

    Now that PyEmscripten packages can be published to PyPi, it would also be good to publish them as part of the next release

  13. ngoldbaum commented on Sep 8, 2026

    @ngoldbaum
    Member

    Is it helpful to do that if NumPy itself doesn't do that yet?

  14. juntyr commented on Sep 9, 2026

    @juntyr
    Contributor

    Do you know why NumPy doesn't publish PyEmscripten wheels yet?

    I still think that it is useful. Pyodide still provides NumPy wheels by default since it provides a special build env for downstream packages that link to numpy. But Pyodide now also doesn't really want to accept new recipes that they need to maintain. So I think publishing numpy-quaddtype wheels would be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions