From 5ef6dfd561d15523f51d1428792de68ef4e424b5 Mon Sep 17 00:00:00 2001 From: Peter Jun Park Date: Fri, 31 May 2024 12:18:44 -0400 Subject: [PATCH 1/6] Add Python version info Add clearer example --- docs/how-to/3rd-party/tensorflow-install.rst | 65 +++++++++++--------- 1 file changed, 37 insertions(+), 28 deletions(-) diff --git a/docs/how-to/3rd-party/tensorflow-install.rst b/docs/how-to/3rd-party/tensorflow-install.rst index 37ac7887..0634249a 100644 --- a/docs/how-to/3rd-party/tensorflow-install.rst +++ b/docs/how-to/3rd-party/tensorflow-install.rst @@ -13,24 +13,6 @@ 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 @@ -53,13 +35,13 @@ 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,48 @@ Follow these steps: Using a wheels package ------------------------------------------------------------------------------- -To install TensorFlow using the wheels package, use the following command. +#. Ensure your environment is using a supported Python version for the desired ``tensorflow-rocm`` wheel. -.. code-block:: shell + a. To check compatible Python versions, navigate to the desired ROCm release version + in ``__. - pip install --user tensorflow-rocm==[wheel-version] -f [repo] --upgrade + 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``. -* ``[wheel-version]`` is the :ref:`TensorFlow version `. +#. To install TensorFlow, use the following command. Replace ``[wheel-version]`` and the ROCm version ``[major.minor]`` + as appropriate. -* ``[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 `. + .. code-block:: shell + + pip install --user tensorflow-rocm==[wheel-version] -f https://repo.radeon.com/rocm/manylinux/rocm-rel-X.Y --upgrade + + * ``[wheel-version]`` indicates the TensorFlow version. + + * ``[major.minor]`` indicates the `ROCm release version `_; for instance, + ``6.1``. + + .. _install-tensorflow-versions: + + .. list-table:: + :header-rows: 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 .. note:: - For details on ``tensorflow-rocm`` wheels and ROCm version compatibility, refer to - ``__. + As of ROCm 6.1, ``tensorflow-rocm`` packages are found at ``__. + Prior to ROCm 6.1, packages were found at ``_. + +For details on ``tensorflow-rocm`` wheels and ROCm version compatibility, refer to +``__. .. _test-tensorflow-installation: From ee6b14c5a26815d31cc73da2b6347ea313710d6c Mon Sep 17 00:00:00 2001 From: Peter Jun Park Date: Fri, 31 May 2024 13:06:02 -0400 Subject: [PATCH 2/6] Fix command placeholder version --- docs/how-to/3rd-party/tensorflow-install.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/how-to/3rd-party/tensorflow-install.rst b/docs/how-to/3rd-party/tensorflow-install.rst index 0634249a..d1e817a6 100644 --- a/docs/how-to/3rd-party/tensorflow-install.rst +++ b/docs/how-to/3rd-party/tensorflow-install.rst @@ -70,7 +70,7 @@ Using a wheels package .. code-block:: shell - pip install --user tensorflow-rocm==[wheel-version] -f https://repo.radeon.com/rocm/manylinux/rocm-rel-X.Y --upgrade + 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. From b59d9def5b8bd56bf17a3f7cceb3247cdd15d12b Mon Sep 17 00:00:00 2001 From: Peter Jun Park Date: Fri, 31 May 2024 13:13:48 -0400 Subject: [PATCH 3/6] Add blurb --- docs/how-to/3rd-party/tensorflow-install.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/how-to/3rd-party/tensorflow-install.rst b/docs/how-to/3rd-party/tensorflow-install.rst index d1e817a6..db6cab7b 100644 --- a/docs/how-to/3rd-party/tensorflow-install.rst +++ b/docs/how-to/3rd-party/tensorflow-install.rst @@ -76,9 +76,12 @@ Using a wheels package * ``[major.minor]`` indicates the `ROCm release version `_; for instance, ``6.1``. + | .. _install-tensorflow-versions: + The following table associates ROCm versions with their supported TensorFlow versions. + .. list-table:: :header-rows: 1 From 80b52610ae1fb26648f39d80b4a64e6a19b6648f Mon Sep 17 00:00:00 2001 From: Peter Jun Park Date: Wed, 5 Jun 2024 13:53:58 -0400 Subject: [PATCH 4/6] Tabify wheels installation Spellcheck Reorg --- 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..9159ffa9 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,49 +54,74 @@ 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 ``__. +.. note:: - 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``. + As of ROCm 6.1, ``tensorflow-rocm`` packages are found at ``__. + Before ROCm 6.1, packages were found at ``__. -#. To install TensorFlow, use the following command. Replace ``[wheel-version]`` and the ROCm version ``[major.minor]`` - as appropriate. +.. tab-set:: - .. code-block:: shell + .. tab-item:: ROCm 6.1 and later - pip install --user tensorflow-rocm==[wheel-version] -f https://repo.radeon.com/rocm/manylinux/rocm-rel-[major.minor] --upgrade + #. Make sure you're using a supported Python version for the desired ``tensorflow-rocm`` wheel. - * ``[wheel-version]`` indicates the TensorFlow version. + a. To check compatible Python versions, navigate to the desired ROCm release version + in ``__. - * ``[major.minor]`` indicates the `ROCm release version `_; for instance, - ``6.1``. - | + 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. - .. _install-tensorflow-versions: + For example, ``tensorflow_rocm-2.15.0-cp310-cp310-manylinux2014_x86_64.whl`` targets Python 3.10, as indicated by + ``cp310``. - The following table associates ROCm versions with their supported TensorFlow versions. + #. To install TensorFlow, use the following command. Replace ``[wheel-version]`` and the ROCm version ``[major.minor]`` + as appropriate. - .. list-table:: - :header-rows: 1 + .. code-block:: shell - * - 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 + pip install --user tensorflow-rocm==[wheel-version] -f https://repo.radeon.com/rocm/manylinux/rocm-rel-[major.minor] --upgrade -.. note:: + * ``[wheel-version]`` indicates the TensorFlow version. - As of ROCm 6.1, ``tensorflow-rocm`` packages are found at ``__. - Prior to ROCm 6.1, packages were found at ``_. + * ``[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 `_. + + .. 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 ``__. @@ -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 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. @@ -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 From c1ed60d4057a112cb8bd0bfae90acd255e8b77cc Mon Sep 17 00:00:00 2001 From: Peter Jun Park Date: Wed, 5 Jun 2024 15:10:34 -0400 Subject: [PATCH 5/6] All caps MAGMA in toc --- docs/sphinx/_toc.yml.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: From d658fa4bd4b850fc234e92d71d1ba7a7616409bc Mon Sep 17 00:00:00 2001 From: Peter Jun Park Date: Thu, 6 Jun 2024 14:28:03 -0400 Subject: [PATCH 6/6] Add link to see ROCm versions x tensorflow-rocm PyPI wheel versions --- docs/how-to/3rd-party/tensorflow-install.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/how-to/3rd-party/tensorflow-install.rst b/docs/how-to/3rd-party/tensorflow-install.rst index 9159ffa9..6753dd1b 100644 --- a/docs/how-to/3rd-party/tensorflow-install.rst +++ b/docs/how-to/3rd-party/tensorflow-install.rst @@ -96,6 +96,9 @@ Follow these steps to install ROCm on Linux using a ready-made Python 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