Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package tensorflow_addons #16888

Open
wants to merge 52 commits into
base: main
Choose a base branch
from
Open

Conversation

h-vetinari
Copy link
Member

@h-vetinari h-vetinari commented Nov 10, 2021

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipes/tensorflow-addons) and found it was in an excellent condition.

@h-vetinari
Copy link
Member Author

@conda-forge/tensorflow @jaimergp
Before , I could see that the upstream configure.py adds the following lines to .bazelrc:

build --action_env CUDA_TOOLKIT_PATH="/usr/local/cuda"
build --action_env CUDNN_INSTALL_PATH="/usr/lib/x86_64-linux-gnu"

Those variables seem to be specific to tf-addons (cannot find them elsewhere on GH), so will most likely need adapting. Any tips (much less joint maintainership) are appreciated. It seems that the INCLUDEDIR bit works in a different way here than in the tf-feedstock...

bazel-out/k8-opt/bin/external/local_config_tf/include/tensorflow/core/framework/full_type.pb.h:10:10: fatal error: google/protobuf/port_def.inc: No such file or directory
   10 | #include <google/protobuf/port_def.inc>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

PS. For OSX, we're missing more recent tf-builds (ever since the build-string got refactored) - or even better: add tensorflow-cpu for osx. Some discussion here.

@jaimergp
Copy link
Member

CUDNN_INSTALL_PATH is set to $PREFIX. I don't know what the build system will do with CUDA_TOOLKIT_PATH, but in principle, that path is correct on our Docker images and, if anything, it can be set to CUDA_HOME. I don't know what will happen if it's set to (BUILD_)PREFIX, but it might be worth a try (so our nvcc wrapper is found).

@h-vetinari
Copy link
Member Author

Thanks for the quick response!

CUDNN_INSTALL_PATH is set to $PREFIX.

Not sure if that's a comment that what I'm doing is questionable or that it should be like that (I guessed based on the expected header-path)...?

Copy link
Member

