Translation(s): српски


This is the homepage outlining the progress being made on packaging Tensorflow for debian. Any information gleamed from various threads in the debian-ai mailing list will be made available here.

Tensorflow packaging

The Salsa repo is here: https://salsa.debian.org/deeplearning-team/tensorflow The package is classic quilt (3.0) source, so patches outside the debian dir should be managed in quilt. There are upstream, pristine-tar and master branches, which I believe is the conventional git-buildpackage layout.

Background

TensorFlow is an important package for Debian due to it's importance as one of the top 2 Machine Learning frameworks alongside PyTorch. Packaging work is ongoing since the build system bazel was uploaded in Oct 2020. This work is being done under the Debian Deep Learning team banner, co-ordinated on the debian-ai mailing list.

Because bazel is new (and has some ideas antithetical to debian packaging) there is no debhelper support so packaging is relatively hard work, and includes developing workflows and patterns for debian builds of bazel-using packages.

History

Before bazel was packaged in debian it was very difficult to build TensorFlow. Mo Zhou <cdluminate@gmail.com> worked around it by using an alternate build system and succeeded in uploading a package to experimental [https://tracker.debian.org/news/1015398/accepted-tensorflow-1101dfsg-a2-source-into-experimental/|experimental]] However it was removed the following year due to the maintenance burden for a fast-moving package being too high. The Debian-Med team along with Google managed to package Bazel as bazel-bootstrap in October 2020, enabling a more conventional packaging effort to proceed.

Current Status

Wookey <wookey@debian.org> has recently (1st half of 2020) been doing work on getting it in a state suitable for upload.

Version 2.3.1 is being packaged initially. We will move to 2.4 as soon as 2.3.1 is basically working.

The current packaging produces three packages: libtensorflow-cc2 (C++ library) libtensorflow-framework2 (framework library) libtensorflow-dev (headers, pkgconfig files)

The c-library version does not yet build because it depends on unpackaged things: google-storageapi and various aws-* packages The python bindings and tensorflowlite libraries have not yet been packaged but are high priorities.

Contact

Conversations are taking place under the debian-ai@lists.debian.org mailing list and it is best to keep TensorFlow related discussions there if possible.

Also the debian-ai IRC channel on the OFTC IRC network: * #debian-ai: https://lists.debian.org/debian-ai/

To Do

Things still to do:

Bazel issues

Open Questions

Current open questions arising from mailing list conversations:

Commands to attempt build

# Commands to attempt to build packages locally if useful:
DEBEMAIL="firstname.lastname@domain.com"
>DEBFULLNAME="Firstname Lastname"
export DEBEMAIL DEBFULLNAME
git clone https://salsa.debian.org/deeplearning-team/tensorflow.git salsa
wget http://wookware.org/files/tensorflow_2.3.1.orig.tar.xz
cd salsa
# Install the build-depends of tensorflow
mk-build-deps --install --tool 'apt-get --yes --no-install-recommends' --remove ./debian/control
rm -rf tensorflow-build-deps_*.buildinfo
rm -rf tensorflow-build-deps_*.changes
debuild -sa -b -uc -us --jobs=8 || true

Adding Patches to Source

TensorFlow packaging uses Quilt for patches rather than Git. A very useful tutorial on its usage can be found here: https://raphaelhertzog.com/2012/08/08/how-to-use-quilt-to-manage-patches-in-debian-packages/

Building Tensorflow Lite

Tensorflow Lite has not yet been packaged, figuring out how to add it as a target for Bazel is the issue, there is however the possibility of building it with CMake from v2.4 onwards:
https://www.tensorflow.org/lite/guide/build_cmake

Packages depending on Tensorflow

Package

Info

Chiron

https://github.com/haotianteng/chiron

Tensorboard

https://lists.debian.org/debian-ai/2020/11/msg00019.html

NanoVar

https://github.com/cytham/nanovar/blob/master/requirements.txt

ArmNN Delegate

https://arm-software.github.io/armnn/21.05/md_delegate__build_guide_native.xhtml