Bug 258621 - [NEW] science/libtensorflow2: C API for TensorFlow, an open source platform for machine learning
Summary: [NEW] science/libtensorflow2: C API for TensorFlow, an open source platform f...
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords: feature, needs-qa
Depends on:
Blocks:
 
Reported: 2021-09-20 02:29 UTC by William Muir
Modified: 2024-03-30 18:28 UTC (History)
6 users (show)

See Also:


Attachments
generated diff of new port (10.82 KB, patch)
2021-09-20 02:29 UTC, William Muir
no flags Details | Diff
generated diff of new port (12.46 KB, patch)
2021-11-06 15:52 UTC, William Muir
no flags Details | Diff
generated diff of new port (12.21 KB, patch)
2021-12-26 12:54 UTC, William Muir
no flags Details | Diff
generated diff of new port (12.73 KB, patch)
2021-12-26 17:04 UTC, William Muir
no flags Details | Diff
generated diff of new port (14.04 KB, patch)
2021-12-28 01:38 UTC, William Muir
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description William Muir 2021-09-20 02:29:15 UTC
Created attachment 228035 [details]
generated diff of new port

TensorFlow is an end-to-end open source platform for machine learning. It has a comprehensive, flexible ecosystem of tools, libraries, and community resources that lets researchers push the state-of-the-art in ML and developers easily build and deploy ML-powered applications. The TensorFlow C API is typically a requirement of TensorFlow APIs in other languages such as Go and Rust.
Comment 1 William Muir 2021-11-06 15:52:41 UTC
Created attachment 229326 [details]
generated diff of new port

Update to 2.7.0
Comment 2 Paul Armstrong 2021-12-25 12:14:35 UTC
Suggest calling it math/libtensorflow2

There's work being done on libtensorflow1 as that's still needed by some apps.
Comment 3 Paul Armstrong 2021-12-25 12:29:14 UTC
Also, maybe science instead of math (just so it's in the same section as the rest of the tensorflow ports)?
Comment 4 Paul Armstrong 2021-12-26 04:13:57 UTC
Ref science/libtensorflow1: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260694

We should probably both update our ports to add each others ports to CONFLICTS_INSTALL?

I've held off on that temporarily until the naming is formalised
Comment 5 William Muir 2021-12-26 12:03:38 UTC
(In reply to Paul Armstrong from comment #3)

Agree and done
Comment 6 William Muir 2021-12-26 12:54:14 UTC
Created attachment 230422 [details]
generated diff of new port

Rename port to science/libtensorflow2
Add CONFLICTS_INSTALL with science/libtensorflow1

Additional updates:
 - Add CPE information to port
 - Support aarch64 (now supported by devel/bazel)
 - Do not color logs
 - Increase verbosity of tests
 - Restrict bazel worker instanced to MAKE_JOBS_NUMBER

I expect to make another update to this port in the near future to make port options consistent with those in science/libtensorflow1 (e.g., for AVX/AVX2 options under amd64).
Comment 7 William Muir 2021-12-26 17:04:58 UTC
Created attachment 230427 [details]
generated diff of new port

Add makefile options for CPU vector processing extensions (AVX/AVX2, amd64 only)
Comment 8 Xin LI freebsd_committer freebsd_triage 2021-12-28 01:16:15 UTC
(In reply to William Muir from comment #7)
Hi, the latest version of patch seems to be corrupted at line 213, could you please regenerate the patch with e.g. `git format-patch HEAD^..HEAD`?
Comment 9 William Muir 2021-12-28 01:38:11 UTC
Created attachment 230482 [details]
generated diff of new port

Replace with re-generated patch
Comment 10 William Muir 2021-12-28 01:51:11 UTC
(In reply to Xin LI from comment #8)

The same review comment from science/libtensorflow1, re:network calls/downloads during build, will apply here.  Bazel's --override_repository flag can be used, it'll just take some work on the port to implement.

Hopefully whatever issue you encountered with the previos patch is resolved.  I re-generated and was able to successfully apply this new version of the patch.
Comment 11 Xin LI freebsd_committer freebsd_triage 2021-12-28 03:20:30 UTC
(In reply to William Muir from comment #10)
Thanks! The latest patch worked like a charm.

pylint -C did issue a warning (`WARN: Makefile: you may want directory for dependency numpy>=1.16,1<1.21,1 to be math/py-numpy@${PY_FLAVOR}`), but it appears like a bug of pylint so let's ignore it for now.  I'll take a look on what we can do.

Regarding to the network call/download -- we still want to have that solved (this would enable building official packages, etc.)
Comment 12 Paul Armstrong 2022-06-12 07:15:07 UTC
I spent a day poking at this to see if I could get it functional. 

The pain point right now is that it's still trying to download tensorflow/runtime and I've hit a roadblock trying to understand why it's doing so. I thought it might be --deleted_packages, but that doesn't seem to make a difference.

"WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/tensorflow/runtime/archive/093ed77f7d50f75b376f40a71ea86e08cedb8b80.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found"

The repository with my updates is https://github.com/psa/libtensorflow2-freebsd-port

Anyone got ideas on where to go from here?
Comment 13 Mark Linimon freebsd_committer freebsd_triage 2024-03-30 02:27:01 UTC
^Triage: appears ready to be reviewed by a ports committer.
Comment 14 Diane Bruce freebsd_committer freebsd_triage 2024-03-30 18:28:52 UTC
Coming into this late (just noticed Mark's email) but would this port replace the present tensorflow ? The tensorflow in ports currently does not compile anyway.