Skip to content

Fix return type mismatch in choose_qparams_tensor_out #4711

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

Conversation

python3kgae
Copy link
Contributor

This fix addresses the undefined symbol error for torch::executor::native::choose_qparams_tensor_out when building on native Windows.

The root cause is a mismatch between the return types in the function declaration (std::tuple<Tensor &, Tensor &>) and the function definition (std::tuple<Tensor, Tensor>). Additionally, the function definition cannot see the function declaration, so the compiler cannot catch the issue. While the Linux linker seems to handle the return type mismatch, the Windows linker reports an undefined symbol.

This fix updates the return type in the function definition to match the function declaration. If possible, it would be beneficial to include the header of the function declaration so that the issue can be caught at compile time.

Fixes #4659

This fix addresses the undefined symbol error for torch::executor::native::choose_qparams_tensor_out when building on native Windows.

The root cause is a mismatch between the return types in the function declaration (std::tuple<Tensor &, Tensor &>) and the function definition (std::tuple<Tensor, Tensor>). Additionally, the function definition cannot see the function declaration, so the compiler cannot catch the issue. While the Linux linker seems to handle the return type mismatch, the Windows linker reports an undefined symbol.

This fix updates the return type in the function definition to match the function declaration. If possible, it would be beneficial to include the header of the function declaration so that the issue can be caught at compile time.
Copy link

pytorch-bot bot commented Aug 14, 2024

🔗 Helpful Links

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

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

✅ No Failures

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

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

@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 Aug 14, 2024
@manuelcandales manuelcandales self-requested a review August 14, 2024 14:28
@facebook-github-bot
Copy link
Contributor

@manuelcandales has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot merged commit c541bc1 into pytorch:main Aug 14, 2024
34 of 36 checks passed
kirklandsign pushed a commit to kirklandsign/executorch that referenced this pull request Aug 15, 2024
Differential Revision: D61272239

Pull Request resolved: pytorch#4711
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.

[Build] choose_qparams_tensor_out get wrong return type cause build fail on native Windows
3 participants