Skip to content

fix(wheel): auto-discover manylinux platform tag via auditwheel repair#888

Merged
mc-nv merged 11 commits intomainfrom
mchornyi/TRI-286/kitmaker-2-0-process-enablement
Apr 18, 2026
Merged

fix(wheel): auto-discover manylinux platform tag via auditwheel repair#888
mc-nv merged 11 commits intomainfrom
mchornyi/TRI-286/kitmaker-2-0-process-enablement

Conversation

@mc-nv
Copy link
Copy Markdown
Contributor

@mc-nv mc-nv commented Apr 15, 2026

Resolves: TRI-286
triton-inference-server/server#8743
triton-inference-server/model_analyzer#1019

Description

Replace the hard-coded manylinux platform tag in the tritonclient wheel build with auditwheel repair, which automatically discovers the correct manylinux_X_Y_{arch} tag from the actual glibc symbol dependencies of the native extensions.

Previously build_wheel.py passed a static platform tag (e.g. manylinux2014_x86_64) that was incorrect for wheels built on Ubuntu 24.04 (glibc 2.39). auditwheel repair inspects the compiled extensions at build time and emits a correctly-tagged manylinux wheel without requiring manual maintenance.

Pure-Python (any) wheels are unaffected — they follow the existing else branch and auditwheel is never invoked.

Changes

  • fix(TRI-286): simplify auditwheel repair — remove show guard
  • fix(TRI-286): fall back to copy-as-is if wheel has no native extensions
  • fix(TRI-286): auto-discover manylinux platform tag via auditwheel repair
  • fix(TRI-286): correct x86_64 manylinux platform tag to match Ubuntu 24.04 build host
  • fix(TRI-286): use manylinux2014_x86_64 platform tag for tritonclient wheel

Affected Files

  • src/python/library/build_wheel.py

mc-nv added 5 commits April 15, 2026 08:54
…wheel

manylinux1 (glibc 2.5 / CentOS 5) is deprecated and inconsistent with
the aarch64 and ppc64le builds which already use manylinux2014.
Kitmaker K2 wheel validation may reject a manylinux1-tagged wheel built
in a modern Ubuntu container.  Align x86_64 with the other architectures.
…4.04 build host

Wheels built on Ubuntu 24.04 (glibc 2.39) cannot honestly claim manylinux1
or manylinux2014 compatibility; auditwheel/K2 validation will reject them.
Use manylinux_2_39_x86_64 (PEP 600 style) which accurately reflects the
minimum glibc required by a Ubuntu 24.04 build.

aarch64/ppc64le tags left as-is pending confirmation of their build host OS.
TODO: add auditwheel repair step to auto-detect actual minimum glibc per arch.
Replace the hard-coded per-arch manylinux tags with auditwheel repair,
which introspects the wheel's native extensions and emits the correct
manylinux_2_X_{arch} tag based on actual glibc symbol requirements.

Build flow for --linux:
  1. python setup.py bdist_wheel --plat-name linux_{arch}
     (bare tag — honest but not pip-installable as-is)
  2. auditwheel repair → manylinux_2_X_{arch} wheel in dest-dir
     (scans .so files, determines minimum glibc, bundles non-system libs)

This handles x86_64, aarch64, and ppc64le uniformly without manual
version pinning and adapts automatically when the build host OS changes.

Requires: pip install auditwheel  (add to SDK image or CI job setup)
auditwheel repair raises NonPlatformWheel and exits non-zero when the
wheel contains no .so files.  Guard with auditwheel show first; if the
wheel is pure-Python, copy it directly without retagging.
The --linux wheel always contains native extensions (shared memory,
gRPC, HTTP); the NonPlatformWheel fallback is unnecessary and masks
real build errors.  Call auditwheel repair directly.
mc-nv added 6 commits April 15, 2026 11:17
auditwheel repair fails when the wheel has no native ELF extensions.
tritonclient is pure Python, so repair exits with "no ELF executable
or shared library file found". Fall back to auditwheel addtag, which
stamps the correct manylinux platform tag without requiring .so files.
auditwheel's logging goes to stderr (Python logging module default),
not stdout. The previous check `"no ELF" in r.stdout` never matched,
so the addtag fallback was never triggered and the build failed.
auditwheel repair fails on pure Python wheels (no ELF). Two bugs fixed:
1. Check r.stderr (not r.stdout) for the "no ELF" sentinel — auditwheel
   logs via Python's logging module which writes to stderr.
2. Use `python -m wheel tags --remove` instead of `auditwheel addtag`;
   the addtag subcommand was removed in auditwheel 6.0. Copy the wheel to
   dest_dir first, then retag in-place so the output lands in the right
   location.

Local reproducer confirms mypkg-1.0-py3-none-manylinux_2_28_x86_64.whl
is produced correctly.
…thon wheel

After PR #797 removed libcshm.so (C shared memory shim), tritonclient
has no native extensions. shared_memory is pure Python (mmap/ctypes) and
cuda_shared_memory uses cuda.bindings (pure Python package). A single
py3-none-any wheel is correct and sufficient for all platforms.

Remove the --plat-name linux_{arch} / auditwheel repair complexity from
the --linux build path. Both --linux and non-linux paths now produce
py3-none-any via a simple bdist_wheel invocation.
perf_analyzer is always distributed separately and never bundled into
the tritonclient wheel. Remove the --perf-analyzer argument from
build_wheel.py, the TRITON_PACKAGE_PERF_ANALYZER guard from
CMakeLists.txt, and the dead data_files branch from setup.py.
…ux-client-wheel

shared_memory and cuda_shared_memory are pure Python after PR #797
removed libcshm.so. There is no longer a reason to gate them behind
--linux. Include them unconditionally in the single generic wheel,
guarded only by os.path.isdir so the build still works on platforms
where those subdirectories are absent.

Remove --linux argument from build_wheel.py and drop the
linux-client-wheel cmake target entirely. A single py3-none-any wheel
now contains all tritonclient modules.
@mc-nv mc-nv marked this pull request as ready for review April 17, 2026 16:47
@mc-nv mc-nv requested a review from mudit-eng April 17, 2026 17:19
@mc-nv mc-nv merged commit 0216ee2 into main Apr 18, 2026
3 checks passed
@mc-nv mc-nv deleted the mchornyi/TRI-286/kitmaker-2-0-process-enablement branch April 18, 2026 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants