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

python_version parameter in bazel BUILD file seems to make no difference #135

Closed
kristofgiber opened this issue Aug 2, 2019 · 2 comments

Comments

@kristofgiber
Copy link

kristofgiber commented Aug 2, 2019

I have tried two different options for training the punctuator model on Ubuntu 16.04.
In one, I have built the lingvo_py_binary 'trainer' (cuda enabled) binary which has its python_version parameter set 'PY2' and has model_imports and trainer_lib in deps. Intuitively, this build allows me to run my training fine using Python2.7 interpreter. Then I remove this build and instead I build the 'ipython_kernel' binary which includes the same deps as trainer (and some more) but the python_version is set 'PY3'. Strangely, even with this build I can run my training fine using the same Python2.7 interpreter. Bazel docs says this flag is supposed to control which python version you build the binary for.

Question:
Should the python_version in the BUILD file be changed to the interpreter used? Am I going to have some issues with the latter ('PY3') build if I run it with python2.7 interpreter despite the training looking okay for now, perhaps certain functions in the background aren't working as they are supposed to or the performance may be affected?
Or is it safe to ignore the value of the 'python_version' in the BUILD file and go ahead no matter what it is?

@jonathanasdf
Copy link
Contributor

I think I read somewhere that python_version in bazel doesn't work as intended for now.

Lingvo should be compatible with both python2 and python3 at the moment so it probably doesn't matter.

@kristofgiber
Copy link
Author

Okay that sounds good. The bazel docs relevant section does mention the bug that you may be referring to:

Bug warning: This attribute sets the version for which Bazel builds your target, but due to #4815, the resulting stub script may still invoke the wrong interpreter version at runtime. See this workaround, which involves defining a py_runtime target that points to either Python version as needed, and activating this py_runtime by setting --python_top.

But the referred issue recently has been deprioritized saying it's now fixed (Except for Windows). Not sure this affects any behavior then but since you say lingvo is compatible with both PY2 and PY3 anyway that's reassuring. Thank you

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

No branches or pull requests

2 participants