Skip to content

Conversation

@resistor
Copy link
Contributor

This requires refactoring at::native::result_type to operate as a
state machine, processing the input types one at a time. There may
be other places in the code base that could benefit from adopting
this approach as well.

This requires refactoring at::native::result_type to operate as a
state machine, processing the input types one at a time.  There may
be other places in the code base that could benefit from adopting
this approach as well.
@resistor resistor requested a review from ngimel November 18, 2019 18:39
@resistor
Copy link
Contributor Author

@ngimel This does appear to be slightly faster in my local benchmark of very-small-tensor workloads, but the noise is pretty high. If you have a better benchmark for TensorIterator setup costs, I'd be interested to know if this helps.

@ngimel
Copy link
Collaborator

ngimel commented Nov 18, 2019

Regular (fast) path where all types are the same returns before ever calling at::native::result_type, so this will help only (rare) cases where actual type promotion is happening https://github.com/pytorch/pytorch/pull/30018/files#diff-b47a50873394e38a005b4c1acd151957L115

@bddppq
Copy link
Contributor

bddppq commented Nov 18, 2019

@pytorchbot retest this please

@resistor resistor requested a review from gchanan November 18, 2019 22:28
Copy link
Collaborator

@ngimel ngimel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@resistor has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@resistor merged this pull request in 0762bbf.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants