Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PyTorch THPVariable_Wrap to use const ref #843

Closed
wants to merge 1 commit into from

Conversation

huydhn
Copy link

@huydhn huydhn commented Oct 29, 2024

What does this PR do? Please describe:
This comes from a change from PyTorch pytorch/pytorch#138880 in which the signature of THPVariable_Wrap changes to

TORCH_PYTHON_API PyObject * THPVariable_Wrap(const at::TensorBase& var);

A build failure happens when importing the change to fbcode D65031075 for one project that is using fairseq2

Does your PR introduce any breaking changes? If yes, please list them:
This makes fairseq2 compatible with latest PyTorch, so I don't think there is any breaking change here.

Check list:

  • Was the content of this PR discussed and approved via a GitHub issue? (no need for typos or documentation improvements)
  • Did you read the contributor guideline?
  • Did you make sure that your PR does only one thing instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests?
  • Did you verify new and existing tests pass locally with your changes?
  • Did you update the CHANGELOG? (no need for typos, documentation, or minor internal changes)

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 29, 2024
@cyyever
Copy link

cyyever commented Oct 29, 2024

@huydhn Should this project use latest release of torch instead of the developing branch?

@huydhn
Copy link
Author

huydhn commented Oct 29, 2024

I think we have a chick-and-egg issue here. So here is the current interlocking setup:

I think I need to try writing an internal patch instead of waiting for this PR.

@huydhn huydhn marked this pull request as draft October 29, 2024 23:02
@huydhn
Copy link
Author

huydhn commented Oct 30, 2024

I will close this for now as the internal patch works (but brittle). I'll leave it to fairseq2 maintainers to decide when and how they want to make fairseq2 compatible with PT when it comes to this public function

@huydhn huydhn closed this Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants