10000 Concurrent minmax reduction operator · Issue #62164 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content
Concurrent minmax reduction operator #62164
@mikekgfb

Description

@mikekgfb

🚀 Feature

Provide a torch.minmax reduction operator that concurrently computes both the min and the max of the inputs.

Motivation

torch.min and torch.max often occur in pairs in pytorch code. It is desirable to have a concurrent min and max computation for efficiency.

Pitch

It is desirable to have a concurrent min and max computation for efficiency. This operator already exists internally as torch._aminmax and the proposal is to make this a public API

Alternatives

Build an FX optimizer (and/or a TorchScript JIT optimizer) that recognizes calls to torch.min and torch.max and replaces them with the optimized function.

Additional context

Computing min and max is often used together, e.g., in computing quantization parameters.

cc @VitalyFedyunin @ngimel @heitorschueroff

Metadata

Metadata

Labels

enhancementNot as big of a feature, but technically not a bug. Should be easy to fixmodule: reductionsneeds designWe want to add this feature but we need to figure out how firsttriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0