#59179 closed enhancement (fixed)

py-tensorflow*: copy version 1 into new version 1 ports

Reported by: blair (Blair Zajac) Owned by: blair (Blair Zajac)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: cjones051073 (Chris Jones)
Port: py-tensorflow

Description

I'm using https://github.com/tensorflow/tfjs and there's an optimization where one can copy the native compiled tensorflow shared libraries into a Node project, see https://github.com/tensorflow/tfjs/tree/master/tfjs-node#optional-build-optimal-tensorflow-from-source .

tfjs is still on version 1.x.y and it appears that it uses shared libraries from Tensorflow 1.x.y:

$ ls -l node_modules/@tensorflow/tfjs-node/deps/lib/
total 241088
-r-xr-xr-x 1 blair staff 212756132 Dec 31  1999 libtensorflow.1.14.0.dylib
lrwxr-xr-x 1 blair staff        26 Oct  5 08:16 libtensorflow.1.dylib -> libtensorflow.1.14.0.dylib
lrwxr-xr-x 1 blair staff        21 Oct  5 08:16 libtensorflow.dylib -> libtensorflow.1.dylib
-r-xr-xr-x 1 blair staff  27947528 Dec 31  1999 libtensorflow_framework.1.14.0.dylib
lrwxr-xr-x 1 blair staff        36 Oct  5 08:16 libtensorflow_framework.1.dylib -> libtensorflow_framework.1.14.0.dylib
lrwxr-xr-x 1 blair staff        31 Oct  5 08:16 libtensorflow_framework.dylib -> libtensorflow_framework.1.dylib

However, the new py-tensorsor makes version 2 dylibs:

$ port contents py37-tensorflow | grep libtensorflow_framework
  /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow_core/libtensorflow_framework.2.0.0.dylib
  /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow_core/libtensorflow_framework.2.dylib
  /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow_core/libtensorflow_framework.dylib

I want to copy py-tensor* into version 1 ports.

I'll do the work, however, what should we name py-tensorboard, py-tensorflow and py-tensorflow_estimator? Just add a 1 at the end? It doesn't seem that clean, I would prefer 1.x or something. We're on 1.14 now and 1.15 will come out soon.

Thoughts?

BTW, I'll do the upgrade work to 1.15 when it's released.

Change History (11)

comment:1 Changed 17 months ago by cjones051073 (Chris Jones)

I would just name them <XYZ>1. I do not see any need to out the minor version as well in the port name, as I am not sure I can see a use case for having multiple 1.x ports available.

Version 0, edited 17 months ago by cjones051073 (Chris Jones) (next)

comment:2 Changed 17 months ago by cjones051073 (Chris Jones)

B.t.w. Can I request when you add the new ports please do not implement them as new stand alone portfiles. Instead please use the same model as in the bazel portfile, where each of the older versioned builds are implemented as sub ports. In this way you can avoid a lot of code duplication, as the build for tensorflow 1 and 2 is pretty much the same.

comment:3 Changed 17 months ago by blair (Blair Zajac)

I looked through all the py37-* ports for major version differences. I found: py37-gmpy{,2}, py37-gobject{,3}, py37-markdown{,2}, py37-poppler-qt{4,5}, py37-pyqt{4,5}, py37-pyside{,2} and they all have distinct Portfiles.

The only port that seemed close to what you're suggesting is py37-qscintilla-qt{4,5}, however, that has that same version, 2.11.2, for both the Qt4 and Qt5 version. Also, the code does a lot of work, it a two nested foreach loops, one for Qt version and one for Python version.

It overall seems like a lot of work and it'll make the py-tensorflow more complicated. Also, Tensorflow 1.15 will be the last 1.x version, so it may make it harder to do work on py-tensorflow 2.x just to maintain an older version continuously.

Thoughts?

comment:4 Changed 17 months ago by cjones051073 (Chris Jones)

I fail to see how what other ports do is really that relevant. As a maintainer, I am asking you to make it a subport please, just as in bazel. I will not compromise on this.

comment:5 Changed 17 months ago by cjones051073 (Chris Jones)

Sorry. I just realised the complication after sending my last message, which is the port also uses the python portgroup, which of course bazel does not... that does complicate things beyond what i was imaging...

Ok, you win. I guess A separate file will sadly have to do....

comment:6 Changed 17 months ago by blair (Blair Zajac)

In 80334cd5b05c2327cae8ebd4cd3561a10cfa6eb4/macports-ports (master):

py-tensorboard1: new port copied from version 1.15.0 of py-tensorboard.

See: #59179

comment:7 Changed 17 months ago by blair (Blair Zajac)

In 561437ea337022bdb62b0478c286f635b17333cf/macports-ports (master):

py-tensorflow_estimator1: new port copied from version 1.15.1 of py-tensorflow_estimator.

See: #59179

comment:8 Changed 17 months ago by blair (Blair Zajac)

In d3bf0b9b1edffbd4113290404c1c6d8d2b576f43/macports-ports (master):

py-tensorflow1: new port copied from version 1.14.0 of py-tensorflow.

See: #59179

comment:9 Changed 13 months ago by ryandesign (Ryan Schmidt)

This can be closed, right? The requested ports were added.

comment:10 Changed 13 months ago by cjones051073 (Chris Jones)

yes it should be closed now.

comment:11 Changed 13 months ago by cjones051073 (Chris Jones)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.