Skip to content

Conversation

@bdhirsh
Copy link
Contributor

@bdhirsh bdhirsh commented Apr 26, 2024

as titled, wrote by staring at the cpu kernel

Stack from ghstack (oldest at bottom):

@pytorch-bot
Copy link

pytorch-bot bot commented Apr 26, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/124988

Note: Links to docs will display an error until the docs builds have been completed.

❌ 13 New Failures

As of commit cc38e38 with merge base e04c7b1 (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@register_meta(aten._segment_reduce_backward)
@out_wrapper()
def meta__segment_reduce_backward(grad, output, data, reduce, lengths=None, offsets=None, axis=0, initial=None):
assert lengths is not None or offsets is not None, "segment_reduce(): Either lengths or offsets must be defined"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the indentation wrong?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops…

as titled, wrote by staring at the cpu kernel




[ghstack-poisoned]
bdhirsh added a commit that referenced this pull request Apr 26, 2024
ghstack-source-id: 383e846
Pull Request resolved: #124988
self.assertEqual(res.dtype, torch.float32)
self.assertEqual(res.untyped_storage().data_ptr(), 0)

def test_segment_reduce_backward(self):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't we have opinfo based test for these. This will give us much better coverage for inputs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I saw an opinfo for the forward, but not the backward.

Lmk if you agree - it seems like we could either:
(1) Add a dedicated OpInfo for the backward op
(2) Add some generic testing in test_meta.py that loops over every existing OpInfo with meta tensors and invokes backward

(2) would be nice, but I'm not sure I'll have time for it. Would you prefer I add a new opinfo over the one-off test? (totally happy to, agreed the one-off test isn't great)

Copy link
Collaborator

@albanD albanD Apr 26, 2024

Choose a reason for hiding this comment

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

I think a new opinfo is the right way to go tbh. We want all other tests on native op to run on the backward!
And you should be able to re-use the sample function from the forward mostly

Comment on lines +5976 to +5977
data_contig = data.contiguous()
grad_contig = grad.contiguous()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we actually read the updates below?
Also this behavior is definitely not covered by the test!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah it's definitely not

Copy link
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

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

This can be written more idiomatically but I'm going ahead and stamping

@github-actions
Copy link
Contributor

Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as Stale.
Feel free to remove the Stale label if you feel this was a mistake.
If you are unable to remove the Stale label please contact a maintainer in order to do so.
If you want the bot to never mark this PR stale again, add the no-stale label.
Stale pull requests will automatically be closed after 30 days of inactivity.

@github-actions github-actions bot added the Stale label Jun 25, 2024
@github-actions github-actions bot closed this Jul 25, 2024
@github-actions github-actions bot deleted the gh/bdhirsh/565/head branch August 25, 2024 02:01
@bdhirsh bdhirsh restored the gh/bdhirsh/565/head branch October 7, 2024 19:33
bdhirsh added a commit that referenced this pull request Oct 8, 2024
@github-actions github-actions bot deleted the gh/bdhirsh/565/head branch November 7, 2024 02:04
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.

4 participants