From 6dccd3be9416221785d2bace0fb52538d668eaea Mon Sep 17 00:00:00 2001 From: Peter Jun Park Date: Wed, 5 Jun 2024 13:53:58 -0400 Subject: [PATCH] Tabify wheels installation --- docs/how-to/3rd-party/tensorflow-install.rst | 102 ++++++++++++------- 1 file changed, 64 insertions(+), 38 deletions(-) diff --git a/docs/how-to/3rd-party/tensorflow-install.rst b/docs/how-to/3rd-party/tensorflow-install.rst index db6cab7b..33db0e3b 100644 --- a/docs/how-to/3rd-party/tensorflow-install.rst +++ b/docs/how-to/3rd-party/tensorflow-install.rst @@ -6,9 +6,9 @@ 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. @@ -29,8 +29,8 @@ 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: @@ -54,48 +54,73 @@ Follow these steps: Using a wheels package ------------------------------------------------------------------------------- -#. Ensure your environment is using a supported Python version for the desired ``tensorflow-rocm`` wheel. +Follow these steps to install ROCm on Linux using a ready-made Python wheel. - a. To check compatible Python versions, navigate to the desired ROCm release version - in ``__. +The following table associates ROCm versions with their supported TensorFlow versions. - b. In the versioned ROCm release directory, take note of the Python versions associated with the desired - 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``. +.. list-table:: + :header-rows: 1 -#. To install TensorFlow, use the following command. Replace ``[wheel-version]`` and the ROCm version ``[major.minor]`` - as appropriate. + * - ROCm version + - TensorFlow version + * - 6.1.x + - .. list-table:: - .. code-block:: shell + * - 2.13.1 + - 2.14.0 + - 2.15.0 - pip install --user tensorflow-rocm==[wheel-version] -f https://repo.radeon.com/rocm/manylinux/rocm-rel-[major.minor] --upgrade + * - 6.0.x + - .. list-table:: - * ``[wheel-version]`` indicates the TensorFlow version. + * - 2.12.1 + - 2.13.1 + - 2.14.0 - * ``[major.minor]`` indicates the `ROCm release version `_; for instance, - ``6.1``. - | +.. note:: - .. _install-tensorflow-versions: + As of ROCm 6.1, ``tensorflow-rocm`` packages are found at ``__. + Before ROCm 6.1, packages were found at ``__. - The following table associates ROCm versions with their supported TensorFlow versions. +.. tab-set:: - .. list-table:: - :header-rows: 1 + .. tab-item:: ROCm 6.1 and later - * - 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 + #. Ensure your environment uses a supported Python version for the desired ``tensorflow-rocm`` wheel. -.. note:: + a. To check compatible Python versions, navigate to the desired ROCm release version + in ``__. - As of ROCm 6.1, ``tensorflow-rocm`` packages are found at ``__. - Prior to ROCm 6.1, packages were found at ``_. + b. In the versioned ROCm release directory, take note of the Python versions associated with the desired + 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 + + 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:: Prior to ROCm 6.1 + + #. Ensure your environment uses a supported Python version for the desired ``tensorflow-rocm`` wheel. + + #. To install TensorFlow, use the following command. Replace ``[wheel-version]`` with the appropriate + TensorFlow version. + + .. code-block:: shell + + pip install --user tensorflow-rocm==[wheel-version] --upgrade + +.. _install-tensorflow-versions: For details on ``tensorflow-rocm`` wheels and ROCm version compatibility, refer to ``__. @@ -116,10 +141,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 validate your TensorFlow enviroment. -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. @@ -128,7 +154,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([ @@ -147,7 +173,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