fix(packaging): build native NVIDIA DEB and RPM packages - #4
Open
shiptux wants to merge 16 commits into
Open
Conversation
Adapted from FlagAttention's working template (FlagOS Python component packaging pattern): - dh-python + pybuild + pybuild-plugin-pyproject - Architecture: all (noarch) - override_dh_auto_test runs a smoke import; pytest deferred to upstream GPU CI - packaging/debian/ + helpers/Dockerfile.deb (Ubuntu 22.04 base) - 'cp -r packaging/debian debian' inside the container to satisfy dpkg-buildpackage's debian/-at-root expectation Not yet built locally; expected to mirror FlagAttention's ~5 s build and small .deb size for the pure-Python paths.
- debian/control: move python3-torch from Depends to Recommends so
the package installs on systems where torch comes from pip / NGC
rather than from apt main archive. dh_python3 still auto-detects
torch via pyproject.toml's dependencies field via
${python3:Depends}; that's a separate follow-up if we want it
fully removed from .deb metadata.
- debian/rules: replace 'import <module>' smoke test with
importlib.util.find_spec to avoid triggering torch import at
build time. Fix '; exit 0' silent-pass bug with '&&' short-circuit.
- packaging/rpm/: mirror DEB packaging for Fedora targets.
shiptux
marked this pull request as draft
May 21, 2026 12:39
…mismatched Dockerfile)
Triggered on push tag v*, PR touching packaging/, or manual dispatch. Runs the existing local build helper in a container and uploads the produced .deb / .rpm as actions artifacts named 'flagtensor-amd64-packages' / 'flagtensor-amd64-rpm-packages', matching the central flagos-packaging publish pipeline's components/flagtensor.yml artifact_pattern.
shiptux
marked this pull request as ready for review
May 21, 2026 15:10
shiptux
marked this pull request as draft
May 21, 2026 16:48
…orch+triton from RPM Requires
…ger on src paths (flagos-ai#8); .dockerignore (flagos-ai#11)
shiptux
marked this pull request as ready for review
May 22, 2026 13:48
30 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates the packaging to match current
main. FlagTensor is no longer apure-Python/noarch-only project: it builds a native C++ operator library and a
CPython extension, and its source build obtains libtriton_jit through
FetchContent.
Package builds now use the installed
TritonJITCMake package instead ofbuilding a private copy.
Binary packages
Debian:
python3-flagtensor: backend-neutral Python sources (Architecture: all)libflagtensor-nvidia: CUDA C++ runtime and Triton kernel sourceslibflagtensor-nvidia-dev: headers andFlagTensorConfig.cmakepython3-flagtensor-nvidia: CPython 3.12 native extensionRPM produces the corresponding packages; the development package follows the
RPM
-develnaming convention.Implementation
FLAGTENSOR_USE_EXTERNAL_TRITON_JITpath usingfind_package(TritonJIT 0.1.0 CONFIG REQUIRED). The normal source-buildFetchContent path remains the default.
libtriton-jit-nvidia >= 0.1.0-3in both formats.libflagtensor.so.0, exportsFlagTensor::operators, and installs a consumable CMake package.extension and includes backend YAML data in the wheel/package.
CUDA/PyTorch libraries supplied by the NVIDIA runtime.
the Python 3.12 vendor environment because the distro package pulls in a
CPython 3.10 NumPy extension.
Validated ABI matrix
Verification
flagtensorandflagtensor.c_operators.find_package(FlagTensor CONFIG REQUIRED).the exported CMake target.
of RPATH/RUNPATH.
Dependency order
This PR depends on flagos-ai/libtriton_jit#61 being merged and
libtriton-jit-nvidia 0.1.0-3being published to the FlagOS APT/YUMrepositories. Local dependency directories are only for pre-publication
validation and ignore binary artifacts.