64b19fb16f
* Exlucde __pycache__ in setuptools * Add load balancer example * wip * Update example * rename * remove prints * _LoadBalancer -> LoadBalancer * AutoScaler(work) * change var name * remove locust * Update docs * include autoscaler in api ref * docs typo * docs typo * docs typo * docs typo * remove unused loadtest * remove unused device_type * clean up * clean up * clean up * Add docstring * type * env vars to args * expose an API for users to override to customise autoscaling logic * update example * comment * udpate var name * fix scale mechanism and clean up * Update exampl * ignore mypy * Add test file * . * update impl and update tests * Update changlog * . * revert docs * update test * update state to keep calling 'flow.run()' Co-authored-by: Aniket Maurya <theaniketmaurya@gmail.com> * Add aiohttp to base requirements * Update docs Co-authored-by: Luca Antiga <luca.antiga@gmail.com> * Use deserializer utility * fake trigger * wip: protect /system/* with basic auth * read password at runtime * Change env var name * import torch as optional * Don't overcreate works * simplify imports * Update example * aiohttp * Add work_args work_kwargs * More docs * remove FIXME * Apply Jirka's suggestions Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * clean example device * add comment on init threshold value * bad merge * nit: logging format * {in,out}put_schema -> {in,out}put_type * lowercase * docs on seconds * process_time -> processing_time * Dont modify work state from flow * Update tests * worker_url -> endpoint * fix exampl * Fix default scale logic * Fix default scale logic * Fix num_pending_works * Update num_pending_works * Fix bug creating too many works * Remove up/downscale_threshold args * Update example * Add typing * Fix example in docstring * Fix default scale logic * Update src/lightning_app/components/auto_scaler.py Co-authored-by: Noha Alon <nohalon@gmail.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * rename method * rename locvar * Add todo * docs ci * docs ci * asdfafsdasdf pls docs * Apply suggestions from code review Co-authored-by: Ethan Harris <ethanwharris@gmail.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * . * doc * Update src/lightning_app/components/auto_scaler.py Co-authored-by: Noha Alon <nohalon@gmail.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Revert "[pre-commit.ci] auto fixes from pre-commit.com hooks" This reverts commit |
||
---|---|---|
.. | ||
source-app | ||
source-pytorch | ||
README.md |
README.md
PyTorch-Lightning Docs
We are using Sphinx with Napoleon extension. Moreover, we set Google style to follow with type convention.
See following short example of a sample function taking one position string and optional
from typing import Optional
def my_func(param_a: int, param_b: Optional[float] = None) -> str:
"""Sample function.
Args:
param_a: first parameter
param_b: second parameter
Return:
sum of both numbers
Example::
>>> my_func(1, 2)
3
Note:
If you want to add something.
"""
p = param_b if param_b else 0
return str(param_a + p)
Building Docs
When updating the docs, make sure to build them first locally and visually inspect the html files in your browser for formatting errors. In certain cases, a missing blank line or a wrong indent can lead to a broken layout. Run these commands
git submodule update --init --recursive
make docs
and open docs/build/html/index.html
in your browser.
When you send a PR the continuous integration will run tests and build the docs.
Notes:
- You need to have LaTeX installed for rendering math equations. You can for example install TeXLive with the necessary extras by doing one of the following:
- on Ubuntu (Linux) run
sudo apt-get update && sudo apt-get install -y texlive-latex-extra dvipng texlive-pictures
- use the RTD docker image
- on Ubuntu (Linux) run
- You need to have pandoc installed for rendering Jupyter Notebooks. On Ubuntu (Linux), you can run:
sudo apt-get install pandoc
Developing docs
When developing the docs, building docs can be VERY slow locally because of the notebook tutorials. To speed this up, enable this flag in before building docs:
# builds notebooks which is slow
export PL_FAST_DOCS_DEV=0
# fast notebook build which is fast
export PL_FAST_DOCS_DEV=1
docs CSS/theme
To change the CSS theme of the docs, go here. Apologies in advance... this is a bit complex to build and requires basic understanding of javascript/npm.