From 12c12a10586673f6c5fe0f96e097cfb524a0d397 Mon Sep 17 00:00:00 2001 From: Yuwen Hu <54161268+Oscilloscope98@users.noreply.github.com> Date: Thu, 15 Sep 2022 15:26:11 +0800 Subject: [PATCH] [Nano] How-To Guides: Training - PyTorch Lightning (#5643) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Rearrange file structure for PyTorch Inference for docs and add titles for PyTorch-Lightning Training * Add How-to guide: How to accelerate a PyTorch-Lightning application on training workloads through IntelĀ® Extension for PyTorch* * Add how-to guide: How to accelerate a PyTorch-Lightning application on training workloads through multiple instances * Revise: remove '-' in 'PyTorch-Lightning' and some other changes * Add How-to guides: How to use the channels last memory format in your PyTorch Lightning application for training * Add how-to guide: Use BFloat16 Mixed Precision for PyTorch Lightning Training * Add How-to guide: How to accelerate a computer vision data processing pipeline * Small Revision: change comments in several code cells * Disable other nano tests temporarily * Add github action tests for Nano Training PyTorch Lightning tests * Enable other nano tests again * Small revisions: typos and explanation texts changes * Revise: update based on comments --- .../accelerate_pytorch_inference_onnx.nblink | 3 ++ ...celerate_pytorch_inference_openvino.nblink | 3 ++ .../quantize_pytorch_inference_inc.nblink | 3 ++ .../quantize_pytorch_inference_pot.nblink | 3 ++ ...ate_pytorch_lightning_training_ipex.nblink | 3 ++ ...h_lightning_training_multi_instance.nblink | 3 ++ .../pytorch_lightning_cv_data_pipeline.nblink | 3 ++ .../pytorch_lightning_training_bf16.nblink | 3 ++ ...ch_lightning_training_channels_last.nblink | 3 ++ .../accelerate_pytorch_inference_onnx.nblink | 3 -- ...celerate_pytorch_inference_openvino.nblink | 3 -- .../source/doc/Nano/Howto/index.rst | 42 +++++++++++++++---- .../quantize_pytorch_inference_inc.nblink | 3 -- .../quantize_pytorch_inference_pot.nblink | 3 -- 14 files changed, 60 insertions(+), 21 deletions(-) create mode 100644 docs/readthedocs/source/doc/Nano/Howto/Inference/PyTorch/accelerate_pytorch_inference_onnx.nblink create mode 100644 docs/readthedocs/source/doc/Nano/Howto/Inference/PyTorch/accelerate_pytorch_inference_openvino.nblink create mode 100644 docs/readthedocs/source/doc/Nano/Howto/Inference/PyTorch/quantize_pytorch_inference_inc.nblink create mode 100644 docs/readthedocs/source/doc/Nano/Howto/Inference/PyTorch/quantize_pytorch_inference_pot.nblink create mode 100644 docs/readthedocs/source/doc/Nano/Howto/Training/PyTorchLightning/accelerate_pytorch_lightning_training_ipex.nblink create mode 100644 docs/readthedocs/source/doc/Nano/Howto/Training/PyTorchLightning/accelerate_pytorch_lightning_training_multi_instance.nblink create mode 100644 docs/readthedocs/source/doc/Nano/Howto/Training/PyTorchLightning/pytorch_lightning_cv_data_pipeline.nblink create mode 100644 docs/readthedocs/source/doc/Nano/Howto/Training/PyTorchLightning/pytorch_lightning_training_bf16.nblink create mode 100644 docs/readthedocs/source/doc/Nano/Howto/Training/PyTorchLightning/pytorch_lightning_training_channels_last.nblink delete mode 100644 docs/readthedocs/source/doc/Nano/Howto/accelerate_pytorch_inference_onnx.nblink delete mode 100644 docs/readthedocs/source/doc/Nano/Howto/accelerate_pytorch_inference_openvino.nblink delete mode 100644 docs/readthedocs/source/doc/Nano/Howto/quantize_pytorch_inference_inc.nblink delete mode 100644 docs/readthedocs/source/doc/Nano/Howto/quantize_pytorch_inference_pot.nblink diff --git a/docs/readthedocs/source/doc/Nano/Howto/Inference/PyTorch/accelerate_pytorch_inference_onnx.nblink b/docs/readthedocs/source/doc/Nano/Howto/Inference/PyTorch/accelerate_pytorch_inference_onnx.nblink new file mode 100644 index 00000000..58811988 --- /dev/null +++ b/docs/readthedocs/source/doc/Nano/Howto/Inference/PyTorch/accelerate_pytorch_inference_onnx.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../../../../../../../python/nano/tutorial/notebook/inference/pytorch/accelerate_pytorch_inference_onnx.ipynb" +} \ No newline at end of file diff --git a/docs/readthedocs/source/doc/Nano/Howto/Inference/PyTorch/accelerate_pytorch_inference_openvino.nblink b/docs/readthedocs/source/doc/Nano/Howto/Inference/PyTorch/accelerate_pytorch_inference_openvino.nblink new file mode 100644 index 00000000..3d8752d1 --- /dev/null +++ b/docs/readthedocs/source/doc/Nano/Howto/Inference/PyTorch/accelerate_pytorch_inference_openvino.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../../../../../../../python/nano/tutorial/notebook/inference/pytorch/accelerate_pytorch_inference_openvino.ipynb" +} \ No newline at end of file diff --git a/docs/readthedocs/source/doc/Nano/Howto/Inference/PyTorch/quantize_pytorch_inference_inc.nblink b/docs/readthedocs/source/doc/Nano/Howto/Inference/PyTorch/quantize_pytorch_inference_inc.nblink new file mode 100644 index 00000000..aa657bce --- /dev/null +++ b/docs/readthedocs/source/doc/Nano/Howto/Inference/PyTorch/quantize_pytorch_inference_inc.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../../../../../../../python/nano/tutorial/notebook/inference/pytorch/quantize_pytorch_inference_inc.ipynb" +} \ No newline at end of file diff --git a/docs/readthedocs/source/doc/Nano/Howto/Inference/PyTorch/quantize_pytorch_inference_pot.nblink b/docs/readthedocs/source/doc/Nano/Howto/Inference/PyTorch/quantize_pytorch_inference_pot.nblink new file mode 100644 index 00000000..f56e834f --- /dev/null +++ b/docs/readthedocs/source/doc/Nano/Howto/Inference/PyTorch/quantize_pytorch_inference_pot.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../../../../../../../python/nano/tutorial/notebook/inference/pytorch/quantize_pytorch_inference_pot.ipynb" +} \ No newline at end of file diff --git a/docs/readthedocs/source/doc/Nano/Howto/Training/PyTorchLightning/accelerate_pytorch_lightning_training_ipex.nblink b/docs/readthedocs/source/doc/Nano/Howto/Training/PyTorchLightning/accelerate_pytorch_lightning_training_ipex.nblink new file mode 100644 index 00000000..867b5524 --- /dev/null +++ b/docs/readthedocs/source/doc/Nano/Howto/Training/PyTorchLightning/accelerate_pytorch_lightning_training_ipex.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../../../../../../../python/nano/tutorial/notebook/training/pytorch-lightning/accelerate_pytorch_lightning_training_ipex.ipynb" +} \ No newline at end of file diff --git a/docs/readthedocs/source/doc/Nano/Howto/Training/PyTorchLightning/accelerate_pytorch_lightning_training_multi_instance.nblink b/docs/readthedocs/source/doc/Nano/Howto/Training/PyTorchLightning/accelerate_pytorch_lightning_training_multi_instance.nblink new file mode 100644 index 00000000..d8e6e1ff --- /dev/null +++ b/docs/readthedocs/source/doc/Nano/Howto/Training/PyTorchLightning/accelerate_pytorch_lightning_training_multi_instance.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../../../../../../../python/nano/tutorial/notebook/training/pytorch-lightning/accelerate_pytorch_lightning_training_multi_instance.ipynb" +} \ 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 new file mode 100644 index 00000000..157620d8 --- /dev/null +++ b/docs/readthedocs/source/doc/Nano/Howto/Training/PyTorchLightning/pytorch_lightning_cv_data_pipeline.nblink @@ -0,0 +1,3 @@ +{ + "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/Training/PyTorchLightning/pytorch_lightning_training_bf16.nblink b/docs/readthedocs/source/doc/Nano/Howto/Training/PyTorchLightning/pytorch_lightning_training_bf16.nblink new file mode 100644 index 00000000..8db7c389 --- /dev/null +++ b/docs/readthedocs/source/doc/Nano/Howto/Training/PyTorchLightning/pytorch_lightning_training_bf16.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../../../../../../../python/nano/tutorial/notebook/training/pytorch-lightning/pytorch_lightning_training_bf16.ipynb" +} \ No newline at end of file diff --git a/docs/readthedocs/source/doc/Nano/Howto/Training/PyTorchLightning/pytorch_lightning_training_channels_last.nblink b/docs/readthedocs/source/doc/Nano/Howto/Training/PyTorchLightning/pytorch_lightning_training_channels_last.nblink new file mode 100644 index 00000000..7e5b4448 --- /dev/null +++ b/docs/readthedocs/source/doc/Nano/Howto/Training/PyTorchLightning/pytorch_lightning_training_channels_last.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../../../../../../../python/nano/tutorial/notebook/training/pytorch-lightning/pytorch_lightning_training_channels_last.ipynb" +} \ No newline at end of file diff --git a/docs/readthedocs/source/doc/Nano/Howto/accelerate_pytorch_inference_onnx.nblink b/docs/readthedocs/source/doc/Nano/Howto/accelerate_pytorch_inference_onnx.nblink deleted file mode 100644 index 6b834a20..00000000 --- a/docs/readthedocs/source/doc/Nano/Howto/accelerate_pytorch_inference_onnx.nblink +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path": "../../../../../../python/nano/tutorial/notebook/inference/pytorch/accelerate_pytorch_inference_onnx.ipynb" -} \ No newline at end of file diff --git a/docs/readthedocs/source/doc/Nano/Howto/accelerate_pytorch_inference_openvino.nblink b/docs/readthedocs/source/doc/Nano/Howto/accelerate_pytorch_inference_openvino.nblink deleted file mode 100644 index 493220f8..00000000 --- a/docs/readthedocs/source/doc/Nano/Howto/accelerate_pytorch_inference_openvino.nblink +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path": "../../../../../../python/nano/tutorial/notebook/inference/pytorch/accelerate_pytorch_inference_openvino.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 b96de11b..be4ae41f 100644 --- a/docs/readthedocs/source/doc/Nano/Howto/index.rst +++ b/docs/readthedocs/source/doc/Nano/Howto/index.rst @@ -5,22 +5,46 @@ 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. -PyTorch Inference +Training Optimization ------------------------- -* `How to accelerate a PyTorch inference pipeline through ONNXRuntime `_ -* `How to accelerate a PyTorch inference pipeline through OpenVINO `_ -* `How to quantize your PyTorch model for inference using Intel Neural Compressor `_ -* `How to quantize your PyTorch model for inference using OpenVINO Post-training Optimization Tools `_ +PyTorch Lightning +~~~~~~~~~~~~~~~~~~~~~~~~~ +* `How to accelerate a PyTorch Lightning application on training workloads through IntelĀ® Extension for PyTorch* `_ +* `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 `_ .. toctree:: :maxdepth: 1 :hidden: - accelerate_pytorch_inference_onnx - accelerate_pytorch_inference_openvino - quantize_pytorch_inference_inc - quantize_pytorch_inference_pot + Training/PyTorchLightning/accelerate_pytorch_lightning_training_ipex + Training/PyTorchLightning/accelerate_pytorch_lightning_training_multi_instance + Training/PyTorchLightning/pytorch_lightning_training_channels_last + Training/PyTorchLightning/pytorch_lightning_training_bf16 + Training/PyTorchLightning/pytorch_lightning_cv_data_pipeline + +Inference Optimization +------------------------- + +PyTorch +~~~~~~~~~~~~~~~~~~~~~~~~~ + +* `How to accelerate a PyTorch inference pipeline through ONNXRuntime `_ +* `How to accelerate a PyTorch inference pipeline through OpenVINO `_ +* `How to quantize your PyTorch model for inference using Intel Neural Compressor `_ +* `How to quantize your PyTorch model for inference using OpenVINO Post-training Optimization Tools `_ + +.. toctree:: + :maxdepth: 1 + :hidden: + + Inference/PyTorch/accelerate_pytorch_inference_onnx + Inference/PyTorch/accelerate_pytorch_inference_openvino + Inference/PyTorch/quantize_pytorch_inference_inc + Inference/PyTorch/quantize_pytorch_inference_pot Install ------------------------- diff --git a/docs/readthedocs/source/doc/Nano/Howto/quantize_pytorch_inference_inc.nblink b/docs/readthedocs/source/doc/Nano/Howto/quantize_pytorch_inference_inc.nblink deleted file mode 100644 index 70196d8d..00000000 --- a/docs/readthedocs/source/doc/Nano/Howto/quantize_pytorch_inference_inc.nblink +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path": "../../../../../../python/nano/tutorial/notebook/inference/pytorch/quantize_pytorch_inference_inc.ipynb" -} \ No newline at end of file diff --git a/docs/readthedocs/source/doc/Nano/Howto/quantize_pytorch_inference_pot.nblink b/docs/readthedocs/source/doc/Nano/Howto/quantize_pytorch_inference_pot.nblink deleted file mode 100644 index 02660864..00000000 --- a/docs/readthedocs/source/doc/Nano/Howto/quantize_pytorch_inference_pot.nblink +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path": "../../../../../../python/nano/tutorial/notebook/inference/pytorch/quantize_pytorch_inference_pot.ipynb" -} \ No newline at end of file