Skip to content

observers: use torch.all to check for valid min and max values#43151

Closed
vkuzo wants to merge 1 commit intogh/vkuzo/128/basefrom
gh/vkuzo/128/head
Closed

observers: use torch.all to check for valid min and max values#43151
vkuzo wants to merge 1 commit intogh/vkuzo/128/basefrom
gh/vkuzo/128/head

Conversation

@vkuzo
Copy link
Copy Markdown
Contributor

@vkuzo vkuzo commented Aug 17, 2020

Stack from ghstack:

Summary:

Using torch.all instead of torch.sum and length check.

yields a ~20% latency improvement on per-channel CUDA microbenchmarks for small tensors
(prev diff: P139074706, this diff: P139074994)

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: D23170426

Summary:

Using `torch.all` instead of `torch.sum` and length check.
It's unclear whether the increase in perf (~5% for small inputs) is
real, but should be a net benefit, especially for larger channel inputs.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Aug 17, 2020
Summary:

Using `torch.all` instead of `torch.sum` and length check.
It's unclear whether the increase in perf (~5% for small inputs) is
real, but should be a net benefit, especially for larger channel inputs.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: ea10151
Pull Request resolved: #43151
Copy link
Copy Markdown

@z-a-f z-a-f left a comment

Choose a reason for hiding this comment

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

Nice catch!

@dr-ci
Copy link
Copy Markdown

dr-ci Bot commented Aug 17, 2020

💊 CI failures summary and remediations

As of commit b2dcec1 (more details on the Dr. CI page):


  • 1/1 failures possibly* introduced in this PR
    • 1/1 non-CircleCI failure(s)

ci.pytorch.org: 1 failed


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 1 time.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in 57af1ec.

@facebook-github-bot facebook-github-bot deleted the gh/vkuzo/128/head branch August 21, 2020 14:16
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
…ch#43151)

Summary:
Pull Request resolved: pytorch#43151

Using `torch.all` instead of `torch.sum` and length check.
It's unclear whether the increase in perf (~5% for small inputs) is
real, but should be a net benefit, especially for larger channel inputs.

Test Plan: Imported from OSS

Reviewed By: jerryzh168

Differential Revision: D23170426

fbshipit-source-id: ee5c25eb93cee1430661128ac9458a9c525df8e5
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