{ "info": { "author": "Imperial College London", "author_email": "opesci@imperial.ac.uk", "bugtrack_url": null, "classifiers": [], "description": "# Checkpointing\n\nThe adjoint computation of an unsteady nonlinear primal function requires the\nfull primal trajectory in reverse temporal order. Storing this can exceed the\navailable memory. In that case, Checkpointing can be used to store the state\nonly at carefully selected points in time. From there, the forward computation\ncan be restarted to recompute lost sections of the trajectory when they are\nneeded during the adjoint computation. This is always a tradeoff between memory\nand runtime. The classic and provably optimal way to do this for a known number\nof time steps is Revolve[^1], and there are other algorithms for optimal online\ncheckpointing if the number of steps is unknown a priori, or for multistage\ncheckpointing if there are multiple layers of storage, e.g. memory and hard\ndrive.\n![Visual demo of checkpointing](https://raw.githubusercontent.com/opesci/pyrevolve/master/examples/checkpointing_demo.gif)\n\n[^1]: Algorithm 799: Revolve: An Implementation of Checkpointing for the Reverse\nor Adjoint Mode of Computational Differentiation\n\n# pyrevolve\n\nThe pyrevolve library contains two parts: crevolve, which is a thin Python\nwrapper around a previously published C++ implementation[^2], and pyrevolve\nitself, which sits on top of crevolve and manages data and computation\nmanagement for the user.\n\nThe C++ files in this package are slightly modified to play more nicely with\nPython, but the original is available from the link below. In addition, there\nis a C wrapper around the C++ library, to simplify the interface with Python.\nThis C wrapper is taken from libadjoint[^3].\n\n[^2]: Revolve.cpp: http://www2.math.uni-paderborn.de/index.php?id=12067&L=1\n[^3]: libadjoint: https://bitbucket.org/dolfin-adjoint/libadjoint\n\n# Installation\n\nThe simplest installation is through pip by simply doing `pip install pyrevolve`.\nIf that fails, try the method listed below. \n\nThe crevolve wrapper requires cython, and the compilation of the C++ files\nrequire that a C++ compiler is installed. To install pyrevolve, clone the repo\nand call\n\n python setup.py build_ext --inplace\n \n# Usage\n\nThere are two wrappers: a _classic_ wrapper that follows the behaviour of Revolve\nas described in the papers, and leaves the data mangement, the actual copying\nof data, and the calling of operators to the user. An example of how to use it\ncan be executed by calling\n\n python examples/use_classic.py\n \nThe other, _modernised_ wrapper, takes care of all this. The user creates a\nRevolver object, and passes a forward operator, reverse operator, and\ncheckpoint operator to it. The Revolver provides two important methods:\n`apply_forward`, and `apply_reverse`. A call to `apply_forward` executes the\nforward computation, while creating the necessary checkpoints for the reverse\ncomputation. After this, a user may also call the `apply_reverse` method to\ncompute the adjoints.\n\nFor this to work, the user is responsible that the operators have an `apply()`\nmethod that takes arguments `t_start` and `t_end`, and that the checkpoint\nobject has a property `size` to report the size of one checkpoint, and methods\n`load(ptr)` and `save(ptr)` that deep-copy all time-dependent live data into\na location given in `ptr`.\n\nAn example of this can be found here:\n\n python examples/use_modernised.py", "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/opesci/pyrevolve/", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pyrevolve", "package_url": "https://pypi.org/project/pyrevolve/", "platform": "", "project_url": "https://pypi.org/project/pyrevolve/", "project_urls": { "Homepage": "https://github.com/opesci/pyrevolve/" }, "release_url": "https://pypi.org/project/pyrevolve/2.1.3/", "requires_dist": null, "requires_python": "", "summary": "Python wrapper for Revolve checkpointing", "version": "2.1.3" }, "last_serial": 5362688, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "d6dcdcc77a587a59656ed2ff56b8c945", "sha256": "01c7727442150e863f6de19ea58f4e6d49f41b31f589a2b975cb9289f0390114" }, "downloads": -1, "filename": "pyrevolve-1.0.tar.gz", "has_sig": false, "md5_digest": "d6dcdcc77a587a59656ed2ff56b8c945", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 61400, "upload_time": "2018-04-17T09:48:53", "url": "https://files.pythonhosted.org/packages/f3/24/a6353dc39fb38d523cfdb5f496d0e44842009c43b93c4b4e0c4ddeeddcd1/pyrevolve-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "d70373282ea666abd5aecb1f6d367712", "sha256": "f1e705c6b3d43d8167881852afc1eb3bcffbadbea1b03cfca0bf9e3a688ac6ac" }, "downloads": -1, "filename": "pyrevolve-1.0.1.tar.gz", "has_sig": false, "md5_digest": "d70373282ea666abd5aecb1f6d367712", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 386424, "upload_time": "2018-04-19T10:47:15", "url": "https://files.pythonhosted.org/packages/8b/cf/7c9492c98ce5ace2b62dd448ffec541d5d844cf6d5cc3b93566dc7c40ebf/pyrevolve-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "1a5a042d70c122fe328cdeb9af20e278", "sha256": "5b12f32d88b1a236d90ba88b5dbd351deb6083b9462963833bc8e9a8ff480e97" }, "downloads": -1, "filename": "pyrevolve-1.0.2.tar.gz", "has_sig": false, "md5_digest": "1a5a042d70c122fe328cdeb9af20e278", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 395687, "upload_time": "2018-04-19T10:54:30", "url": "https://files.pythonhosted.org/packages/74/13/1634d46855e057e99b5a47c5f7aef5d198659bd1fe9ba686ce1256c86c95/pyrevolve-1.0.2.tar.gz" } ], "2.1": [ { "comment_text": "", "digests": { "md5": "63e115cab1e63f5de8321febda9df739", "sha256": "e1946ad76f0dd28d017933b223d6a99a21fea321512fd3bed7a530a18f830c90" }, "downloads": -1, "filename": "pyrevolve-2.1.tar.gz", "has_sig": false, "md5_digest": "63e115cab1e63f5de8321febda9df739", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 189703, "upload_time": "2019-03-15T12:54:18", "url": "https://files.pythonhosted.org/packages/3e/31/34d1f461c4d354854f35d254a250d641e5af80846ce433966fbf4cd496cd/pyrevolve-2.1.tar.gz" } ], "2.1.3": [ { "comment_text": "", "digests": { "md5": "65a2d7d1ede8ed4fff425d6f26d5c1ce", "sha256": "754e47be87cfb567831caa0f55a206b1d5f345f60cfcb91066ec5fc6a2f584b3" }, "downloads": -1, "filename": "pyrevolve-2.1.3.tar.gz", "has_sig": false, "md5_digest": "65a2d7d1ede8ed4fff425d6f26d5c1ce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 190227, "upload_time": "2019-06-05T14:13:59", "url": "https://files.pythonhosted.org/packages/0d/c4/63a36aa56969de861e181b86ebc1aba6764e9d2566c42e4faf1f360cb3cc/pyrevolve-2.1.3.tar.gz" } ], "2.1.3rc1": [ { "comment_text": "", "digests": { "md5": "59e20e57271f0e9678ca3c26663e47a2", "sha256": "1e7b4ee54f61617b104437bac59f2ba7038dd51168287699243aa5e326b7db8e" }, "downloads": -1, "filename": "pyrevolve-2.1.3rc1.tar.gz", "has_sig": false, "md5_digest": "59e20e57271f0e9678ca3c26663e47a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 190431, "upload_time": "2019-03-29T09:52:41", "url": "https://files.pythonhosted.org/packages/c3/98/7e48747ff65d28fde1af7bd03eaf2210f58773f5b8f38d96d7325ea78f99/pyrevolve-2.1.3rc1.tar.gz" } ], "2.1.3rc2": [ { "comment_text": "", "digests": { "md5": "07035c18afe923e6c3d8741022631736", "sha256": "f81e25fb4276a81fe0cc191062b25ec359f9595e173df297f1ed6312321a6a72" }, "downloads": -1, "filename": "pyrevolve-2.1.3rc2.tar.gz", "has_sig": false, "md5_digest": "07035c18afe923e6c3d8741022631736", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 190555, "upload_time": "2019-05-15T17:47:15", "url": "https://files.pythonhosted.org/packages/9e/27/af86532d59b33878ee5a91412c9b2218880e305fcf51ba10fcfda2d6d3ce/pyrevolve-2.1.3rc2.tar.gz" } ], "2.1.3rc3": [ { "comment_text": "", "digests": { "md5": "75518ba299edec564c68da45abffac4a", "sha256": "df1337838bc0705cb25bd81a1b3ed8007f0a08ce3d81aaadc25db4b40468dd56" }, "downloads": -1, "filename": "pyrevolve-2.1.3rc3.tar.gz", "has_sig": false, "md5_digest": "75518ba299edec564c68da45abffac4a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 190523, "upload_time": "2019-05-17T16:09:04", "url": "https://files.pythonhosted.org/packages/03/e3/1a0ed40ca58fdee0c2370e827f858379f7a2942eab0edc5839513129ceb4/pyrevolve-2.1.3rc3.tar.gz" } ], "2.1.3rc4": [ { "comment_text": "", "digests": { "md5": "4985057cfe33ee49a8563d31312dcd4f", "sha256": "500738c95698bfbafbde08f053267314abfd9f4e5032a4ce94f9a7b88531f874" }, "downloads": -1, "filename": "pyrevolve-2.1.3rc4.tar.gz", "has_sig": false, "md5_digest": "4985057cfe33ee49a8563d31312dcd4f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 190530, "upload_time": "2019-05-17T17:04:54", "url": "https://files.pythonhosted.org/packages/73/a6/5335fb87d73b0866b1c802b048ea625491de52fd98b108d21e4fbf9b1698/pyrevolve-2.1.3rc4.tar.gz" } ], "2.1.3rc5": [ { "comment_text": "", "digests": { "md5": "a172220e1e0ac34528d556d200d41af6", "sha256": "db2007a503b14e9e4c7166a7f6883eb394a1d21120746cf4fc8f2d958c280f94" }, "downloads": -1, "filename": "pyrevolve-2.1.3rc5.tar.gz", "has_sig": false, "md5_digest": "a172220e1e0ac34528d556d200d41af6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 186158, "upload_time": "2019-05-22T04:42:26", "url": "https://files.pythonhosted.org/packages/42/6a/4a41f93ee66863d014c21bb5744a20e4f5ce74143fb2213ad65a2d6e1ada/pyrevolve-2.1.3rc5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "65a2d7d1ede8ed4fff425d6f26d5c1ce", "sha256": "754e47be87cfb567831caa0f55a206b1d5f345f60cfcb91066ec5fc6a2f584b3" }, "downloads": -1, "filename": "pyrevolve-2.1.3.tar.gz", "has_sig": false, "md5_digest": "65a2d7d1ede8ed4fff425d6f26d5c1ce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 190227, "upload_time": "2019-06-05T14:13:59", "url": "https://files.pythonhosted.org/packages/0d/c4/63a36aa56969de861e181b86ebc1aba6764e9d2566c42e4faf1f360cb3cc/pyrevolve-2.1.3.tar.gz" } ] }