diff --git a/docs/how-to/3rd-party/tensorflow-install.rst b/docs/how-to/3rd-party/tensorflow-install.rst index 37ac7887..6753dd1b 100644 --- a/docs/how-to/3rd-party/tensorflow-install.rst +++ b/docs/how-to/3rd-party/tensorflow-install.rst @@ -6,31 +6,13 @@ Installing TensorFlow for ROCm **************************************************************************************** -TensorFlow is an open-source library for solving machine learning, +`TensorFlow `_ is an open-source library for solving machine learning, deep learning, and AI problems. It can solve many -problems across different sectors and industries, but primarily focuses on +problems across different sectors and industries but primarily focuses on neural network training and inference. It is one of the most popular and in-demand frameworks and is very active in open-source contribution and development. -.. note:: - - As of ROCm 6.1, ``tensorflow-rocm`` packages are found at ``__. - Prior to ROCm 6.1, packages were found at ``_. - -.. _install-tensorflow-versions: - -.. list-table:: - :header-rows: 1 - :widths: 1, 1 - - * - ROCm version - - TensorFlow version - * - 6.1.x - - 2.13.1, 2.14.0, 2.15.0 - * - 6.0.x - - 2.12.1, 2.13.1, 2.14.0 - .. _install-tensorflow-options: Installing TensorFlow @@ -47,19 +29,19 @@ To install ROCm on bare metal, follow :doc:`/tutorial/install-overview`. The recommended option to get a TensorFlow environment is through Docker. -Using Docker provides portability and access to a prebuilt Docker image that -has been rigorously tested within AMD. This can also save compilation time and +Using Docker provides portability and access to a prebuilt Docker image +rigorously tested within AMD. This can also save compilation time and should perform as tested and mitigate potential installation issues. Follow these steps: -1. Pull the latest public TensorFlow Docker image. +#. Pull the latest public TensorFlow Docker image. .. code-block:: shell docker pull rocm/tensorflow:latest -2. Once you have pulled the image, run it by using the command below: +#. Once you have pulled the image, run it by using the command below: .. code-block:: shell @@ -72,21 +54,79 @@ Follow these steps: Using a wheels package ------------------------------------------------------------------------------- -To install TensorFlow using the wheels package, use the following command. +Follow these steps to install ROCm on Linux using a ready-made Python wheel. -.. code-block:: shell +.. note:: - pip install --user tensorflow-rocm==[wheel-version] -f [repo] --upgrade + As of ROCm 6.1, ``tensorflow-rocm`` packages are found at ``__. + Before ROCm 6.1, packages were found at ``__. -* ``[wheel-version]`` is the :ref:`TensorFlow version `. +.. tab-set:: -* ``[repo]`` is ``https://repo.radeon.com/rocm/manylinux/rocm-rel-X.Y/`` for versions 6.1 and later, - where ``X.Y`` indicates the :ref:`ROCm version `. + .. tab-item:: ROCm 6.1 and later -.. note:: + #. Make sure you're using a supported Python version for the desired ``tensorflow-rocm`` wheel. + + a. To check compatible Python versions, navigate to the desired ROCm release version + in ``__. + + b. In the versioned ROCm release directory, take note of the `Python version tag + `_ associated + with the wheel version indicated by ``cp`` in the wheels' file names. + + For example, ``tensorflow_rocm-2.15.0-cp310-cp310-manylinux2014_x86_64.whl`` targets Python 3.10, as indicated by + ``cp310``. + + #. To install TensorFlow, use the following command. Replace ``[wheel-version]`` and the ROCm version ``[major.minor]`` + as appropriate. + + .. code-block:: shell - For details on ``tensorflow-rocm`` wheels and ROCm version compatibility, refer to - ``__. + pip install --user tensorflow-rocm==[wheel-version] -f https://repo.radeon.com/rocm/manylinux/rocm-rel-[major.minor] --upgrade + + * ``[wheel-version]`` indicates the TensorFlow version. + + * ``[major.minor]`` indicates the `ROCm release version `_; for instance, + ``6.1``. + + .. tab-item:: Before ROCm 6.1 + + #. Make sure you're using a supported Python version for the desired ``tensorflow-rocm`` wheel. + + #. To install TensorFlow, use the following command. Replace ``[wheel-version]`` with the appropriate + ``tensorflow-rocm`` version `from PyPI `_. + + See ROCm versions with their associated ``tensorflow-rocm`` versions in + ``__. + + .. code-block:: shell + + pip install --user tensorflow-rocm==[wheel-version] --upgrade + +.. _install-tensorflow-versions: + +The following table associates ROCm versions with their supported TensorFlow versions. + +.. list-table:: + :header-rows: 1 + + * - ROCm version + - TensorFlow version + * - 6.1.x + - .. list-table:: + + * - 2.13.1 + - 2.14.0 + - 2.15.0 + + * - 6.0.x + - .. list-table:: + + * - 2.12.1 + - 2.13.1 + - 2.14.0 +For details on ``tensorflow-rocm`` wheels and ROCm version compatibility, refer to +``__. .. _test-tensorflow-installation: @@ -104,10 +144,11 @@ shell in the Docker container. Running a basic TensorFlow example ====================================== -To quickly validate your TensorFlow environment, let's run a basic TensorFlow example. +Run a basic TensorFlow example to test your TensorFlow environment. -The MNIST dataset is a collection of handwritten digits that may be used to train a Convolutional Neural Network (CNN) -for handwriting recognition. This dataset is included with your TensorFlow installation. +The MNIST dataset is a collection of handwritten digits that may be used to +train a convolutional neural network (CNN) for handwriting recognition. This +dataset is included with your TensorFlow installation. Run the following sample code to load the MNIST dataset, then train and evaluate it. @@ -116,7 +157,7 @@ Run the following sample code to load the MNIST dataset, then train and evaluate import tensorflow as tf print("TensorFlow version:", tf.__version__) mnist = tf.keras.datasets.mnist - + (x_train, y_train), (x_test, y_test) = mnist.load_data() x_train, x_test = x_train / 255.0, x_test / 255.0 model = tf.keras.models.Sequential([ @@ -135,7 +176,7 @@ Run the following sample code to load the MNIST dataset, then train and evaluate model.fit(x_train, y_train, epochs=5) model.evaluate(x_test, y_test, verbose=2) -If successful, you should see the following output indicating the image classifier is now trained to around 98% accuracy +If successful, you should see the following output indicating the image classifier is now trained to around 98 percent accuracy on this dataset. .. image:: ../../data/install/tensorflow-install/tensorflow-test-output.png diff --git a/docs/sphinx/_toc.yml.in b/docs/sphinx/_toc.yml.in index bf85b9b8..5bb956de 100644 --- a/docs/sphinx/_toc.yml.in +++ b/docs/sphinx/_toc.yml.in @@ -40,7 +40,7 @@ subtrees: - file: how-to/3rd-party/jax-install title: JAX - file: how-to/3rd-party/magma-install - title: Magma + title: MAGMA - caption: How-to entries: