pytorch / pytorch/pytorch

Wheels include protobuf headers (and headers for other projects)

Open
#164,883 2 comments 0 reactions 0 assignees View on GitHub
enhancement module: binaries module: cpp triaged
Dominant language
Python
Stars
103k
Forks
29.5k
PR merge metrics
PR metrics pending

Description

### 🐛 Describe the bug

The torch 2.8 wheels contain headers for other projects that torch shouldn't be providing headers for as part of its wheel.

https://pypi-browser.org/package/torch/torch-2.8.0-cp313-cp313-manylinux_2_28_x86_64.whl

The `torch/include/google` files are such a case -- about 100 headers for protobuf. However, these headers are part of protobuf. As such, they should come from whatever protobuf install the user consuming torch is using.

When present, these copies can end up found by include search paths, resulting in the wrong headers for e.g. protobuf being used, which causes confusing error messages.

Skimming the listed headers, i get the sense the same may be true for other headers, but its not obvious to me which. e.g. asmjit, dnnl, cpuinfo.h, fmt, pybind11, and probably others.

I get the sense the problem here is some sort of "include all the files" setting in the wheel building taking everything in a directory instead of only relevant files/directories.

I didn't check the license of these files, so, hope there aren't issues there.

### Versions

2.8

cc @seemethere @malfet @atalman @jbschlosser

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.