{ "info": { "author": "Sayed Hadi Hashemi", "author_email": "SayedHadiHashemi@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3 :: Only" ], "description": "# TensorFlow Runtime Tracer\nThis project is a web application to monitor and trace TensorFlow scripts in the runtime on the `op` level.\n\nIt starts a web server upon the execution of the script. The web interface keeps track of all the session runs and can trace the execution on demand.\n\nThe goal of this tool is to facilitate the process of performance tuning with minimal code changes and insignificant runtime overhead. Both Higher-level ([tf.estimator.Estimator](https://www.tensorflow.org/guide/estimators)) and Low-level ([tf.train.MonitoredTrainingSession](https://www.tensorflow.org/api_docs/python/tf/train/MonitoredTrainingSession) and co) APIs are supported. It also supports [horovod](https://github.com/uber/horovod) and [IBM Distributed Deep Learning (DDL)](https://dataplatform.cloud.ibm.com/docs/content/analyze-data/ml_dlaas_ibm_ddl.html).\nThe tracing session can be saved, reloaded, and distributed effortlessly.\n\nSome screenshots [here](https://github.com/xldrx/tensorflow-tracer/blob/master/gallery).\n\n## Installation\nUse `pip` to install:\n```bash\npip install tensorflow-tracer\n```\n\n## Quick Start\n1. Install `tensorflow-tracer` and run an example:\n ```html\n $ pip3 install tensorflow-tracer\n $ git clone https://github.com/xldrx/tensorflow-tracer.git\n $ python3 ./tensorflow-tracer/examples/estimator-example.py \n ```\n2. Browse to: `http://0.0.0.0:9999` \n\n## How to Use\n1. Add `tftracer` to your code:\n\n Estimator API:\n ```python\n from tftracer import TracingServer\n ...\n\n tracing_server = TracingServer()\n estimator.train(input_fn, hooks=[tracing_server.hook]) \n ```\n\n Low-Level API:\n ```python\n from tftracer import TracingServer\n ...\n tracing_server = TracingServer()\n with tf.train.MonitoredTrainingSession(hooks=[tracing_server.hook]):\n ...\n ```\n\n [[More examples here]](https://github.com/xldrx/tensorflow-tracer/blob/master/examples/) \n\n2. Run your code and browse to:\n```html\nhttp://0.0.0.0:9999\n``` \n\n## How to Trace an Existing Code\n\nIf you want to trace an existing script without any modification use `tftracer.hook_inject`\nPlease note that this is experimental and may cause unexpected errors:\n\n1. Add the following to the beggining of the main script:\n .. code-block:: python\n\n import tftracer\n tftracer.hook_inject()\n ...\n2. Run your code and browse to `http://0.0.0.0:9999`\n\n\n## Command line\nTracing sessions can be stored either through the web interface or by calling `tracing_server.save_session(filename)`.\n\nTo reload a session, run this in the terminal:\n```bash\ntftracer filename\n```\n\nThen browse to:\n```html\nhttp://0.0.0.0:9999\n``` \n\n## API\nFull Documentation is [here](https://tensorflow-tracer.readthedocs.io/en/latest/).\n\n## Known Bugs/Limitations\n* Only Python3 is supported.\n* The web interface loads javascript/css libraries remotely (e.g. `vue.js`, `ui-kit`, `jquery`, `jquery-ui`, `Google Roboto`, `awesome-icons`, ... ). Therefore an active internet connection is needed to properly render the interface. The tracing server does not require any remote connection. \n* All traces are kept in the memory while tracing server is running.\n* Tracing uses `tf.train.SessionRunHook` and is unable to trace auxiliary runs such as `init_op`.\n* The tracing capability is limited to what `tf.RunMetadata` offers. For example, CUPTI events are missing when tracing a distributed job.\n* HTTPS is not supported. \n\n## Frequently Asked Questions\n\n### How to trace/visualize just one session run?\nUse `tftracer.Timeline`. for example:\n```python\n from tftracer import Timeline\n ...\n with tf.train.MonitoredTrainingSession() as sess:\n with Timeline() as tl:\n sess.run(fetches, **tl.kwargs)\n ...\n tl.visualize(filename)\n```\n\n### Comparision to TensorBoard?\nThe nature of this project is a short-lived light-weight interactive tracing interface to monitor and trace execution on the `op`-level. In comparison `TensorBoard` is a full-featured tool to inspect the application on many levels:\n* `tftracer` does not make any assumption about the dataflow DAG. There is no need to add any additional `op` to the data flow dag (i.e. `tf.summary`) or having a `global step`. \n\n* `tftracer` runs as a thread and lives from the start of the execution and lasts until the end of it. `TensorBoard` runs as a separate process and can outlive the main script. \n\n## Cite this tool\n```latex\n@misc{hashemi-tftracer-2018,\n author = {Sayed Hadi Hashemi},\n title = {TensorFlow Runtime Tracer},\n year = {2018},\n publisher = {GitHub},\n journal = {GitHub repository},\n howpublished = {\\url{https://github.com/xldrx/tensorflow-tracer}},\n}\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/xldrx/tensorflow-tracer", "keywords": "", "license": "Apache-2.0", "maintainer": "", "maintainer_email": "", "name": "tensorflow-tracer", "package_url": "https://pypi.org/project/tensorflow-tracer/", "platform": "", "project_url": "https://pypi.org/project/tensorflow-tracer/", "project_urls": { "Homepage": "https://github.com/xldrx/tensorflow-tracer" }, "release_url": "https://pypi.org/project/tensorflow-tracer/1.1.0/", "requires_dist": [ "bokeh (>=1.0)", "flask", "jinja2", "tensorflow (>=1.8)", "six", "gevent" ], "requires_python": "", "summary": "Runtime Tracing Library for TensorFlow", "version": "1.1.0" }, "last_serial": 4548469, "releases": { "1.0.2": [ { "comment_text": "", "digests": { "md5": "80a23679f9a86994ef76b0f64b515124", "sha256": "abce3f6e7faa0b1dba534f3f9be292103471e64f25b959842743a1506cf89750" }, "downloads": -1, "filename": "tensorflow_tracer-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "80a23679f9a86994ef76b0f64b515124", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 28058, "upload_time": "2018-11-27T01:29:34", "url": "https://files.pythonhosted.org/packages/d2/de/27a0fc23dfbcc1d0f16cb368f0b8d2c623ba0201c526175d9b70e6aa7461/tensorflow_tracer-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "603b37915088fae3f7763ab16fcf9294", "sha256": "d33fd08cbbd09aa65320a7a2a35523ac33f011c7c45eb1e09019dce00cf64c2f" }, "downloads": -1, "filename": "tensorflow-tracer-1.0.2.tar.gz", "has_sig": false, "md5_digest": "603b37915088fae3f7763ab16fcf9294", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20119, "upload_time": "2018-11-27T01:29:35", "url": "https://files.pythonhosted.org/packages/d4/ba/2dec96e0bd5c53429f9c6babcfe1c4cce05a4dac582a8c0868a8b562f7a4/tensorflow-tracer-1.0.2.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "30c1b9f89eccdc582f19cc30a810d78a", "sha256": "daf8439d9c16c5630ad58fc36ffbf52eb333e2d16d53330aaf2091a785eabc82" }, "downloads": -1, "filename": "tensorflow_tracer-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "30c1b9f89eccdc582f19cc30a810d78a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 29578, "upload_time": "2018-11-30T20:00:22", "url": "https://files.pythonhosted.org/packages/3c/c4/2d3207e970bba9e0d57baee278e8c6e0d083793fb1c0bba13b14eb0d7c79/tensorflow_tracer-1.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2e50f2bb6b5115e3dce9f579695418a7", "sha256": "5b1a16d5b247a3a707c9524ee3a3817b1b2adc9f44a4d86523287b8a8bf635c4" }, "downloads": -1, "filename": "tensorflow-tracer-1.1.0.tar.gz", "has_sig": false, "md5_digest": "2e50f2bb6b5115e3dce9f579695418a7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21264, "upload_time": "2018-11-30T20:00:25", "url": "https://files.pythonhosted.org/packages/7e/96/1f1153de6fd1db30a249d6d2b26cecf41c4e4d926c9b6e88933366fbe54c/tensorflow-tracer-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "30c1b9f89eccdc582f19cc30a810d78a", "sha256": "daf8439d9c16c5630ad58fc36ffbf52eb333e2d16d53330aaf2091a785eabc82" }, "downloads": -1, "filename": "tensorflow_tracer-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "30c1b9f89eccdc582f19cc30a810d78a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 29578, "upload_time": "2018-11-30T20:00:22", "url": "https://files.pythonhosted.org/packages/3c/c4/2d3207e970bba9e0d57baee278e8c6e0d083793fb1c0bba13b14eb0d7c79/tensorflow_tracer-1.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2e50f2bb6b5115e3dce9f579695418a7", "sha256": "5b1a16d5b247a3a707c9524ee3a3817b1b2adc9f44a4d86523287b8a8bf635c4" }, "downloads": -1, "filename": "tensorflow-tracer-1.1.0.tar.gz", "has_sig": false, "md5_digest": "2e50f2bb6b5115e3dce9f579695418a7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21264, "upload_time": "2018-11-30T20:00:25", "url": "https://files.pythonhosted.org/packages/7e/96/1f1153de6fd1db30a249d6d2b26cecf41c4e4d926c9b6e88933366fbe54c/tensorflow-tracer-1.1.0.tar.gz" } ] }