Skip to content

Conversation

@isuruf
Copy link
Collaborator

@isuruf isuruf commented Sep 15, 2025

Stack from ghstack (oldest at bottom):

Returning None is bad because None means that we don't know the shape.
Returning () is a good choice as that shape broadcasts with any other
shape.

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @chenyang78 @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Sep 15, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit bb028ba with merge base cfc539f (image):
💚 Looks good so far! There are no failures yet. 💚

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

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Sep 15, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@isuruf
Copy link
Collaborator Author

isuruf commented Sep 15, 2025

/easycla

@isuruf isuruf added the topic: not user facing topic category label Sep 15, 2025
@isuruf
Copy link
Collaborator Author

isuruf commented Sep 16, 2025

/easycla

[ghstack-poisoned]
@isuruf isuruf requested review from eellison and mlazos September 16, 2025 14:29
Copy link
Contributor

@eellison eellison left a comment

Choose a reason for hiding this comment

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

Returning None is more consistent with other handlers which return None from these ops, like

@staticmethod
def store_reduction(name: str, index, value: DTypeArg) -> None:
return None
.

() could also be conflated with a single-element tensor. Is there a reason we need to do this ?

@isuruf
Copy link
Collaborator Author

isuruf commented Sep 16, 2025

There's code like CSEProxy where the return value of all the ops are wrapped in a TritonCSEVariable at

return cse.generate(
helper,
getattr(overrides, name)(*args, **kwargs),
dtype=output_dtype,
shape=output_shape,
)

Since there's no assignment for ops.device_assert_async, the created TritonCSEVariable is discarded, but not before it raises an error that the shape is None.

Test failure:
https://hud.pytorch.org/pytorch/pytorch/pull/162275?sha=3da8dc6a9c149a653eff2b877ddc2ef5a79cf21b

@eellison
Copy link
Contributor

Can we update device_assert_async so it behaves more like store ? cc @mlazos @karthickai

@karthickai
Copy link
Collaborator

@eellison, sure, I'll update the device_assert_async

karthickai added a commit that referenced this pull request Sep 24, 2025
Updated the DeviceAssert operation to match the behavior of Store, it will fixes the issue mentioned in [this PR](#163023) and updated testcases as Elias [suggested](#160677 (comment)).



cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov coconutruben mlazos choijon5 

[ghstack-poisoned]
pytorchmergebot pushed a commit that referenced this pull request Sep 24, 2025
Updated the DeviceAssert operation to match the behavior of Store, it will fixes the issue mentioned in [this PR](#163023) and updated testcases as Elias [suggested](#160677 (comment)).

Pull Request resolved: #163696
Approved by: https://github.com/mlazos
@isuruf
Copy link
Collaborator Author

isuruf commented Sep 26, 2025

Thanks @karthickai for your PR

@isuruf isuruf closed this Sep 26, 2025
jainapurva pushed a commit that referenced this pull request Sep 29, 2025
Updated the DeviceAssert operation to match the behavior of Store, it will fixes the issue mentioned in [this PR](#163023) and updated testcases as Elias [suggested](#160677 (comment)).

Pull Request resolved: #163696
Approved by: https://github.com/mlazos
@github-actions github-actions bot deleted the gh/isuruf/153/head branch October 27, 2025 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants