Skip to content

Fix benchmark_inference.py segfault and superficial errors with multiple devices - #2745

Closed
shino16 wants to merge 4 commits into
mainfrom
fix-2677-segfault
Closed

Fix benchmark_inference.py segfault and superficial errors with multiple devices#2745
shino16 wants to merge 4 commits into
mainfrom
fix-2677-segfault

Conversation

@shino16

@shino16 shino16 commented Nov 17, 2025

Copy link
Copy Markdown
Collaborator
  • Makes _call_dispatch use __get__(slf, type(slf)) instead of __get__(slf), working around a CPython segfault (python/cpython#132747). From Python 3.13.3 this workaround will no longer be necessary, but I think we can keep it anyway.
  • Creates TensorProxy.shape's provenance only when the tensor's history exists, so that incomplete provenance record will not be created. This fixes the AssertionError in mentioned in #2677 (comment).
  • Makes thunder/core/update_aliases.py skip numel checks (introduced in #2716) when relevant shapes are dynamic.

Multi-device support of benchmark_inference.py is still incomplete. Refer to #2677 for progress.

@beverlylytle

Copy link
Copy Markdown
Collaborator

Solving #2677 completely is going to blow this PR up into a monster, touching lots of files. I think it would be better to fix each issue individually. It will make it easier to choose targeted reviewers for each change. This will also potentially save time later, if an issue pops up and bisection is used to find the culprit commit. So, let's just start with the seg fault fix.

@shino16

shino16 commented Nov 18, 2025

Copy link
Copy Markdown
Collaborator Author

Your suggestion makes sense, I'll submit separate small PRs. And thank you for your reviews in #2746! @beverlylytle

@shino16 shino16 closed this Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants