Skip to content

Commit

Permalink
configure: Remove --with_cuda option.
Browse files Browse the repository at this point in the history
This removes the --with_cuda option from ./configure, forcing the base
tensorflow package to always be used, rather than re-writing it to
tensorflow-gpu. Because of this, I no longer need to generate a
requirements.txt file from tools/requirements, so that can be removed,
simplifying the build process.

For now, I retain the 'with_cuda' field in the config.pbtxt proto, but
hardcode its value to False. Future patches will replace checks on
this field to calls to runtime libraries, such as using
GPUtil.getGPUs() for Python, defined in //third_party/py/gputil.

github.com/ChrisCummins/phd/issues/73

Signed-off-by: format 2020.01.16 <github.com/ChrisCummins/format>

[Exported from 65210d58caddc06dd0aa321c4afdc83dfe21de71]
  • Loading branch information
ChrisCummins committed Jan 24, 2020
1 parent 2fa5ef4 commit b646886
Show file tree
Hide file tree
Showing 3 changed files with 222 additions and 6 deletions.
216 changes: 216 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
# Python package dependencies.
# This file is copied to $ROOT/requirements.txt during configure. The reason
# for this is because the TensorFlow package is replaced with tensorflow-gpu
# if --with-cuda is enabled.
absl-py==0.7.0
appdirs==1.4.3
appnope==0.1.0
ascii_art==0.1.0
aspy.refactor-imports==1.1.0
astroid==1.6.1
attrs==19.3.0
autoenv==1.0.0
backports-abc==0.5
backports.functools-lru-cache==1.5
backports.shutil-get-terminal-size==1.0.0
bibtexparser==1.1.0
bleach==1.5.0
bokeh==1.0.2
cached-property==1.5.1
certifi==2018.4.16 # Dependency of requests.
cffi==1.11.5
chardet==3.0.4 # Dependency of requests.
checksumdir==1.0.5
Click==7.0
configparser==3.5.0
coverage==4.5.1 # Needed by pytest-cov.
cpplint==1.3.0
cycler==0.10.0
dash==0.39.0
dash-core-components==0.44.0
dash-html-components==0.14.0
dash-renderer==0.20.0
dash-table==3.6.0
dataclasses==0.6
decorator==4.3.0
detect-secrets==0.12.4
# The graph_nets package depends on a specific version of dm-sonnet. See:
# https://github.com/deepmind/graph_nets/blob/master/setup.py
dm-sonnet==1.23
docutils==0.14
editdistance==0.3.1
entrypoints==0.2.3
enum34==1.1.6
fasteners==0.15
flaky==3.6.1
Flask==1.0.2
Flask-Compress==1.4.0
flask-cors==3.0.6
Flask-SQLalchemy==2.4.0
fs==2.4.8
fs.sshfs==0.11.1
funcsigs==1.0.2
futures==3.1.1
fuzzywuzzy==0.16.0
gast==0.2.2. # Dependency of tensorflow.
GitPython==2.1.11
GPUtil==1.4.0
graph_nets==1.0.2
graphviz==0.9
grpcio-tools==1.18.0
grpcio==1.18.0
gspread==3.1.0
gspread-dataframe==3.0.3
gym==0.10.5
h5py==2.9.0
html5lib==0.9999999
httplib2==0.14 # Needed by oauth2client
humanize==0.5.1
importlib-metadata==0.23 # Needed by pytest.
idna==2.6 # Dependency of requests.
inotify==0.2.10
ipaddress==1.0.23 # Dependency of urllib3
ipdb==0.11
ipykernel==4.8.2
ipython-genutils==0.2.0
ipython==5.7.0
ipywidgets==7.1.2
isort==4.3.4
itsdangerous==1.1.0 # Dependency of dash.
jedi==0.11.1
jinja2==2.10.1
jsonschema==2.6.0
jupyter-client==5.2.2
jupyter-console==5.2.0
jupyter-core==4.4.0
jupyter==1.0.0
# Support for local runtimes with Google Colaboratory. See:
# https://research.google.com/colaboratory/local-runtimes.html
jupyter_http_over_ws==0.0.1a3
jwt==0.6.1 # Dependency PyGithub.
Keras==2.3.1
kiwisolver==1.0.1
lazy-object-proxy==1.3.1
lru-dict==1.1.6
MarkupSafe==1.0
matplotlib==2.2.0rc1
mccabe==0.6.1
memory-profiler==0.55.0
mistune==0.8.3
monotonic==1.5 # Needed by fasteners.
more-itertools==7.2.0 # Need by pytest.
mypy-extensions==0.4.3
mysqlclient==1.4.2.post1
nbconvert==5.3.1
nbformat==4.4.0 # Needed by notebook.
networkx==2.2
notebook==5.7.8
numpy==1.16.4
oauth2client==4.1.3
packaging==19.2 # Needed by pytest.
pandas==0.24.1
pandas-bokeh==0.0.2
pandocfilters==1.4.2
paramiko==2.6.0 # Needed by fs.ssh.
parso==0.1.1
pathlib2==2.3.2
pathlib==1.0.1
pathspec==0.7.0
pexpect==4.4.0
pickleshare==0.7.4
plotly==3.7.0
pluggy==0.13.0 # Needed by pytest.
ply==3.11
portpicker==1.3.1
prettytable==0.7.2
progressbar2==3.37.1
prometheus_client==0.6.0 # Needed by notebook.
prompt-toolkit==1.0.15
property-cached==1.6.3
protobuf==3.6.1
psutil==5.4.5
psycopg2-binary==2.8.3
ptyprocess==0.5.2
py-cpuinfo==3.3.0
py==1.5.2
# At the time of writing (2018-05-10), the most recent version of pycparser is
# version 2.18, however, it breaks cldrive with error:
# Traceback (most recent call last):
# File "<snip>/phd/gpu/cldrive/legacy/__init__.py", line 7, in <module>
# from gpu.cldrive.args import *
# File "<snip>/phd/gpu/cldrive/legacy/args.py", line 242, in <module>
# __parser = OpenCLCParser()
# File "<snip>/site-packages/pycparserext/ext_c_parser.py", line 47, in __init__
# debug=yacc_debug, write_tables=False)
# File "<snip>/site-packages/pycparser/ply/yacc.py", line 3426, in yacc
# raise YaccError('Unable to build parser')
# pycparser.ply.yacc.YaccError: Unable to build parser
pycparser==2.17
pycparserext==2016.2
pydot==1.4.1
PyGithub==1.39
Pygments==2.2.0
pybind11==2.4.2 # Needed by pyopencl.
pyfiglet==0.8.post1
pylint==1.8.2
pyopencl==2018.2.5
pyOpenSSL==19.1.0 # Needed by urllib3.
pyparsing==2.2.0
pytest-benchmark==3.2.2
pytest-cov==2.8.1
pytest-mock==1.12.1
pytest-shard==0.1.1
pytest==5.3.1
python-dateutil==2.6.1
python-Levenshtein==0.12.0
python-utils==2.3.0
python-xmp-toolkit==2.0.1
pytools==2018.1
pytz==2018.3
PyYAML==4.2b4
pyzmq==17.0.0
pyasn1==0.4.7 # Needed by oauth2client.
pyasn1_modules==0.2.7 # Needed by oauth2client.
qtconsole==4.3.1
regex==2019.11.1
reorder-python-imports==1.9.0
requests==2.20.1
retrying==1.3.3 # Needed by plotly.
rsa==4.0 # Needed by oauth2client.
scandir==1.7
scikit-learn==0.20.3
scikit-image==0.14.2
scipy==1.2.1
seaborn==0.9.0
Send2Trash==1.5.0
simplegeneric==0.8.1
singledispatch==3.4.0.3
six==1.11.0 # Needed by absl.
smmap2==2.0.3
SQLAlchemy==1.3.10
sqlparse==0.3.0
statistics==1.0.3.5
subprocess32==3.5.0
tabulate==0.8.5
tensorflow==1.14.0 # NOTE: Must be installed manually with `pip install`.
terminado==0.8.1
testpath==0.3.1
TogglPy==0.1.1
toml==0.10.0
torch==1.3.0
tornado==5.0
tqdm==4.38.0
traitlets==4.3.2
trash-cli==0.17.1.14
typed-ast==1.4.1
typing-extensions==3.7.4.1
umap==0.1.1
urllib3==1.24.2 # Needed by requests.
virtualenv==15.1.0
wcwidth==0.1.7
webencodings==0.5.1
Werkzeug==0.15.3 # Needed by Flask.
wget==3.2
widgetsnbextension==3.1.4
wrapt==1.11.2
zipp==0.6.0 # Needed by pytest.
4 changes: 2 additions & 2 deletions third_party/py/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ group multiple packages under a single bazel target (see

## To add a package

1. Add the new pip packages to `//tools/requirements.txt`.
1. Add the new pip packages to `//:requirements.txt`.
1. Create a package in this directory which contains a single `py_library` rule
and pulls in the new pip package as a `dep` (copy any of the existing
and pulls in the new pip package as a `dep` (copy any of the existing
packages as a starting point).
1. Add the `//third_party/py/<package>` dep to any python targets which require
this new module.
8 changes: 4 additions & 4 deletions tools/source_tree/phd_workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"BUILD", # Top-level BUILD file is always needed.
"WORKSPACE", # Implicit dependency of everything.
"README.md",
"requirements.txt", # Needed by WORKSPACE.
"tools/Brewfile.travis", # Needed by Travis CI.
"tools/bzl/*", # Implicit dependency of WORKSPACE file.
"tools/BUILD", # Needed by //tools/bzl:maven_jar.bzl.
Expand All @@ -36,7 +37,6 @@
"tools/flaky_bazel.sh", # Needed by Travis CI.
"third_party/py/tensorflow/BUILD.in", # Needed by ./configure
"tools/workspace_status.sh", # Needed by .bazelrc
# tools/requirements.txt is always needed, but is handled separately.
]

# A list of relative paths to files which are excluded from export. Glob
Expand Down Expand Up @@ -150,14 +150,14 @@ def GetPythonRequirementsForTarget(
if output:
dependencies = dependencies.union(set(output.split("\n")))

with open(self.workspace_root / "tools/requirements.txt") as f:
with open(self.workspace_root / "requirements.txt") as f:
all_requirements = set(f.readlines())

needed = []
all_dependencies = set()
# This is a pretty hacky approach that tries to match the package component
# of the generated @pypi__<package>_<vesion> package to the name as it
# appears in tools/requirements.txt.
# appears in requirements.txt.
for dependency in dependencies:
if not dependency.startswith("@pypi__"):
continue
Expand Down Expand Up @@ -193,7 +193,7 @@ def CreatePythonRequirementsFileForTargets(
self, workspace: bazelutil.Workspace, targets: typing.List[str]
) -> None:
# Export the subset of python requirements that are needed.
print("tools/requirements.txt")
print("requirements.txt")
requirements = self.GetPythonRequirementsForTarget(targets)
requirements_path = workspace.workspace_root / "tools" / "requirements.txt"
with open(requirements_path, "w") as f:
Expand Down

0 comments on commit b646886

Please sign in to comment.