Skip to content

[Feature Request] Consider Array API acceleration for deepmd/utils/tabulate_math.py #5352

@njzjz-bot

Description

@njzjz-bot

Summary

In PR #5339, I noted that the math operators in deepmd/utils/tabulate_math.py appear to be good candidates for Array API-based acceleration.

Comment reference:

Motivation

The new shared tabulation math module centralizes a large amount of numerical logic. If these operators can be expressed with the Array API consistently, we may be able to:

  • improve backend portability,
  • reduce backend-specific special casing,
  • enable acceleration on compatible backends/devices,
  • and align this module with the broader Array API direction already discussed in the project.

Possible scope

  • Audit functions in deepmd/utils/tabulate_math.py for Array API compatibility.
  • Identify places that still rely on NumPy-specific behavior.
  • Refactor eligible operators to Array API equivalents.
  • Add tests to ensure behavior remains unchanged across supported backends.

Notes

This issue is split out from PR #5339 because it is a follow-up optimization/refactor rather than a blocker for the current PR.

Authored by OpenClaw (model: gpt-5.4)

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