[pytorch] Bundle libgomp.so.1 into Linux wheels #10447
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.36) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 197 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.316
Real PR Conversation Timeline
1 comments
"Review active on #10447"
general
weight: 0.35
ScottTodd
Motivation
torch_cpulinks against the system libgomp (OpenMP runtime), but it isn't guaranteed to be present on the machine running the wheel. Upstream PyTorch bundles libgomp into its manylinux wheels via its repair_wheel.py. Mirror that here by copying it intotorch/libbefore the wheel is built, the same waycopy_msvc_libomp_to_torch_libalready bundleslibomp140for Windows.Fixes #9809
Technical Details
Locate
libgomp.so.1from hardcoded path/usr/lib64/libgomp.so.1(verified in the build image), fallback toldconfig -pwhen the hardcoded path does not exist.Copies
libgomp.so.1intotorch/libbefore the wheel is built.Test Plan
python3 -c "import ast; ast.parse(open('external-builds/pytorch/build_prod_wheels.py').read())"andpython3 -m py_compile external-builds/pytorch/build_prod_wheels.pyTest Result
Copying libgomp from '/usr/lib64/libgomp.so.1' to '/__w/TheRock/TheRock/external-builds/pytorch/pytorch/torch/lib'in loglibgomp.so.1undertorch/liband import torch works on a freshubuntu:24.04containerSubmission Checklist