diff --git a/docs/readthedocs/source/_toc.yml b/docs/readthedocs/source/_toc.yml index d8c6774a839..4acf883810a 100644 --- a/docs/readthedocs/source/_toc.yml +++ b/docs/readthedocs/source/_toc.yml @@ -53,14 +53,12 @@ subtrees: - caption: Chronos entries: - file: doc/Chronos/Overview/chronos - - file: doc/Chronos/Overview/windows_guide - file: doc/Chronos/Overview/quick-tour - - file: doc/Chronos/Overview/deep_dive - file: doc/Chronos/Howto/index - file: doc/Chronos/QuickStart/index + - file: doc/Chronos/Overview/deep_dive - file: doc/Chronos/Overview/chronos_known_issue - - caption: PPML entries: - file: doc/PPML/Overview/ppml diff --git a/docs/readthedocs/source/doc/Chronos/Howto/docker_guide_single_node.md b/docs/readthedocs/source/doc/Chronos/Howto/docker_guide_single_node.md new file mode 100644 index 00000000000..8c526569b02 --- /dev/null +++ b/docs/readthedocs/source/doc/Chronos/Howto/docker_guide_single_node.md @@ -0,0 +1,71 @@ +# Use Chronos in Container (docker) +This dockerfile helps user to build a docker image where Chronos-nightly build version is deployed. + +## Build an image +First clone the repo `BigDL` to the local. +```bash +git clone https://github.com/intel-analytics/BigDL.git +``` +Then `cd` to the root directory of `BigDL`, and copy the Dockerfile to it. +```bash +cd BigDL +cp docker/chronos-nightly/Dockerfile ./Dockerfile +``` +Then build your docker image with Dockerfile: +```bash +sudo docker build -t chronos-nightly:b1 . # You may choose any NAME:TAG you want. +``` +(Optional) Or build with a proxy: +```bash +# typically, you need a proxy for building since there will be some downloading. +sudo docker build \ + --build-arg http_proxy=http://: \ #optional + --build-arg https_proxy=http://: \ #optional + -t chronos-nightly:b1 . # You may choose any NAME:TAG you want. +``` +According to your network status, this building will cost **15-30 mins**. + +**Tips:** When errors happen like `E: Package 'apt-utils' has no installation candidate`, it's usually related to the bad network status. Please build with a proxy. + +## Run the image +```bash +sudo docker run -it --rm --net=host chronos-nightly:b1 bash +``` + +## Use Chronos +A conda environment is created for you automatically. `bigdl-chronos` and all of its depenencies are installed inside this environment. +```bash +(chronos) root@cpx-3:/opt/work# +``` + +## Run unitest examples on Jupyter Notebook for a quick use +You can run these on Jupyter Notebook on single node server if you pursue a quick use on Chronos. +```bash +(chronos) root@cpx-3:/opt/work# cd /opt/work/colab-notebook #Unitest examples are here. +``` +```bash +(chronos) root@cpx-3:/opt/work# jupyter notebook --notebook-dir=./ --ip=* --allow-root #Start the Jupyter Notebook services. +``` +After the Jupyter Notebook service is successfully started, you can connect to the Jupyter Notebook service from a browser. +1. Get the IP address of the container +2. Launch a browser, and connect to the Jupyter Notebook service with the URL: +
`https://container-ip-address:port-number/?token=your-token` +
As a result, you will see the Jupyter Notebook opened. +3. Open one of these `.ipynb` files, run through the example and learn how to use Chronos to predict time series. + +## Shut down docker container +You should shut down the BigDL Docker container after using it. +1. First, use `ctrl+p+q` to quit the container when you are still in it. +2. Then, you can list all the active Docker containers by command line: +```bash +sudo docker ps +``` +You will see your docker containers: +```bash +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +40de2cdad025 chronos-nightly:b1 "/opt/work/" 3 hours ago Up 3 hours upbeat_al +``` +3. Shut down the corresponding docker container by its ID: +```bash +sudo docker rm -f 40de2cdad025 +``` diff --git a/docs/readthedocs/source/doc/Chronos/Howto/how-to-create-forecaster.ipynb b/docs/readthedocs/source/doc/Chronos/Howto/how-to-create-forecaster.ipynb deleted file mode 100644 index f1eee321e72..00000000000 --- a/docs/readthedocs/source/doc/Chronos/Howto/how-to-create-forecaster.ipynb +++ /dev/null @@ -1,206 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/intel-analytics/BigDL/blob/main/docs/readthedocs/source/doc/Chronos/Howto/how-to-create-forecaster.ipynb)\n", - "\n", - "\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "![image.png](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJsAAABHCAMAAAAnQ8XqAAA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AblVwnqCAIYwjRJTgAjNdLil1g3K4AAAAASUVORK5CYII=)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# How to create a Forecaster" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Introduction\n", - "\n", - "In Chronos, Forecaster (`bigdl.chronos.forecaster.Forecaster`) is the forecasting abstraction. It hides the complex logic of model's creation, training, scaling to cluster, tuning, optimization and inferencing while expose some APIs for users to control.\n", - "\n", - "In this guide, we will use the `TCNForecaster` and nyc_taxi datasets as examples to describe **how to create a Forecaster**." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Prepare Environments" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Before creating a forecaster, we need to install Chronos. Chronos supports deep learning backend implemented by pytorch and tensorflow and machine learning methods based on arima and prophet." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# uncomment following 1 lines for pytorch backend\n", - "!pip install --pre --upgrade bigdl-chronos[pytorch]\n", - "\n", - "# uncomment following 2 lines for tensorflow backend\n", - "# !pip install --pre --upgrade bigdl-chronos\n", - "# !pip install --pre --upgrade bigdl-nano[tensorflow]\n", - "\n", - "# installation trick on colab (no need to do these on your own environment)\n", - "!pip uninstall torchtext -y\n", - "exit()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Create a forecaster\n", - "We provide two ways to create a Forecaster.\n", - "\n", - "* Create by `Forecaster.from_tsdataset`(**Recommended if valid**)\n", - "* Create by `Forecaster(...)` directly" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Before creating a Forecaster, We need to know the four parameters `past_seq_len`, `future_seq_len`, `input_feature_num`, `output_feature_num`, which represent the time step and feature column, As shown below.\n", - "\n", - "\n", - "\n", - "* **past_seq_len**: Sampled input length, represents the history time step length. (i.e. lookback)\n", - "* **future_seq_len**: Sampled output length, represents the output time step length.(i.e. horizon)\n", - "* **input_feature_num**: All feature column(s), including extra feature column(s) and target column(s).\n", - "* **output_feature_num**: Only target column(s).\n", - "\n", - "More Forecaster info, please refer to [Time Series Forecasting OverView](https://bigdl.readthedocs.io/en/latest/doc/Chronos/Overview/forecasting.html#time-series-forecasting-overview)\n", - "\n", - "If you want to create a traditional statistic forecaster(e.g. [ProphetForecaster](https://bigdl.readthedocs.io/en/latest/doc/PythonAPI/Chronos/forecasters.html#prophetforecaster) or [ARIMAForecaster](https://bigdl.readthedocs.io/en/latest/doc/PythonAPI/Chronos/forecasters.html#arimaforecaster)), you may refer to their API doc directly since they are relatively easy and do not have required parameters to create them." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# create a TSDataset\n", - "from bigdl.chronos.data.repo_dataset import get_public_dataset\n", - "\n", - "tsdataset = get_public_dataset('nyc_taxi', with_split=False)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Forecaster.from_tsdataset\n", - "\n", - "`from_tsdataset` is a classmethod, so you can call `Forecsater.from_tsdataset`, then input a `TSDataset` instance, where `TSDataset` is a built-in time series preprocessing class.\n", - "\n", - "If the `roll` or `to_torch_data_loader` method has been called by tsdataset, `past_seq_len` and `future_seq_len` do not need to be specified for from_tsdataset, otherwise both must be specified." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# uncomment following 1 lines for pytorch backend\n", - "from bigdl.chronos.forecaster import TCNForecaster\n", - "\n", - "# uncomment following 1 lines for tensorflow backend\n", - "# from bigdl.chronos.forecaster.tf import TCNForecaster\n", - "\n", - "tcn = TCNForecaster.from_tsdataset(tsdataset,\n", - " past_seq_len=48,\n", - " future_seq_len=5)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "> πŸ“ **Note**\n", - ">\n", - "> We recommend to use `Forecsater.from_tsdataset` if possible. While for some reasons, some forecasters (e.g. `ProphetForecaster` and `ARIMAForecaster`) does not support this API. Or maybe you want to process your data customizedly without using `TSDataset`, you may create a forecaster directly by calling `Forecaster(...)`." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Create a forecaster directly\n", - "You can also create forecaster directly, the parameters mentioned above still need to be specified." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tcn = TCNForecaster(past_seq_len=48,\n", - " future_seq_len=5,\n", - " input_feature_num=2,\n", - " output_feature_num=2)" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3.7.13 ('chronos-deps')", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.13" - }, - "vscode": { - "interpreter": { - "hash": "1a7f5d41b94c9ba67b8a1438ec071a63464312bab4ac0991ee31faebf1c9c228" - } - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/docs/readthedocs/source/doc/Chronos/Howto/how_to_create_forecaster.nblink b/docs/readthedocs/source/doc/Chronos/Howto/how_to_create_forecaster.nblink new file mode 100644 index 00000000000..6a1c53206d8 --- /dev/null +++ b/docs/readthedocs/source/doc/Chronos/Howto/how_to_create_forecaster.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../../../../../python/chronos/colab-notebook/howto/how-to-create-forecaster.ipynb" +} \ No newline at end of file diff --git a/docs/readthedocs/source/doc/Chronos/Howto/how_to_speedup_inference_of_forecaster_through_ONNXRuntime.ipynb b/docs/readthedocs/source/doc/Chronos/Howto/how_to_speedup_inference_of_forecaster_through_ONNXRuntime.ipynb deleted file mode 100644 index 4e9fc26d690..00000000000 --- a/docs/readthedocs/source/doc/Chronos/Howto/how_to_speedup_inference_of_forecaster_through_ONNXRuntime.ipynb +++ /dev/null @@ -1,250 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "\n", - "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/intel-analytics/BigDL/blob/main/docs/readthedocs/source/doc/Chronos/Howto/how_to_speedup_inference_of_forecaster_through_ONNXRuntime.ipynb)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "![image.png](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJsAAABHCAMAAAAnQ8XqAAAACXBIWXMAAA7DAAAOwwHHb6hkAAADAFBMVEVHcEyAgYR+gYU0OD85OTuOkZSChYk5OTs5OTs5OTuAgYR/gYM5OTuAgYSAgYSBgoWAgoU5OTs+NTg5OTs4ODs5OTsAccQ1NTk3Nzo4ODuBg4U4ODs5OTs4ODs5OTuRlJY6OjwAccM4ODs5OTs3Nzo4ODuBgoQ3Nzo4OTo3NzqSlJc5OTsBccOAgYSRlJeRk5Y5OTs5OTs5OTs4ODuPkpQ4ODo4ODs5OTs5OTs4ODuRlJeSlJeJio4BccM5OTsDbrw4ODuPkpU4ODuVmJs4ODsBccOTlpk2Njo3OTwBccOSlZiUmJo5OTs5OTs5OTyPkZSRk5eTlpk5OTw4ODs5OTw2Njk5OTuRlJeUl5pzi6EAccM5OTsBcMM4ODs4ODs4ODs4ODs4ODs5OTs4ODuAgYSAgYM4ODs4ODuTl5kBccM4ODo4ODs4ODs5OTs4ODs5OTs5OTuSlJc4ODs4ODs5OTs4ODuAgYSRk5aFh4o4ODucn6I4ODs4ODv7/P4BccM5OTuAgoVDQ0c4ODsBccM4ODtFf7ABcMM5OTuTlZh/goM4ODqAgYSFhomnrK4jTnCDhYeAgYUCb744OTyChIc4ODsAcMI5OTsBccM5OTt/gYSChIeFh4paW15/gYOChIcDbrs5OTv///+AgYT+/v6IiYw6OjyBgoX9/f47Oz09PT99foF+f4KDhIc5OTw8PD88PD73+Pj9/v6Oj5KCg4Z/gIMBccOJio1/gYTq6us7Oz56e3719fU6Oj2AgYV8fYCAgoR4eXzm5ud7fH/7+/s9PUDs7Ozh4uL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62HVIV5dxSSpDB6WrU4QYZhyxAI9IrIUMTwCzsimDECtDJ2MKIyM/LsAIAzhku6/M1XNjoHBtniBDV/7ZBTyQCWoOTp6lZ6ODgKEJDLclhMAlPFKXzvV744lRoh1nOsnwyPo9oEn9netWKmdrQiYEHfnU+EAIBKAUH7KAGp+aGpoAisrZ1FhzBMwewVPajUTt7OyqzQu6sGTlAQRCoHBSMQUCcO6AZRgmygAblVwnqCAIYwjRJTgAjNdLil1g3K4AAAAASUVORK5CYII=)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Speed up inference of forecaster through ONNXRuntime" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "onZXfhnkmexc" - }, - "source": [ - "## Introduction\n", - "\n", - "In the inferencing process, it is desirable to speed up. One way to do this is to utilize some accelerators, such as ONNXRuntime.\n", - "\n", - "Actually, utilizing ONNXRuntime to accelerate is easy in Chronos, that is directly calling `predict_with_onnx` (optionally `build_onnx`). In this guidance, **we demonstrate how to speed up inference of forecaster through ONNXRuntime** in detail.\n", - "\n", - "We will take `TCNForecaster` and nyc_taxi dataset as an example in this guide." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Setup\n", - "\n", - "Before we begin, we need to install chronos if it isn’t already available, we choose to use pytorch as deep learning backend." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!pip install --pre --upgrade bigdl-chronos[pytorch]\n", - "# install ONNXRuntime\n", - "!pip install onnx\n", - "!pip install onnxruntime\n", - "# uninstall torchtext to avoid version conflict\n", - "!pip uninstall -y torchtext\n", - "exit()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "> πŸ“**Note**\n", - "> \n", - "> - Although Chronos supports inferencing on a cluster, the method to speed up can only be used when forecaster is a non-distributed version.\n", - "> - Only pytorch backend deep learning forecasters support onnxruntime acceleration." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Forecaster preparation\n", - "\n", - "Before the inferencing process, a forecaster should be created and trained. The training process is introduced in the previous guidance [Train forcaster on single node](https://bigdl.readthedocs.io/en/latest/doc/Chronos/Howto/how_to_train_forecaster_on_one_node.html) in detail, therefore we directly create and train a `TCNForecaster` based on the nyc taxi dataset." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "nbsphinx": "hidden" - }, - "outputs": [], - "source": [ - "# data preparation\n", - "def get_data():\n", - " from bigdl.chronos.data.repo_dataset import get_public_dataset\n", - " from sklearn.preprocessing import StandardScaler\n", - "\n", - " # load the nyc taxi dataset\n", - " tsdata_train, tsdata_val, tsdata_test = get_public_dataset(name='nyc_taxi')\n", - "\n", - " stand = StandardScaler()\n", - " for tsdata in [tsdata_train, tsdata_val, tsdata_test]:\n", - " tsdata.impute()\\\n", - " .scale(stand, fit=tsdata is tsdata_train)\n", - "\n", - " # convert `tsdata_train` and `tsdata_test` to pytorch dataloader\n", - " train_data = tsdata_train.to_torch_data_loader(roll=True, lookback=48, horizon=1)\n", - " test_data = tsdata_test.to_torch_data_loader(roll=True, lookback=48, horizon=1)\n", - "\n", - " return train_data, test_data\n", - "\n", - "# trained forecaster preparation\n", - "def get_trained_forecaster(train_data):\n", - " from bigdl.chronos.forecaster.tcn_forecaster import TCNForecaster\n", - " # create a TCNForecaster\n", - " forecaster = TCNForecaster(past_seq_len=48,\n", - " future_seq_len=1,\n", - " input_feature_num=1,\n", - " output_feature_num=1)\n", - "\n", - " # train the forecaster on the training data\n", - " forecaster.fit(train_data)\n", - " return forecaster" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Speeding up inference\n", - "\n", - "When a trained forecaster is ready and forecaster is a non-distributed version, we provide with `predict_with_onnx` method to speed up inference. The method can be directly called without calling `build_onnx` and forecaster will automatically build an onnxruntime session with default settings." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "> πŸ“**Note**\n", - "> \n", - "> `build_onnx` is recommended to use in following cases:\n", - "> \n", - "> 1. To strictly control the thread to be used during inferencing.\n", - "> 2. To alleviate the cold start problem when `predict_with_onnx` is called for the first time.\n", - "> \n", - "> Please refer to [API documentation](https://bigdl.readthedocs.io/en/latest/doc/PythonAPI/Chronos/forecasters.html#bigdl.chronos.forecaster.tcn_forecaster.TCNForecaster.build_onnx) for more information on `build_onnx`." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The `predict_with_onnx` method supports data in following formats:\n", - "\n", - "1. numpy ndarray (**recommended**)\n", - "2. pytorch dataloader\n", - "3. `bigdl.chronos.data.TSDataset`\n", - "\n", - "And there are `batch_size` and `quantize` parameters you may want to change. If not familiar with manual hyperparameters tuning, just leave `batch_size` to the default value. Additionally, `quantize` can be set to `True` to use the quantized onnx model to predict." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# get data for training and testing\n", - "train_data, test_data = get_data()\n", - "# get a trained forecaster\n", - "forecaster = get_trained_forecaster(train_data)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# speed up inference through ONNXRuntime\n", - "for x, y in test_data:\n", - " yhat = forecaster.predict_with_onnx(x.numpy()) # predict" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Let's see the acceleration performance of `predict_with_onnx`.\n", - "\n", - "The predict latency of without accelerator and with ONNXRuntime are given below. The result \"p50\" means latency sorted to 50% in multiple predictions and the acceleration performance is significant.\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from bigdl.chronos.metric.forecast_metrics import Evaluator\n", - "\n", - "x = next(iter(test_data))[0]\n", - "def func_original():\n", - " forecaster.predict(x.numpy()) # without accelerator\n", - "def func_onnxruntime():\n", - " forecaster.predict_with_onnx(x.numpy()) # with ONNXRuntime\n", - "\n", - "print(\"original predict runtime (ms):\", Evaluator.get_latency(func_original))\n", - "print(\"pridict runtime with ONNXRuntime (ms):\", Evaluator.get_latency(func_onnxruntime))" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.13" - }, - "vscode": { - "interpreter": { - "hash": "08f205d83aa93bf00288c36236890a907831cd95d5c91acb243adbba6993e97a" - } - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/docs/readthedocs/source/doc/Chronos/Howto/how_to_speedup_inference_of_forecaster_through_ONNXRuntime.nblink b/docs/readthedocs/source/doc/Chronos/Howto/how_to_speedup_inference_of_forecaster_through_ONNXRuntime.nblink new file mode 100644 index 00000000000..3c6a4e9c3bf --- /dev/null +++ b/docs/readthedocs/source/doc/Chronos/Howto/how_to_speedup_inference_of_forecaster_through_ONNXRuntime.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../../../../../python/chronos/colab-notebook/howto/how_to_speedup_inference_of_forecaster_through_ONNXRuntime.ipynb" +} \ No newline at end of file diff --git a/docs/readthedocs/source/doc/Chronos/Howto/how_to_speedup_inference_of_forecaster_through_OpenVINO.ipynb b/docs/readthedocs/source/doc/Chronos/Howto/how_to_speedup_inference_of_forecaster_through_OpenVINO.ipynb deleted file mode 100644 index f839be8c73e..00000000000 --- a/docs/readthedocs/source/doc/Chronos/Howto/how_to_speedup_inference_of_forecaster_through_OpenVINO.ipynb +++ /dev/null @@ -1,239 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "\n", - "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/intel-analytics/BigDL/blob/main/docs/readthedocs/source/doc/Chronos/Howto/how_to_speedup_inference_of_forecaster_through_OpenVINO.ipynb)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "![image.png](data:image/png;base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1FhzBMwewVPajUTt7OyqzQu6sGTlAQRCoHBSMQUCcO6AZRgmygAblVwnqCAIYwjRJTgAjNdLil1g3K4AAAAASUVORK5CYII=)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Speed up inference of forecaster through OpenVINO" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Introduction\n", - "\n", - "In the inferencing process, it is desirable to speed up. One way to do this is to utilize some accelerators, such as OpenVINO.\n", - "\n", - "Actually, utilizing OpenVINO to accelerate is easy in Chronos, that is directly calling `predict_with_openvino` (optionally `build_openvino`). In this guidance, **we demonstrate how to speed up inference of forecaster through OpenVINO** in detail.\n", - "\n", - "We will take `TCNForecaster` and nyc_taxi dataset as an example in this guide." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Setup\n", - "\n", - "Before we begin, we need to install chronos if it isn’t already available, we choose to use pytorch as deep learning backend." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!pip install --pre --upgrade bigdl-chronos[pytorch]\n", - "# install OpenVINO\n", - "!pip install openvino-dev\n", - "# fix conflict with google colab\n", - "!pip uninstall -y torchtext\n", - "!pip install numpy==1.21\n", - "exit()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "> πŸ“**Note**\n", - "> \n", - "> - Although Chronos supports inferencing on a cluster, the method to speed up can only be used when forecaster is a non-distributed version.\n", - "> - Only pytorch backend deep learning forecasters support openvino acceleration." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Forecaster preparation\n", - "\n", - "Before the inferencing process, a forecaster should be created and trained. The training process is introduced in the previous guidance [Train forcaster on single node](https://bigdl.readthedocs.io/en/latest/doc/Chronos/Howto/how_to_train_forecaster_on_one_node.html) in detail, therefore we directly create and train a `TCNForecaster` based on the nyc taxi dataset." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "nbsphinx": "hidden" - }, - "outputs": [], - "source": [ - "# data preparation\n", - "def get_data():\n", - " from bigdl.chronos.data.repo_dataset import get_public_dataset\n", - " from sklearn.preprocessing import StandardScaler\n", - "\n", - " # load the nyc taxi dataset\n", - " tsdata_train, tsdata_val, tsdata_test = get_public_dataset(name='nyc_taxi')\n", - "\n", - " stand = StandardScaler()\n", - " for tsdata in [tsdata_train, tsdata_val, tsdata_test]:\n", - " tsdata.impute()\\\n", - " .scale(stand, fit=tsdata is tsdata_train)\n", - "\n", - " # convert `tsdata_train` and `tsdata_test` to pytorch dataloader\n", - " train_data = tsdata_train.to_torch_data_loader(roll=True, lookback=48, horizon=1)\n", - " test_data = tsdata_test.to_torch_data_loader(roll=True, lookback=48, horizon=1)\n", - "\n", - " return train_data, test_data\n", - "\n", - "# trained forecaster preparation\n", - "def get_trained_forecaster(train_data):\n", - " from bigdl.chronos.forecaster.tcn_forecaster import TCNForecaster\n", - " # create a TCNForecaster\n", - " forecaster = TCNForecaster(past_seq_len=48,\n", - " future_seq_len=1,\n", - " input_feature_num=1,\n", - " output_feature_num=1)\n", - "\n", - " # train the forecaster on the training data\n", - " forecaster.fit(train_data)\n", - " return forecaster" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Speeding up inference\n", - "\n", - "When a trained forecaster is ready and forecaster is a non-distributed version, we provide with `predict_with_openvino` method to speed up inference. The method can be directly called without calling `build_openvino` and forecaster will automatically build an openvino session with default settings." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "> πŸ“**Note**\n", - "> \n", - "> `build_openvino` is recommended to use when you want to alleviate the cold start problem when `predict_with_openvino` is called for the first time.\n", - "> \n", - "> Please refer to [API documentation](https://bigdl.readthedocs.io/en/latest/doc/PythonAPI/Chronos/forecasters.html#bigdl.chronos.forecaster.tcn_forecaster.TCNForecaster.build_openvino) for more information on `build_openvino`." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The `predict_with_openvino` method currently only supports data in numpy ndarray format and the parameter `batch_size` can be changed. If not familiar with manual hyperparameters tuning, just leave `batch_size` to the default value." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# get data for training and testing\n", - "train_data, test_data = get_data()\n", - "# get a trained forecaster\n", - "forecaster = get_trained_forecaster(train_data)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# speed up inference through OpenVINO\n", - "for x, y in test_data:\n", - " yhat = forecaster.predict_with_openvino(x.numpy()) # predict" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Let's see the acceleration performance of `predict_with_openvino`.\n", - "\n", - "The predict latency of without accelerator and with OpenVINO are given below. The result \"p50\" means latency sorted to 50% in multiple predictions and the acceleration performance is significant." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from bigdl.chronos.metric.forecast_metrics import Evaluator\n", - "\n", - "x = next(iter(test_data))[0]\n", - "def func_original():\n", - " forecaster.predict(x.numpy()) # without accelerator\n", - "def func_openvino():\n", - " forecaster.predict_with_openvino(x.numpy()) # with OpenVINO\n", - "\n", - "print(\"original predict runtime (ms):\", Evaluator.get_latency(func_original))\n", - "print(\"pridict runtime with OpenVINO (ms):\", Evaluator.get_latency(func_openvino))" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.13" - }, - "vscode": { - "interpreter": { - "hash": "08f205d83aa93bf00288c36236890a907831cd95d5c91acb243adbba6993e97a" - } - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/docs/readthedocs/source/doc/Chronos/Howto/how_to_speedup_inference_of_forecaster_through_OpenVINO.nblink b/docs/readthedocs/source/doc/Chronos/Howto/how_to_speedup_inference_of_forecaster_through_OpenVINO.nblink new file mode 100644 index 00000000000..32cb876c87a --- /dev/null +++ b/docs/readthedocs/source/doc/Chronos/Howto/how_to_speedup_inference_of_forecaster_through_OpenVINO.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../../../../../python/chronos/colab-notebook/howto/how_to_speedup_inference_of_forecaster_through_OpenVINO.ipynb" +} \ No newline at end of file diff --git a/docs/readthedocs/source/doc/Chronos/Howto/how_to_train_forecaster_on_one_node.ipynb b/docs/readthedocs/source/doc/Chronos/Howto/how_to_train_forecaster_on_one_node.ipynb deleted file mode 100644 index 3af545fa532..00000000000 --- a/docs/readthedocs/source/doc/Chronos/Howto/how_to_train_forecaster_on_one_node.ipynb +++ /dev/null @@ -1,267 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/intel-analytics/BigDL/blob/main/docs/readthedocs/source/doc/Chronos/Howto/how_to_train_forecaster_on_one_node.ipynb)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "![image.png](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJsAAABHCAMAAAAnQ8XqAAAACXBIWXMAAA7DAAAOwwHHb6hkAAADAFBMVEVHcEyAgYR+gYU0OD85OTuOkZSChYk5OTs5OTs5OTuAgYR/gYM5OTuAgYSAgYSBgoWAgoU5OTs+NTg5OTs4ODs5OTsAccQ1NTk3Nzo4ODuBg4U4ODs5OTs4ODs5OTuRlJY6OjwAccM4ODs5OTs3Nzo4ODuBgoQ3Nzo4OTo3NzqSlJc5OTsBccOAgYSRlJeRk5Y5OTs5OTs5OTs4ODuPkpQ4ODo4ODs5OTs5OTs4ODuRlJeSlJeJio4BccM5OTsDbrw4ODuPkpU4ODuVmJs4ODsBccOTlpk2Njo3OTwBccOSlZiUmJo5OTs5OTs5OTyPkZSRk5eTlpk5OTw4ODs5OTw2Njk5OTuRlJeUl5pz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cLU43pzVGt9UaLYjts/aG5nwvulWXZGNokySEImRtdPb4Tpry3W3y4U+7u7Cwha7C+9gOpNAFYU3+mH/OUZYy/TovpdBrvXZ7lxwcEwo33CeJoaMKABVnXaZ3C43n/GjUXB9GvfDOdNF1UydnODE3JneGVM34gEK82X2SNG3Q7Y6PUHg9292NKJ3Rlc0b+P6Ar6BZUtDvteemhrUio07XlgzYSoAZvVTu4XVP0nzTl44oewrYPbid0Z1Nn3dvjXw90YPZDt9W+fuSZEtZER1ZTar9oeTwWY7LL1OXGcIPCxp6r9bHwZx2+p7L/8dQwXHj7188Ofu3zUHtoBqzWXbNz84eOw4Kjh28NXqRROWCDDoyeMeKmcQRgYKCgqCmEsKFBgkd3Kyg+e6wCQoKx9xYhACzxnp6h7ahQHO7zr/cNeWzUBJMDi06xA62HVIV5dxSSpDB6WrU4QYZhyxAI9IrIUMTwCzsimDECtDJ2MKIyM/LsAIAzhku6/M1XNjoHBtniBDV/7ZBTyQCWoOTp6lZ6ODgKEJDLclhMAlPFKXzvV744lRoh1nOsnwyPo9oEn9netWKmdrQiYEHfnU+EAIBKAUH7KAGp+aGpoAisrZ1FhzBMwewVPajUTt7OyqzQu6sGTlAQRCoHBSMQUCcO6AZRgmygAblVwnqCAIYwjRJTgAjNdLil1g3K4AAAAASUVORK5CYII=)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Train forcaster on single node" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "onZXfhnkmexc" - }, - "source": [ - "## Introduction\n", - "\n", - "In Chronos, Forecaster (`bigdl.chronos.forecaster.Forecaster`) is the forecasting abstraction. It hides the complex logic of model's creation, training, scaling to cluster, tuning, optimization and inferencing while expose some APIs for users (e.g. `fit` in this guide) to control.\n", - "\n", - "In this guidance, **we demonstrate how to train forecasters on one node**. In the training process, forecaster will learn the pattern (like the period, scale...) in history data. Although Chronos supports training on a cluster, it's highly recommeneded to try one node first before allocating a cluster to make life easier.\n", - "\n", - "We will take `TCNForecaster` and nyc_taxi dataset as an exmaple in this guide." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Setup\n", - "\n", - "Before we begin, we need to install chronos if it isn’t already available, we choose to use pytorch as deep learning backend." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!pip install --pre --upgrade bigdl-chronos[pytorch]\n", - "!pip uninstall -y torchtext # uninstall torchtext to avoid version conflict\n", - "exit()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Data preparation\n", - "\n", - "First, we load the nyc taxi dataset." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from bigdl.chronos.data.repo_dataset import get_public_dataset\n", - "from sklearn.preprocessing import StandardScaler\n", - "\n", - "tsdata_train, tsdata_val, _ = get_public_dataset(name='nyc_taxi')\n", - "\n", - "stand = StandardScaler()\n", - "for tsdata in [tsdata_train, tsdata_val]:\n", - " tsdata.impute()\\\n", - " .scale(stand, fit=tsdata is tsdata_train)" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "i8kjsyL4mexd" - }, - "source": [ - "Forecaster supports learning history data in many formats, including:\n", - "\n", - "1. `bigdl.chronos.data.TSDataset` (**recommended**)\n", - "2. pytorch dataloader\n", - "3. tensorflow dataset\n", - "4. numpy ndarray\n", - "\n", - "It's always recommended to use `TSDataset` direcetly when possible, while many other formats are supported if users want to customize their own data processing and feature engineering procedure." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# comment this line if you want to try other formats\n", - "train_data = tsdata_train\n", - "\n", - "# uncomment this line to change `train_data` as pytorch dataloader\n", - "# train_data = tsdata_train.to_torch_data_loader(lookback=48, horizon=1)\n", - "\n", - "# uncomment this line to change `train_data` as numpy ndarray\n", - "# train_data = tsdata_train.roll(lookback=48, horizon=1).to_numpy()" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "IswBKf39mexg" - }, - "source": [ - "## Training\n", - "\n", - "First we will create a `TCNForecaster`.\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from bigdl.chronos.forecaster.tcn_forecaster import TCNForecaster\n", - "\n", - "forecaster = TCNForecaster(past_seq_len=48,\n", - " future_seq_len=1,\n", - " input_feature_num=1,\n", - " output_feature_num=1)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Then just call `fit` on the training data!\n", - "\n", - "There are some other parameters you may want to change, including `epochs` and `batch_size`. How change these hyperparameters might be tricky and highly based on experience. \n", - "\n", - "Here is a \"rule of thumb\" for users who are not that familiar with manual hyperparameter tuning: adjust `epochs` to make sure your mse training loss on scaled data (you can find it on the right side on progress bar, and \"mse\" is the default loss function) decreases under than 0.1 and leave `batch_size` to the default value." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "yc34x9dcmexg", - "outputId": "bba44274-e6d0-408a-bf9b-32d549fe1ea9" - }, - "outputs": [], - "source": [ - "forecaster.fit(train_data)" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "ZiolCDSmmexj" - }, - "source": [ - "## Validation (optional)\n", - "\n", - "Overfitting is a common issue when it comes to time series analysis since the data are not always large enough, one (and probably the most effective) method to avoid overfitting is validate your model during the trianing process. `Forecaster.fit` API also provides a way to validate the forecaster and find the best stop point before the model suffers overfitting.\n", - "\n", - "As in following cases, we choose a validation_mode called \"best_epoch\" to load back the checkpoint with best validation loss on validation data." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# comment this line if you want to try other formats\n", - "val_data = tsdata_val.to_torch_data_loader(lookback=48, horizon=1)\n", - "\n", - "# uncomment this line to change `val_data` as numpy ndarray\n", - "# val_data = tsdata_val.roll(lookback=48, horizon=1).to_numpy()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "o7jWojYNmexk", - "outputId": "eb4cc68f-4d38-410d-b007-c507da30b97f" - }, - "outputs": [], - "source": [ - "# create a new forecaster\n", - "forecaster = TCNForecaster(past_seq_len=48,\n", - " future_seq_len=1,\n", - " input_feature_num=1,\n", - " output_feature_num=1)\n", - "\n", - "# train the forecaster with validation data to avoid overfitting\n", - "forecaster.fit(train_data,\n", - " epochs=3,\n", - " validation_data=val_data,\n", - " validation_mode='best_epoch')" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Acceleration on intel CPU\n", - "\n", - "Chronos only support CPU (and transparent acceleration on Intel CPU) for training. Since time series data is not large, CPU training is enough for most cases.\n", - "\n", - "You may find there is no code needed in this section since the acceleration happens transparently (i.e. no specific code is needed for acceleration settings) inside the forecasters in Chronos. This includes **automatically** sets the\n", - "\n", - "1. better memory allocator\n", - "2. hardware-awared system variables for multithread utilization\n", - "3. multiprocess training on powerful CPU\n", - "4. usage of IPEX (intel pytorch extension) and intel optimized tensorflow." - ] - } - ], - "metadata": { - "colab": { - "collapsed_sections": [], - "name": "train_forecaster_on_one_node.ipynb", - "provenance": [] - }, - "kernelspec": { - "display_name": "Python 3.7.13 ('chronos')", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.13" - }, - "vscode": { - "interpreter": { - "hash": "f7cbcfcf124497a723b2fc91b0dad8cd6ed41af955928289a9d3478af9690021" - } - } - }, - "nbformat": 4, - "nbformat_minor": 1 -} diff --git a/docs/readthedocs/source/doc/Chronos/Howto/how_to_train_forecaster_on_one_node.nblink b/docs/readthedocs/source/doc/Chronos/Howto/how_to_train_forecaster_on_one_node.nblink new file mode 100644 index 00000000000..cf39d394329 --- /dev/null +++ b/docs/readthedocs/source/doc/Chronos/Howto/how_to_train_forecaster_on_one_node.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../../../../../python/chronos/colab-notebook/howto/how_to_train_forecaster_on_one_node.ipynb" +} \ No newline at end of file diff --git a/docs/readthedocs/source/doc/Chronos/Howto/how_to_tune_forecaster_model.ipynb b/docs/readthedocs/source/doc/Chronos/Howto/how_to_tune_forecaster_model.ipynb deleted file mode 100644 index fec73a52732..00000000000 --- a/docs/readthedocs/source/doc/Chronos/Howto/how_to_tune_forecaster_model.ipynb +++ /dev/null @@ -1,300 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/intel-analytics/BigDL/blob/main/docs/readthedocs/source/doc/Chronos/Howto/how_to_tune_forecaster_model.ipynb)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "![image.png](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJsAAABHCAMAAAAnQ8XqAAAACXBIWXMAAA7DAAAOwwHHb6hkAAADAFBMVEVHcEyAgYR+gYU0OD85OTuOkZSChYk5OTs5OTs5OTuAgYR/gYM5OTuAgYSAgYSBgoWAgoU5OTs+NTg5OTs4ODs5OTsAccQ1NTk3Nzo4ODuBg4U4ODs5OTs4ODs5OTuRlJY6OjwAccM4ODs5OTs3Nzo4ODuBgoQ3Nzo4OTo3NzqSlJc5OTsBccOAgYSRlJeRk5Y5OTs5OTs5OTs4ODuPkpQ4ODo4ODs5OTs5OTs4ODuRlJeSlJeJio4BccM5OTsDbrw4ODuPkpU4ODuVmJs4ODsBccOTlpk2Njo3OTwBccOSlZiUmJo5OTs5OTs5OTyPkZSRk5eTlpk5OTw4ODs5OTw2Njk5OTuRlJeUl5pzi6EAccM5OTsBcMM4ODs4ODs4ODs4ODs4ODs5OTs4ODuAgYSAgYM4ODs4ODuTl5kBccM4ODo4ODs4ODs5OTs4ODs5OTs5OTuSlJc4ODs4ODs5OTs4ODuAgYSRk5aF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B9GvfDOdNF1UydnODE3JneGVM34gEK82X2SNG3Q7Y6PUHg9292NKJ3Rlc0b+P6Ar6BZUtDvteemhrUio07XlgzYSoAZvVTu4XVP0nzTl44oewrYPbid0Z1Nn3dvjXw90YPZDt9W+fuSZEtZER1ZTar9oeTwWY7LL1OXGcIPCxp6r9bHwZx2+p7L/8dQwXHj7188Ofu3zUHtoBqzWXbNz84eOw4Kjh28NXqRROWCDDoyeMeKmcQRgYKCgqCmEsKFBgkd3Kyg+e6wCQoKx9xYhACzxnp6h7ahQHO7zr/cNeWzUBJMDi06xA62HVIV5dxSSpDB6WrU4QYZhyxAI9IrIUMTwCzsimDECtDJ2MKIyM/LsAIAzhku6/M1XNjoHBtniBDV/7ZBTyQCWoOTp6lZ6ODgKEJDLclhMAlPFKXzvV744lRoh1nOsnwyPo9oEn9netWKmdrQiYEHfnU+EAIBKAUH7KAGp+aGpoAisrZ1FhzBMwewVPajUTt7OyqzQu6sGTlAQRCoHBSMQUCcO6AZRgmygAblVwnqCAIYwjRJTgAjNdLil1g3K4AAAAASUVORK5CYII=)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Tune forecaster on single node\n", - "\n", - "\n", - "## Introduction\n", - "\n", - "In this guidance, we demonstrate **how to tune forecaster on single node**. In tuning process, forecaster will find the best hyperparameter combination among user-defined search space, which is a common process if users pursue a forecaster with higher accuracy.\n", - "\n", - "Chronos support forecasting model's hyperparameter tuning in 2 sepaerated APIs (i.e. `Forecaster.tune` and `AutoTSEstimator`) for users with different demands:\n", - "\n", - "| |`Forecaster.tune`|`AutoTSEstimator`|\n", - "|-------------------|:---------------:|:---------------:|\n", - "|Single Node |βœ“ |βœ“ |\n", - "|Cluster |X |βœ“ |\n", - "|Performance-awared Tuning|βœ“ |X |\n", - "|Feature Selection |X |βœ“ |\n", - "|Customized Model |X |βœ“ |\n", - "\n", - "`Forecaster.tune` provides easier and more stright-forward API for users who are familiar with Chronos forecasters, it is recommened to try this method first.\n", - "\n", - "We will take `AutoformerForecaster` and nyc_taxi dataset as an example in this guide." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Setup\n", - "\n", - "Before we begin, we need to install chronos if it isn’t already available, we choose to use pytorch as deep learning backend." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!pip install --pre --upgrade bigdl-chronos[pytorch,automl]\n", - "!pip uninstall -y torchtext # uninstall torchtext to avoid version conflict\n", - "exit()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Data preparation\n", - "\n", - "First, we load the nyc taxi dataset.\n", - "\n", - "Currently, tune func only support **Numpy Ndarray input**." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from sklearn.preprocessing import StandardScaler\n", - "from bigdl.chronos.data.repo_dataset import get_public_dataset\n", - "\n", - "def get_tsdata():\n", - " name = 'nyc_taxi'\n", - " tsdata_train, tsdata_valid, _ = get_public_dataset(name)\n", - " stand_scaler = StandardScaler()\n", - " for tsdata in [tsdata_train, tsdata_valid]:\n", - " tsdata.impute(mode=\"linear\")\\\n", - " .scale(stand_scaler, fit=(tsdata is tsdata_train))\n", - " return tsdata_train, tsdata_valid\n", - "\n", - "tsdata_train, tsdata_valid = get_tsdata()\n", - "\n", - "input_feature_num = 1\n", - "output_feature_num = 1\n", - "lookback = 20\n", - "horizon = 1\n", - "label_len = 10\n", - "\n", - "train_data = tsdata_train.roll(lookback=lookback, horizon=horizon, label_len=label_len, time_enc=True).to_numpy()\n", - "val_data = tsdata_valid.roll(lookback=lookback, horizon=horizon, label_len=label_len,time_enc=True).to_numpy()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "train_data and val_data is compose of (x, y, x_enc, y_enc) as we set `time_enc=True` which is only necessary for Autoformer." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Tuning\n", - "\n", - "The first step of tuning a forecaster is to define forecaster with space parameters.\n", - "\n", - "There are several common space choices:\n", - "\n", - "`space.Categorical` : search space for hyperparameters which are categorical, e.g. a = space.Categorical('a', 'b', 'c', 'd')\n", - "\n", - "`space.Real` : search space for numeric hyperparameter that takes continuous values, e.g. learning_rate = space.Real(0.01, 0.1, log=True)\n", - "\n", - "`space.Int` : search space for numeric hyperparameter that takes integer values, e.g. range = space.Int(0, 100)\n", - "\n", - "How to change these hyperparameters might be tricky and highly based on experience, but lr, d_model, d_ff and layers or similar parameters usually has a great impact on performance." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import bigdl.nano.automl.hpo.space as space\n", - "from bigdl.chronos.forecaster.autoformer_forecaster import AutoformerForecaster\n", - "\n", - "autoformer = AutoformerForecaster(input_feature_num=input_feature_num,\n", - " output_feature_num=output_feature_num,\n", - " past_seq_len=lookback,\n", - " future_seq_len=horizon,\n", - " label_len=label_len,\n", - " seed=1024,\n", - " freq='t',\n", - " loss=\"mse\",\n", - " metrics=['mae', 'mse', 'mape'],\n", - " lr = space.Real(0.0001, 0.1, log=True),\n", - " d_model=space.Categorical(32, 64, 128, 256),\n", - " d_ff=space.Categorical(32, 64, 128, 256),\n", - " e_layers=space.Categorical(1,2),\n", - " n_head=space.Categorical(1,8))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Then just call `tune` on the training data and validation data!\n", - "\n", - "In addition to data, there are three parameters which **need** to be specified : n_trials, target_metric and direction(or directions for multi-objective HPO).\n", - "\n", - "`n_trials`: number of trials to run. The more trials, the longer the running time, the better results.\n", - "\n", - "`target_metric`: the target metric to optimize, a string or an instance of torchmetrics.metric.Metric, default to 'mse'. If you want to try a multi-objective HPO, you need to pass in a list, for example ['mse', 'latency'] in which latency is a built-in metric for performance.\n", - "\n", - "`direction`: in which direction to optimize the target metric, \"maximize\" or \"minimize\", default to \"minimize\". If you want to try a multi-objective HPO, you need to set direction=None, and specify directions which is a list containing direction for each metric, for example ['minimize', 'minimize'].\n", - "\n", - "there are other two parameters which you **may** change their default values : epochs and batch_size." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "autoformer.tune(train_data, validation_data=val_data,\n", - " n_trials=10, target_metric='mse', direction=\"minimize\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Then, you can see the whole trial history by calling `search_summary()`." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "autoformer.search_summary()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "After `tune`, the model parameters of autoformer is **initialized** according to the best trial parameters. You need to fit the model again." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "autoformer.fit(train_data, epochs=4, batch_size=32)\n", - "# evaluate on val set\n", - "evaluate = autoformer.evaluate(val_data)\n", - "print(evaluate)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Save and load(Optional)\n", - "\n", - "After tuning and fitting, you can save your model by calling `save` with a filename." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "autoformer.save(checkpoint_file=\"best.ckpt\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Then, when you need to load the model weights, just call `load()` with corresponding filename." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "autoformer.load(checkpoint_file=\"best.ckpt\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Or if there is a new session, just define a new forecaster with **six necessary parameters: input_feature_num, output_feature_num, past_seq_len, future_seq_len, label_len, and freq**, then `load` with corresponding filename." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "new_autoformer = AutoformerForecaster(input_feature_num=input_feature_num,\n", - " output_feature_num=output_feature_num,\n", - " past_seq_len=lookback,\n", - " future_seq_len=horizon,\n", - " label_len=label_len,\n", - " freq='s')\n", - "new_autoformer.load(checkpoint_file=\"best.ckpt\")" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3.8.10 64-bit", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.10" - }, - "vscode": { - "interpreter": { - "hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6" - } - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/docs/readthedocs/source/doc/Chronos/Howto/how_to_tune_forecaster_model.nblink b/docs/readthedocs/source/doc/Chronos/Howto/how_to_tune_forecaster_model.nblink new file mode 100644 index 00000000000..10d6ab1063b --- /dev/null +++ b/docs/readthedocs/source/doc/Chronos/Howto/how_to_tune_forecaster_model.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../../../../../python/chronos/colab-notebook/howto/how_to_tune_forecaster_model.ipynb" +} \ No newline at end of file diff --git a/docs/readthedocs/source/doc/Chronos/Howto/index.rst b/docs/readthedocs/source/doc/Chronos/Howto/index.rst index 94b1cc1e816..f5b2987403f 100644 --- a/docs/readthedocs/source/doc/Chronos/Howto/index.rst +++ b/docs/readthedocs/source/doc/Chronos/Howto/index.rst @@ -2,34 +2,31 @@ Chronos How-to Guides ========================= How-to guides are bite-sized, executable examples where users could check when meeting with some specific topic during the usage. -Forecasting +Install ------------------------- -* `Create a forecaster `__ - - In this guidance, we demonstrate **how to create a Forecaster**. Including two ways of creating a forecaster and an explanation of some important parameters. +* `Install Chronos on Windows `__ +* `Use Chronos in container(docker) `__ -* `Train forecaster on single node `__ +.. toctree:: + :maxdepth: 1 + :hidden: - In this guidance, **we demonstrate how to train forecasters on one node**. In the training process, forecaster will learn the pattern (like the period, scale...) in history data. Although Chronos supports training on a cluster, it's highly recommeneded to try one node first before allocating a cluster to make life easier. + windows_guide + docker_guide_single_node +Forecasting +------------------------- +* `Create a forecaster `__ +* `Train forecaster on single node `__ * `Tune forecaster on single node `__ - - In this guidance, we demonstrate **how to tune forecaster on single node**. In tuning process, forecaster will find the best hyperparameter combination among user-defined search space, which is a common process if users pursue a forecaster with higher accuracy. - * `Speed up inference of forecaster through ONNXRuntime `__ - - In this guidance, **we demonstrate how to speed up inference of forecaster through ONNXRuntime**. In inferencing process, Chronos supports ONNXRuntime to accelerate inferencing which is helpful to users. - * `Speed up inference of forecaster through OpenVINO `__ - In this guidance, **we demonstrate how to speed up inference of forecaster through OpenVINO**. In inferencing process, Chronos supports OpenVINO to accelerate inferencing which is helpful to users. - - .. toctree:: :maxdepth: 1 :hidden: - how-to-create-forecaster + how_to_create_forecaster how_to_train_forecaster_on_one_node how_to_tune_forecaster_model how_to_speedup_inference_of_forecaster_through_ONNXRuntime diff --git a/docs/readthedocs/source/doc/Chronos/Overview/windows_guide.md b/docs/readthedocs/source/doc/Chronos/Howto/windows_guide.md similarity index 69% rename from docs/readthedocs/source/doc/Chronos/Overview/windows_guide.md rename to docs/readthedocs/source/doc/Chronos/Howto/windows_guide.md index a8b77f090a4..d84b668154c 100644 --- a/docs/readthedocs/source/doc/Chronos/Overview/windows_guide.md +++ b/docs/readthedocs/source/doc/Chronos/Howto/windows_guide.md @@ -1,4 +1,4 @@ -# Chronos Windows User Guide +# Install Chronos on Windows ## Step 1: Install WSL2 @@ -26,21 +26,5 @@ chmod +x Miniconda3-4.5.4-Linux-x86_64.sh ./Miniconda3-4.5.4-Linux-x86_64.sh ``` -## Step 3: Create a BigDL-Chronos env - -Use conda to create a new environment. For example, use `bigdl-chronos` as the new environemnt name: - -```bash -conda create -n bigdl-chronos python=3.7 setuptools=58.0.4 -conda activate bigdl-chronos -``` - - -## Step 4: Install BigDL Chronos from Pypi - -You can install BigDL chronos from Pypi with `pip`. Please run: - -``` -pip install bigdl-chronos -``` -For more installation options, please refer to [Chronos User Guide.](https://bigdl.readthedocs.io/en/latest/doc/Chronos/Overview/chronos.html#install) +## Step 3: Install Chronos +For more installation options, please refer to [Chronos User Guide](https://bigdl.readthedocs.io/en/latest/doc/Chronos/Overview/chronos.html#install). diff --git a/docs/readthedocs/source/doc/Chronos/Image/anomaly_detection.svg b/docs/readthedocs/source/doc/Chronos/Image/anomaly_detection.svg new file mode 100644 index 00000000000..643aba2a8b0 --- /dev/null +++ b/docs/readthedocs/source/doc/Chronos/Image/anomaly_detection.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/readthedocs/source/doc/Chronos/Image/forecasting.svg b/docs/readthedocs/source/doc/Chronos/Image/forecasting.svg new file mode 100644 index 00000000000..b35dfe3cba6 --- /dev/null +++ b/docs/readthedocs/source/doc/Chronos/Image/forecasting.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/readthedocs/source/doc/Chronos/Image/simulation.svg b/docs/readthedocs/source/doc/Chronos/Image/simulation.svg new file mode 100644 index 00000000000..1d8bf61f9b8 --- /dev/null +++ b/docs/readthedocs/source/doc/Chronos/Image/simulation.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/readthedocs/source/doc/Chronos/Overview/chronos.md b/docs/readthedocs/source/doc/Chronos/Overview/chronos.md index 6bb10724868..b3988927854 100644 --- a/docs/readthedocs/source/doc/Chronos/Overview/chronos.md +++ b/docs/readthedocs/source/doc/Chronos/Overview/chronos.md @@ -3,13 +3,54 @@ ### **1. Overview** _BigDL-Chronos_ (_Chronos_ for short) is an application framework for building a fast, accurate and scalable time series analysis application. -You can use _Chronos_ to do: +You can use _Chronos_ to: -- **Data pre/post-processing and feature generation** (using [TSDataset](./data_processing_feature_engineering.html)) -- **Time Series Forecasting** (using [Standalone Forecasters](./forecasting.html#use-standalone-forecaster-pipeline), [Auto Models](./forecasting.html#use-auto-forecasting-model) (with HPO) or [AutoTS](./forecasting.html#use-autots-pipeline) (full AutoML enabled pipelines)) -- **Anomaly Detection** (using [Anomaly Detectors](./anomaly_detection.html#anomaly-detection)) -- **Synthetic Data Generation** (using [Simulators](./simulation.html#generate-synthetic-data)) -- **Speed up or tune your customized time-series model** (using TSTrainer and [AutoTS](./forecasting.html#use-autots-pipeline)) +```eval_rst +.. grid:: 3 + :gutter: 1 + + .. grid-item-card:: + :class-footer: sd-bg-light + + **Forecasting** + ^^^ + + .. image:: ../Image/forecasting.svg + :width: 200 + :alt: Alternative text + + +++ + + Predict future using history data. + + .. grid-item-card:: + :class-footer: sd-bg-light + + **Anomaly Detection** + ^^^ + + .. image:: ../Image/anomaly_detection.svg + :width: 200 + :alt: Alternative text + + +++ + + Discover unexpected items in data. + + .. grid-item-card:: + :class-footer: sd-bg-light + + **Simulation** + ^^^ + + .. image:: ../Image/simulation.svg + :width: 200 + :alt: Alternative text + + +++ + + Generate similar data as history data. +``` --- ### **2. Install** @@ -100,15 +141,17 @@ When you install `bigdl-chronos` from PyPI. We recommend to install with a conda ```bash conda create -n my_env python=3.7 setuptools=58.0.4 conda activate my_env +# click the installation panel above to find which installation option to use pip install --pre --upgrade bigdl-chronos[pytorch] # or other options you may want to use -source bigdl-nano-init +source bigdl-nano-init # accelerate the conda env ``` + #### **2.2 Tensorflow backend** Tensorflow is one of the supported backend of Chronos in nightly release version, while it can not work alone without pytorch in Chronos for now. We will fix it soon. If you want to use tensorflow backend, please ```bash pip install --pre --upgrade bigdl-nano[tensorflow] ``` -after you install the pytorch backend chronos. +**after you install the pytorch backend chronos.** #### **2.3 OS and Python version requirement** @@ -155,7 +198,7 @@ after you install the pytorch backend chronos. +++ - `Data process <./data_processing_feature_engineering.html>`_ / + `Data <./data_processing_feature_engineering.html>`_ / `Forecast <./forecasting.html>`_ / `Detect <./anomaly_detection.html>`_ / `Simulate <./simulation.html>`_ @@ -166,14 +209,15 @@ after you install the pytorch backend chronos. .. grid-item-card:: :class-footer: sd-bg-light - **How-to-Guide** + **How-to-Guide** / **Example** ^^^ If you are meeting with some specific problems during the usage, how-to guides are good place to be checked. + Examples provides short, high quality use case that users can emulated in their own works. +++ - Work In Progress + `How-to-Guide <../Howto/index.html>`_ / `Example <../QuickStart/index.html>`_ .. grid-item-card:: :class-footer: sd-bg-light @@ -188,51 +232,3 @@ after you install the pytorch backend chronos. `API Document <../../PythonAPI/Chronos/index.html>`_ ``` - ---- - -### **4. Examples and Demos** -- Quickstarts - - [Use AutoTSEstimator for Time-Series Forecasting](../QuickStart/chronos-autotsest-quickstart.html) - - [Use TSDataset and Forecaster for Time-Series Forecasting](../QuickStart/chronos-tsdataset-forecaster-quickstart.html) - - [Use Anomaly Detector for Unsupervised Anomaly Detection](../QuickStart/chronos-anomaly-detector.html) -- Examples - - [Use AutoLSTM on nyc taxi dataset][autolstm_nyc_taxi] - - [Use AutoProphet on nyc taxi dataset][autoprophet_nyc_taxi] - - [High dimension time series forecasting with Chronos TCMFForecaster][run_electricity] - - [Use distributed training with Chronos Seq2SeqForecaster][distributed_training_network_traffic] - - [Use ONNXRuntime to accelerate the inference of AutoTSEstimator][onnx_autotsestimator_nyc_taxi] - - [Use ONNXRuntime to accelerate the inference of Seq2SeqForecaster][onnx_forecaster_network_traffic] - - [Generate synthetic data with DPGANSimulator in a data-driven fashion][simulator] - - [Quantizate your forecaster to speed up inference][quantization] -- Use cases - - [Unsupervised Anomaly Detection][AIOps_anomaly_detect_unsupervised] - - [Unsupervised Anomaly Detection based on Forecasts][AIOps_anomaly_detect_unsupervised_forecast_based] - - [Stock Price Prediction with LSTM][stock_prediction] - - [Stock Price Prediction with ProphetForecaster and AutoProphet][stock_prediction_prophet] - - [Network Traffic Forecasting with AutoTSEstimator][network_traffic_autots_forecasting] - - [Network Traffic Forecasting (using multivariate time series data)][network_traffic_model_forecasting] - - [Network Traffic Forecasting (using multistep time series data)][network_traffic_multivariate_multistep_tcnforecaster] - - [Network Traffic Forecasting with Customized Model][network_traffic_autots_customized_model] - - [Help pytorch-forecasting improve the training speed of DeepAR model][pytorch_forecasting_deepar] - - [Help pytorch-forecasting improve the training speed of TFT model][pytorch_forecasting_tft] - - -[autolstm_nyc_taxi]: -[autoprophet_nyc_taxi]: -[run_electricity]: -[distributed_training_network_traffic]: -[onnx_autotsestimator_nyc_taxi]: -[onnx_forecaster_network_traffic]: -[simulator]: -[AIOps_anomaly_detect_unsupervised]: -[AIOps_anomaly_detect_unsupervised_forecast_based]: -[stock_prediction]: -[stock_prediction_prophet]: -[network_traffic_autots_forecasting]: -[network_traffic_model_forecasting]: -[network_traffic_multivariate_multistep_tcnforecaster]: -[network_traffic_autots_customized_model]: -[quantization]: -[pytorch_forecasting_deepar]: -[pytorch_forecasting_tft]: diff --git a/docs/readthedocs/source/doc/Chronos/QuickStart/index.md b/docs/readthedocs/source/doc/Chronos/QuickStart/index.md index c1aa7bb2219..5c5071294ce 100644 --- a/docs/readthedocs/source/doc/Chronos/QuickStart/index.md +++ b/docs/readthedocs/source/doc/Chronos/QuickStart/index.md @@ -1,4 +1,4 @@ -# Chronos Tutorial +# Chronos Examples
@@ -9,7 +9,7 @@

Filter:

-

Please check the checkboxes or click tag buttons to show the related tutorials. Reclick or uncheck will hide corresponding tutorials. If nothing is checked or clicked, all the tutorials will be displayed.

+

Please check the checkboxes or click tag buttons to show the related examples. Reclick or uncheck will hide corresponding examples. If nothing is checked or clicked, all the examples will be displayed.

forecast