From 2001a6513a56f2775968e31924f007d4d3f0ff45 Mon Sep 17 00:00:00 2001 From: Noha Ihab <49988746+NohaIhab@users.noreply.github.com> Date: Tue, 20 Aug 2024 17:01:26 +0300 Subject: [PATCH] docs: Add how-to guide to create Intel Notebook (#163) * docs: create Intel Notebook how-to guide * link intel gpu guide * fixing link * add command to confirm devices and expected output --------- Co-authored-by: afgambin --- docs/.custom_wordlist.txt | 4 +++ docs/how-to/jupyter-notebook.rst | 51 ++++++++++++++++++++++++++++++-- 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/docs/.custom_wordlist.txt b/docs/.custom_wordlist.txt index 3ee7cbd..73bcb77 100644 --- a/docs/.custom_wordlist.txt +++ b/docs/.custom_wordlist.txt @@ -15,7 +15,10 @@ initialized initializing intel io +intel +IPEX ipynb +ITEX Jupyter jupyter JupyterLab @@ -52,4 +55,5 @@ Tensorflow toolkits Validator WSL +XPU yaml diff --git a/docs/how-to/jupyter-notebook.rst b/docs/how-to/jupyter-notebook.rst index a16b9e9..84a9e9f 100644 --- a/docs/how-to/jupyter-notebook.rst +++ b/docs/how-to/jupyter-notebook.rst @@ -47,11 +47,11 @@ You should expect an output like this: Create an NVIDIA GPU-enabled notebook ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -You can create a Jupyter Notebook containing CUDA runtimes and ML frameworks, and access its JupyterLab server. +You can create an NVIDIA GPU-enabled Jupyter Notebook containing CUDA runtimes and ML frameworks, and access its JupyterLab server. .. note:: - To launch a GPU-enabled notebook, you must first :ref:`install ` + To launch an NVIDIA GPU-enabled notebook, you must first :ref:`install ` the NVIDIA Operator and :ref:`verify ` DSS can detect the GPU. See :ref:`nvidia_gpu` for more details. @@ -83,6 +83,53 @@ Confirm the GPU is detected and usable by running: tf.config.list_physical_devices('GPU') +Create an Intel GPU-enabled notebook +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can create an Intel GPU-enabled Jupyter Notebook with `Intel Extension for PyTorch (IPEX) `_ +or `Intel Extension for TensorFlow (ITEX) `_. + +.. note:: + + To launch an Intel GPU-enabled notebook, you must first :ref:`enable_intel_gpu`. + +To see the list of available Intel images, run: + +.. code-block:: bash + + dss create --help | grep intel + +You should see an output similar to this: + +.. code-block:: bash + + - intel-pytorch = intel/intel-extension-for-pytorch:2.1.20-xpu-idp-jupyter + - intel-tensorflow = intel/intel-extension-for-tensorflow:2.15.0-xpu-idp-jupyter + +Select one of them and create a notebook as follows: + +.. code-block:: bash + + dss create my-itex-notebook --image=intel-tensorflow + +Confirm the GPU is detected and usable by running: + +.. code-block:: python + + import tensorflow as tf + + tf.config.experimental.list_physical_devices() + +For example, you should expect an output like the following for a host system containing an Intel CPU and a single Intel GPU: + +.. code-block:: python + + [PhysicalDevice(name='/physical_device:CPU:0', device_type='CPU'), PhysicalDevice(name='/physical_device:XPU:0', device_type='XPU')] + +.. note:: + + Intel denotes XPU the combination of an Intel CPU with GPU. + List created notebooks ----------------------