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

Build Addons for Windows (CPU) #771

Merged
merged 17 commits into from
Dec 19, 2019

Conversation

seanpmorgan
Copy link
Member

@seanpmorgan seanpmorgan commented Dec 15, 2019

Fixes #173

  • Compile custom ops on MSVC2017
  • Fix packaging of whl
  • Travis build

TODO (Future Issues):

@seanpmorgan seanpmorgan requested review from facaiy and a team as code owners December 15, 2019 19:58
@seanpmorgan seanpmorgan force-pushed the bld-windows-cpu branch 2 times, most recently from a04fed8 to 4cb1cba Compare December 18, 2019 03:38
@seanpmorgan
Copy link
Member Author

seanpmorgan commented Dec 19, 2019

@tensorflow/sig-addons-maintainers ready for review.

Built with travis and pushed to pypi test:
https://travis-ci.org/seanpmorgan/addons/builds/626967246
https://test.pypi.org/project/tensorflow-addons/0.7.0.dev0/#files

No py27 package since theres no binary for TF2.1.0rc1 but it should be there for the full release.

Tested on windows VM:

pip install tensorflow==2.1.0rc1
pip install -i https://test.pypi.org/simple/ tensorflow-addons==0.7.0.dev0 --no-deps
>>> import tensorflow as tf
>>> import tensorflow_addons as tfa
>>>
>>> print(tf.__version__)
2.1.0-rc1
>>> print(tfa.__version__)
0.7.0-dev
>>> tf.debugging.set_log_device_placement(True)
>>>
>>> x = tf.constant([[0.5, 1.2, -0.3]])
2019-12-18 19:29:22.789977: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'nvcuda.dll'; dlerror: nvcuda.dll not found
>>> layer = tfa.layers.GeLU()
>>> print(layer(x))
2019-12-18 19:29:35.200914: I tensorflow/core/common_runtime/eager/execute.cc:573] Executing op __inference_gelu_7 in device /job:localhost/replica:0/task:0/device:CPU:0
x: (_Arg): /job:localhost/replica:0/task:0/device:CPU:0
2019-12-18 19:29:35.209845: I tensorflow/core/common_runtime/placer.cc:54] x: (_Arg): /job:localhost/replica:0/task:0/device:CPU:0
Addons>Gelu: (Addons>Gelu): /job:localhost/replica:0/task:0/device:CPU:0
2019-12-18 19:29:35.217653: I tensorflow/core/common_runtime/placer.cc:54] Addons>Gelu: (Addons>Gelu): /job:localhost/replica:0/task:0/device:CPU:0
Identity: (Identity): /job:localhost/replica:0/task:0/device:CPU:0
2019-12-18 19:29:35.224838: I tensorflow/core/common_runtime/placer.cc:54] Identity: (Identity): /job:localhost/replica:0/task:0/device:CPU:0
identity_RetVal: (_Retval): /job:localhost/replica:0/task:0/device:CPU:0
2019-12-18 19:29:35.235247: I tensorflow/core/common_runtime/placer.cc:54] identity_RetVal: (_Retval): /job:localhost/replica:0/task:0/device:CPU:0
tf.Tensor([[ 0.345714    1.0617028  -0.11462908]], shape=(1, 3), dtype=float32)

@seanpmorgan seanpmorgan changed the title [WIP] Build Addons for Windows (CPU) Build Addons for Windows (CPU) Dec 19, 2019
Copy link
Member

@WindQAQ WindQAQ left a comment

Choose a reason for hiding this comment

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

Thank you for the effort on build stuff!

README.md Outdated Show resolved Hide resolved
@@ -1,5 +1,3 @@
workspace(name = "tensorflow_addons")

Copy link
Member

Choose a reason for hiding this comment

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

Why do we get rid of the workspace name here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, so I tried for a while to get this to work. Windows seemed unwilling to copy the files during build_pip_pkg if the directory was specified using workspace. Possibly related to windows sym-links but I'm not really sure. It's worth figuring out, but I've had about as much of windows build as I can stand for a while :P

The workspace name is something I added during CUDA10.1 PR and isn't being done for custom-op:
https://github.com/tensorflow/custom-op/blob/master/WORKSPACE

@@ -38,7 +38,7 @@ struct Rrelu {
typename TTypes<T>::Tensor alpha,
typename random::SimplePhilox& random) {
if (training) {
T storage[alpha.size()];
T* storage = new T[alpha.size()];
Copy link
Member

Choose a reason for hiding this comment

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

tools/ci_build/builds/release_windows.sh Outdated Show resolved Hide resolved
@WindQAQ WindQAQ self-requested a review December 19, 2019 16:19
Copy link
Member

@WindQAQ WindQAQ left a comment

Choose a reason for hiding this comment

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

Thanks! Let's get this merged and deal with other issues later :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build Addons for Windows
3 participants