From 5e9ef7b553caff9cce179c2e77c97484547dd804 Mon Sep 17 00:00:00 2001 From: Yuwen Hu <54161268+Oscilloscope98@users.noreply.github.com> Date: Thu, 5 Jan 2023 18:07:10 +0800 Subject: [PATCH] [Nano] Add a generalized how-to guide for accelerate PyTorch cv data process pipeline (#7125) * Restyle blockquote elements in web * Add a generalized how-to section for preprocessing, including the data process accelerastion for PyTorch * Small fix * Update based on comments and small typo fixes * Small fixes --- docs/readthedocs/source/_static/css/custom.css | 8 ++++++++ docs/readthedocs/source/_toc.yml | 2 +- .../PyTorch/accelerate_pytorch_cv_data_pipeline.nblink | 3 +++ .../Training/General/choose_num_processes_training.md | 6 ++---- .../pytorch_lightning_cv_data_pipeline.nblink | 3 --- docs/readthedocs/source/doc/Nano/Howto/index.rst | 9 ++++++++- 6 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 docs/readthedocs/source/doc/Nano/Howto/Preprocessing/PyTorch/accelerate_pytorch_cv_data_pipeline.nblink delete mode 100644 docs/readthedocs/source/doc/Nano/Howto/Training/PyTorchLightning/pytorch_lightning_cv_data_pipeline.nblink diff --git a/docs/readthedocs/source/_static/css/custom.css b/docs/readthedocs/source/_static/css/custom.css index 309fdc2f..507077c0 100644 --- a/docs/readthedocs/source/_static/css/custom.css +++ b/docs/readthedocs/source/_static/css/custom.css @@ -106,4 +106,12 @@ footer.bd-footer{ /* for right sidebar word-break */ #bd-toc-nav ul li { word-break: break-word; +} + +/* for quoteblocks, especially for the ones inside notebooks*/ +blockquote { + margin: 1.5em auto; + box-shadow: 0 0.2rem 0.5rem var(--pst-color-shadow); + border-color: var(--pst-color-primary); + background-color: var(--pst-color-on-background); } \ No newline at end of file diff --git a/docs/readthedocs/source/_toc.yml b/docs/readthedocs/source/_toc.yml index f25c83b7..5dda8743 100644 --- a/docs/readthedocs/source/_toc.yml +++ b/docs/readthedocs/source/_toc.yml @@ -101,11 +101,11 @@ subtrees: title: "How-to Guides" subtrees: - entries: + - file: doc/Nano/Howto/Preprocessing/PyTorch/accelerate_pytorch_cv_data_pipeline - file: doc/Nano/Howto/Training/PyTorchLightning/accelerate_pytorch_lightning_training_ipex - file: doc/Nano/Howto/Training/PyTorchLightning/accelerate_pytorch_lightning_training_multi_instance - file: doc/Nano/Howto/Training/PyTorchLightning/pytorch_lightning_training_channels_last - file: doc/Nano/Howto/Training/PyTorchLightning/pytorch_lightning_training_bf16 - - file: doc/Nano/Howto/Training/PyTorchLightning/pytorch_lightning_cv_data_pipeline - file: doc/Nano/Howto/Training/PyTorch/convert_pytorch_training_torchnano - file: doc/Nano/Howto/Training/PyTorch/use_nano_decorator_pytorch_training - file: doc/Nano/Howto/Training/TensorFlow/accelerate_tensorflow_training_multi_instance diff --git a/docs/readthedocs/source/doc/Nano/Howto/Preprocessing/PyTorch/accelerate_pytorch_cv_data_pipeline.nblink b/docs/readthedocs/source/doc/Nano/Howto/Preprocessing/PyTorch/accelerate_pytorch_cv_data_pipeline.nblink new file mode 100644 index 00000000..ea9e7529 --- /dev/null +++ b/docs/readthedocs/source/doc/Nano/Howto/Preprocessing/PyTorch/accelerate_pytorch_cv_data_pipeline.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../../../../../../../python/nano/tutorial/notebook/preprocessing/pytorch/accelerate_pytorch_cv_data_pipeline.ipynb" +} \ No newline at end of file diff --git a/docs/readthedocs/source/doc/Nano/Howto/Training/General/choose_num_processes_training.md b/docs/readthedocs/source/doc/Nano/Howto/Training/General/choose_num_processes_training.md index a004ff4c..8a979551 100644 --- a/docs/readthedocs/source/doc/Nano/Howto/Training/General/choose_num_processes_training.md +++ b/docs/readthedocs/source/doc/Nano/Howto/Training/General/choose_num_processes_training.md @@ -1,4 +1,4 @@ -# Choose the Number of Porcesses for Multi-Instance Training +# Choose the Number of Processes for Multi-Instance Training BigDL-Nano supports multi-instance training on a server with multiple CPU cores or sockets. With Nano, you could launch a self-defined number of processes to perform data-parallel training. When choosing the number of processes, there are 3 empirical recommendations for better training performance: @@ -35,10 +35,8 @@ Based on that, the number of processes np can be calculated as: That is, empirically, we could set the number of processes to 2, 4 or 8 here for good training performance. ```eval_rst -.. card:: +.. seealso:: - **Related Readings** - ^^^ * `How to accelerate a PyTorch Lightning application on training workloads through multiple instances <../PyTorchLightning/accelerate_pytorch_lightning_training_multi_instance.html>`_ * `How to accelerate a TensorFlow Keras application on training workloads through multiple instances <../TensorFlow/accelerate_tensorflow_training_multi_instance.html>`_ ``` \ No newline at end of file diff --git a/docs/readthedocs/source/doc/Nano/Howto/Training/PyTorchLightning/pytorch_lightning_cv_data_pipeline.nblink b/docs/readthedocs/source/doc/Nano/Howto/Training/PyTorchLightning/pytorch_lightning_cv_data_pipeline.nblink deleted file mode 100644 index 157620d8..00000000 --- a/docs/readthedocs/source/doc/Nano/Howto/Training/PyTorchLightning/pytorch_lightning_cv_data_pipeline.nblink +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path": "../../../../../../../../python/nano/tutorial/notebook/training/pytorch-lightning/pytorch_lightning_cv_data_pipeline.ipynb" -} \ No newline at end of file diff --git a/docs/readthedocs/source/doc/Nano/Howto/index.rst b/docs/readthedocs/source/doc/Nano/Howto/index.rst index 27fb19af..0177a95d 100644 --- a/docs/readthedocs/source/doc/Nano/Howto/index.rst +++ b/docs/readthedocs/source/doc/Nano/Howto/index.rst @@ -5,6 +5,14 @@ Nano How-to Guides In Nano How-to Guides, you could expect to find multiple task-oriented, bite-sized, and executable examples. These examples will show you various tasks that BigDL-Nano could help you accomplish smoothly. +Preprocessing Optimization +--------------------------- + +PyTorch +~~~~~~~~~~~~~~~~~~~~~~~~~ +* `How to accelerate a computer vision data processing pipeline `_ + + Training Optimization ------------------------- @@ -14,7 +22,6 @@ PyTorch Lightning * `How to accelerate a PyTorch Lightning application on training workloads through multiple instances `_ * `How to use the channels last memory format in your PyTorch Lightning application for training `_ * `How to conduct BFloat16 Mixed Precision training in your PyTorch Lightning application `_ -* `How to accelerate a computer vision data processing pipeline `_ PyTorch ~~~~~~~~~~~~~~~~~~~~~~~~~