Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Wrong handling of workspace in multiple numpy operators #19458

@ptrendx

Description

@ptrendx

Description

The backward pass of tensordot (both regular and the integer version) operator uses workspace to store intermediate value, but then uses ReduceAxesComputeImpl, which also uses workspace). See e.g. here:
https://github.com/apache/incubator-mxnet/blob/bd55002/src/operator/numpy/np_tensordot_op-inl.h#L420-L428

Since there is only a single workspace storage in MXNet, this means that it is possible for the snippet linked above to

  • deallocate dtypespace (if the workspace needs to be reallocated to fit the workspace needed for reduce) leading to a crash
  • use the same pointer as input and workspace, leading to silent wrong results

@szha @leezu

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