@xhochy xhochy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about also using the bazel-toolchain here (will probably be needed for osx, at least for osx-arm64`)? The latest changes in tensorflow in the bazel-toolchain should also fix some of the CUDA issues.

recipes/tensorflow-addons/meta.yaml Outdated Show resolved Hide resolved
@h-vetinari
Copy link
Member Author

What about also using the bazel-toolchain [...]?

Absolutely, I just hadn't had time to invest yet how to make use of that package. Happy to try.

@h-vetinari
Copy link
Member Author

Ah, I did not expect that bazel-toolchain does not depend on bazel, but I can understand why.

@h-vetinari
Copy link
Member Author

So tf-addons seems to process the cuda capabilities differently than tf proper. Also, I don't know what they're doing behind the scenes (sm_ vs. compute_).

Further point that jumped out from the log - since we're not dealing with manylinux etc., we probably don't need TF_CXX11_ABI_FLAG?

@h-vetinari h-vetinari force-pushed the tf-addons branch 2 times, most recently from 4f8c9ea to 9477c9f Compare November 11, 2021 02:35
# due to lack of ABI, we need the same version at runtime, see
# https://github.com/tensorflow/addons#c-custom-op-compatibility-matrix
- tensorflow {{ tf_version_maj_min }}.*
- libtensorflow_cc {{ tf_version_maj_min }}.*
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH, I don't understand this - it's already there as a host req, so why does it also need to be in run? - but without this we get:

  ERROR (tensorflow-addons,lib/[something].so): Needed DSO lib/libtensorflow_framework.so.2 found in ['libtensorflow_cc']
  ERROR (tensorflow-addons,lib/[something].so): .. but ['libtensorflow_cc'] not in reqs/run, (i.e. it is overlinking) (likely) or a missing dependency (less likely)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libtensorflow_cc doesn't have a run_exports, we should add one there.

@h-vetinari
Copy link
Member Author

OSX builds are blocked on conda-forge/tensorflow-feedstock#144...

@h-vetinari
Copy link
Member Author

OK, trying to add a reference to $SP_DIR/tensorflow/include runs into:

ERROR: /home/conda/staged-recipes/build_artifacts/tensorflow-addons_1638147416024/work/tensorflow_addons/custom_ops/image/BUILD:35:18: Compiling tensorflow_addons/custom_ops/image/cc/ops/resampler_ops.cc failed: The include path '/home/conda/staged-recipes/build_artifacts/[...]/lib/python3.7/site-packages/tensorflow/include' references a path outside of the execution root.

This SO answer has a number of steps to work around this (not sure if outdated), but before I try, is this something that bazel-toolchain is taking care of, or something it could do?
@xhochy

@h-vetinari
Copy link
Member Author

@xhochy, do you know a better way of handing an external dependency to bazel than the above?

@thadd3us-abcellera
Copy link

thadd3us-abcellera commented Feb 24, 2022

@xhochy, do you know a better way of handing an external dependency to bazel than the above?

@h-vetinari

Does it work to do something like this in .bazelrc:

# This syntax exposes the variable from the .envrc environment.
# https://bazel.build/designs/2016/06/21/environment.html#new-flag---action_env
build --action_env TF_HEADER_DIR
build --action_env TF_SHARED_LIBRARY_DIR
build --action_env TF_SHARED_LIBRARY_NAME
build --action_env TF_CXX11_ABI_FLAG

Are you able to get those environment variables set somehow, and then use this mechanism to expose them to bazel?

In my deployment, I was using direnv to get them into the environment.

@stale
Copy link

stale bot commented Jul 30, 2022

Hi friend!

We really, really, really appreciate that you have taken the time to make a PR on conda-forge/staged-recipes! conda-forge only exists because people like you donate their time to build and maintain conda recipes for use by the community.

In an effort to maintain this repository and increase the signal-to-noise for open PRs, the maintainers of staged-recipes close excessively old PRs after six months. This PR will remain open for another month, and then will be closed.

If you'd like to keep it open, please comment/push and we will be happy to oblige! Note that very old PRs will likely need to be rebased on main so that they can be rebuilt with the most recent CI scripts. If you have any trouble, or we missed reviewing this PR in the first place (sorry!), feel free to ping the team using a special command in a comment on the PR to get the attention of the staged-recipes team.

Cheers and thank you for contributing to this community effort!

@stale stale bot added the stale will be closed in 30 days label Jul 30, 2022
@h-vetinari
Copy link
Member Author

not stale

@h-vetinari
Copy link
Member Author

@thadd3us-abcellera

Sorry I overlooked your tip! Would you mind raising a PR against https://github.com/h-vetinari/staged-recipes/tree/tf-addons?

@h-vetinari
Copy link
Member Author

@conda-forge/help-python

For some reason the bot here has not removed the stale label - would someone be so kind to do that please?

@stale stale bot removed the stale will be closed in 30 days label Aug 1, 2022
@h-vetinari
Copy link
Member Author

Interesting, now it worked all of a sudden. Sorry for the noise (and this is not yet a request for review, unless someone wants to help me tell bazel where to look for the tensorflow shared lib).

@jonas-eschle
Copy link
Contributor

@h-vetinari does the above maybe do the trick?

@conda-forge-webservices
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipes/tensorflow-addons) and found it was in an excellent condition.

@stale
Copy link

stale bot commented Jul 22, 2023

Hi friend!

We really, really, really appreciate that you have taken the time to make a PR on conda-forge/staged-recipes! conda-forge only exists because people like you donate their time to build and maintain conda recipes for use by the community.

In an effort to maintain this repository and increase the signal-to-noise for open PRs, the maintainers of staged-recipes close excessively old PRs after six months. This PR will remain open for another month, and then will be closed.

If you'd like to keep it open, please comment/push and we will be happy to oblige! Note that very old PRs will likely need to be rebased on main so that they can be rebuilt with the most recent CI scripts. If you have any trouble, or we missed reviewing this PR in the first place (sorry!), feel free to ping the team using a special command in a comment on the PR to get the attention of the staged-recipes team.

Cheers and thank you for contributing to this community effort!

@stale stale bot added the stale will be closed in 30 days label Jul 22, 2023
Copy link

stale bot commented Jan 1, 2024

Hi again! About a month ago, we commented on this PR saying it would be closed in another month if it was still inactive. It has been a month and so now it is being closed. Thank you so much for making it in the first place and contributing to the community project that is conda-forge. If you'd like to reopen this PR, please feel free to do so at any time!

Cheers and have a great day!

@stale stale bot closed this Jan 1, 2024
@h-vetinari h-vetinari reopened this Jan 1, 2024
@stale stale bot removed the stale will be closed in 30 days label Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

[Package request] tensorflow-addons Request: tensorflow-addons
8 participants