Skip to content

Commit cdb9bf7

Browse files
Merge pull request #2655 from madeline-underwood/tensor
Tensor_JA to sign off
2 parents 0f28c28 + 3cfe3be commit cdb9bf7

6 files changed

Lines changed: 81 additions & 85 deletions

File tree

content/learning-paths/servers-and-cloud-computing/tensorflow-gcp/_index.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
---
22
title: Deploy TensorFlow on Google Cloud C4A (Arm-based Axion VMs)
3-
4-
draft: true
5-
cascade:
6-
draft: true
7-
83
minutes_to_complete: 30
94

10-
who_is_this_for: This is an introductory topic for software developers deploying and optimizing TensorFlow workloads on Arm64 Linux environments, specifically using Google Cloud C4A virtual machines powered by Axion processors.
5+
who_is_this_for: This is an introductory topic for software developers deploying and optimizing TensorFlow workloads on Arm64 Linux environments, specifically using Google Cloud C4A virtual machines powered by Axion processors.
116

127
learning_objectives:
13-
- Provision an Arm-based SUSE SLES virtual machine on Google Cloud (C4A with Axion processors)
8+
- Provision an Arm-based SUSE Linux Enterprise Server (SLES) virtual machine on Google Cloud (C4A with Axion processors)
149
- Install TensorFlow on a SUSE Arm64 (C4A) instance
15-
- Verify TensorFlow by running basic computation and model training tests on Arm64
16-
- Benchmark TensorFlow using tf.keras to evaluate inference speed and model performance on Arm64 systems.
10+
- Verify TensorFlow by running basic computation and model training tests on Arm64
11+
- Benchmark TensorFlow using TensorFlow Keras (`tf.keras`) to evaluate inference speed and model performance on Arm64 systems
1712

1813
prerequisites:
19-
- A [Google Cloud Platform (GCP)](https://cloud.google.com/free) account with billing enabled
14+
- A [Google Cloud Platform (GCP)](https://cloud.google.com/free) account with billing enabled
2015
- Basic familiarity with [TensorFlow](https://www.tensorflow.org/)
2116

2217
author: Pareena Verma
@@ -45,16 +40,14 @@ further_reading:
4540
title: Google Cloud documentation
4641
link: https://cloud.google.com/docs
4742
type: documentation
48-
4943
- resource:
5044
title: TensorFlow documentation
5145
link: https://www.tensorflow.org/learn
5246
type: documentation
53-
5447
- resource:
5548
title: Phoronix Test Suite (PTS) documentation
5649
link: https://www.phoronix-test-suite.com/
57-
type: documentation
50+
type: documentation
5851

5952
weight: 1
6053
layout: "learningpathall"
Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
---
2-
title: Getting started with TensorFlow on Google Axion C4A (Arm Neoverse-V2)
2+
title: Get started with TensorFlow on Google Axion C4A
33

44
weight: 2
55

66
layout: "learningpathall"
77
---
88

9-
## Google Axion C4A Arm instances in Google Cloud
9+
## Explore Google Axion C4A Arm instances in Google Cloud
1010

11-
Google Axion C4A is a family of Arm-based virtual machines built on Google’s custom Axion CPU, which is based on Arm Neoverse-V2 cores. Designed for high-performance and energy-efficient computing, these virtual machines offer strong performance for modern cloud workloads such as CI/CD pipelines, microservices, media processing, and general-purpose applications.
11+
Google Axion C4A is a family of Arm-based virtual machines (VMs) that use Google’s custom Axion CPU, based on Arm Neoverse-V2 cores. Designed for high-performance and energy-efficient computing, these VMs offer strong performance for modern cloud workloads such as CI/CD pipelines, microservices, media processing, and general-purpose applications.
1212

13-
The C4A series provides a cost-effective alternative to x86 virtual machines while leveraging the scalability and performance benefits of the Arm architecture in Google Cloud.
13+
The C4A series provides a cost-effective alternative to x86 VMs while using the scalability and performance benefits of the Arm architecture in Google Cloud.
1414

15-
To learn more about Google Axion, refer to the [Introducing Google Axion Processors, our new Arm-based CPUs](https://cloud.google.com/blog/products/compute/introducing-googles-new-arm-based-cpu) blog.
15+
To learn more about Google Axion, see the [Introducing Google Axion Processors, our new Arm-based CPUs](https://cloud.google.com/blog/products/compute/introducing-googles-new-arm-based-cpu) blog.
1616

17-
## TensorFlow
17+
## Explore TensorFlow
1818

19-
[TensorFlow](https://www.tensorflow.org/) is an **open-source machine learning and deep learning framework** developed by **Google**. It helps developers and researchers **build, train, and deploy AI models** efficiently across **CPUs, GPUs, and TPUs**.
19+
[TensorFlow](https://www.tensorflow.org/) is an open-source machine learning and deep learning framework developed by Google. It helps developers and researchers build, train, and deploy AI models efficiently across CPUs, GPUs, and TPUs.
2020

21-
With support for **neural networks**, **natural language processing (NLP)**, and **computer vision**, TensorFlow is widely used for **AI research and production**.
22-
Its **flexibility** and **scalability** make it ideal for both **cloud** and **edge environments**.
21+
With support for neural networks, natural language processing (NLP), and computer vision, TensorFlow is widely used for AI research and production. Its flexibility and scalability make it ideal for both cloud and edge environments.
2322

2423
To learn more, visit the [official TensorFlow website](https://www.tensorflow.org/).
24+
25+
## Next steps
26+
27+
Now that you understand Google Axion C4A Arm-based VMs and TensorFlow fundamentals, you can provision your own VM and start benchmarking machine learning workloads on Google Cloud.

content/learning-paths/servers-and-cloud-computing/tensorflow-gcp/baseline.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Test TensorFlow baseline performance on Google Axion C4A Arm virtual machines
2+
title: Test TensorFlow baseline performance on Google Axion C4A
33
weight: 5
44

55
### FIXED, DO NOT MODIFY
@@ -8,11 +8,11 @@ layout: learningpathall
88

99
## Perform baseline testing
1010

11-
This section helps you verify that TensorFlow is properly installed and working on your Google Axion C4A VM. You'll run tests to confirm that your CPU can perform TensorFlow operations correctly.
11+
This section helps you confirm that TensorFlow is installed and working correctly on your Google Axion C4A Arm virtual machine (VM). You'll run tests to check that your CPU can perform TensorFlow operations and basic neural network training.
1212

13-
### Check available devices
13+
## Check available devices
1414

15-
This command shows which hardware devices TensorFlow can use, such as CPU or GPU. On most VMs, you'll see only CPU listed:
15+
List the hardware devices TensorFlow can use, such as CPU or GPU. On most VMs, only the CPU is available:
1616

1717
```console
1818
python -c "import tensorflow as tf; print(tf.config.list_physical_devices())"
@@ -24,30 +24,28 @@ The output is similar to:
2424
[PhysicalDevice(name='/physical_device:CPU:0', device_type='CPU')]
2525
```
2626

27-
### Run a computation test
27+
## Run a computation test
2828

29-
This test multiplies two large matrices to verify that TensorFlow computations work correctly on your CPU and measures execution time:
29+
Multiply two large matrices to verify TensorFlow computations on your CPU and measure execution time:
3030

3131
```console
32-
python -c "import tensorflow as tf; import time;
33-
a = tf.random.uniform((1000,1000)); b = tf.random.uniform((1000,1000));
34-
start = time.time(); c = tf.matmul(a,b); end = time.time();
32+
python -c "import tensorflow as tf; import time; \
33+
a = tf.random.uniform((1000,1000)); b = tf.random.uniform((1000,1000)); \
34+
start = time.time(); c = tf.matmul(a,b); end = time.time(); \
3535
print('Computation time:', end - start, 'seconds')"
3636
```
3737

38-
This checks CPU performance for basic operations and provides a baseline measurement.
39-
4038
The output is similar to:
4139

4240
```output
4341
Computation time: 0.008263111114501953 seconds
4442
```
4543

46-
### Test neural network execution
44+
This provides a baseline measurement for CPU performance.
4745

48-
Use a text editor to create a new file named `test_nn.py` for testing a simple neural network.
46+
## Test neural network execution
4947

50-
Add the following code to create and train a basic neural network using random data:
48+
Create a file named `test_nn.py` with the following code:
5149

5250
```python
5351
import keras
@@ -61,7 +59,7 @@ y = np.random.rand(1000, 1)
6159
# Define the model
6260
model = keras.Sequential()
6361
model.add(keras.Input(shape=(20,)))
64-
model.add(layers.Dense(64,activation="relu"))
62+
model.add(layers.Dense(64, activation="relu"))
6563
model.add(layers.Dense(1))
6664

6765
# Compile the model
@@ -71,9 +69,9 @@ model.compile(optimizer='adam', loss='mse')
7169
model.fit(x, y, epochs=1, batch_size=32)
7270
```
7371

74-
This script creates a simple neural network to verify that TensorFlow's deep learning functions work properly on the Arm platform.
72+
This script creates and trains a basic neural network using random data to verify that TensorFlow's deep learning functions work on the Arm platform.
7573

76-
### Run the neural network test
74+
## Run the neural network test
7775

7876
Execute the script:
7977

@@ -87,4 +85,4 @@ TensorFlow displays training progress similar to:
8785
32/32 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - loss: 0.1024
8886
```
8987

90-
This confirms that TensorFlow is working correctly on your Arm VM and can perform both basic computations and neural network training.
88+
TensorFlow is working correctly on your Arm-based VM for both basic computations and neural network training. Your environment is ready for benchmarking.

content/learning-paths/servers-and-cloud-computing/tensorflow-gcp/benchmarking.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ layout: learningpathall
88

99
## Benchmark TensorFlow models
1010

11-
This section benchmarks multiple TensorFlow models (ResNet50, MobileNetV2, and InceptionV3) using dummy input data. You'll measure average inference time and throughput for each model running on the CPU.
11+
This section benchmarks multiple TensorFlow models - ResNet50, MobileNetV2, and InceptionV3 - using dummy input data. You'll measure average inference time and throughput for each model running on the CPU of your Arm-based Google Cloud Platform (GCP) VM.
1212

13-
tf.keras is TensorFlow's high-level API for building, training, and benchmarking deep learning models. It provides access to predefined architectures such as ResNet, MobileNet, and Inception, making it easy to evaluate model performance on different hardware setups.
13+
TensorFlow Keras (`tf.keras`) is TensorFlow's high-level API for building, training, and benchmarking deep learning models. It provides access to predefined architectures such as ResNet, MobileNet, and Inception, making it easy to evaluate model performance on different hardware setups.
1414

15-
### Activate your virtual environment
15+
## Activate your virtual environment
1616

1717
Enable your isolated Python environment where TensorFlow is installed:
1818

@@ -23,17 +23,17 @@ python -c "import tensorflow as tf; print(tf.__version__)"
2323

2424
This ensures that all TensorFlow-related packages run in a clean, controlled setup without affecting system-wide Python installations.
2525

26-
### Install required packages
26+
## Install required packages
2727

2828
Install TensorFlow and NumPy for model creation and benchmarking:
2929

3030
```console
3131
pip install tensorflow==2.20.0 numpy
3232
```
3333

34-
These packages are likely already installed from the previous installation steps. NumPy supports efficient numerical operations, while TensorFlow handles deep learning workloads.
34+
These packages are likely already installed from previous steps. NumPy supports efficient numerical operations, while TensorFlow handles deep learning workloads.
3535

36-
### Create the benchmark script
36+
## Create the benchmark script
3737

3838
Use an editor to create a Python script named `tf_cpu_benchmark.py` that will run TensorFlow model benchmarking tests.
3939

@@ -74,7 +74,7 @@ for name, constructor in models.items():
7474

7575
This script creates model instances without pretrained weights for fair CPU testing, generates random image data for inference, includes a warm-up phase to stabilize model performance, and measures inference time over 50 runs to calculate average performance and throughput.
7676

77-
### Run the benchmark
77+
## Run the benchmark
7878

7979
Execute the benchmarking script:
8080

@@ -98,18 +98,20 @@ InceptionV3 average inference time per batch: 0.8971 seconds
9898
InceptionV3 throughput: 35.67 images/sec
9999
```
100100

101-
### Understand the results
101+
## Interpret the results
102102

103103
The benchmark provides key performance metrics. Average inference time per batch measures how long it takes to process one batch of input data, with lower values indicating faster performance. Throughput shows how many images the model can process per second, with higher values indicating better efficiency.
104104

105-
### Performance summary
105+
## Performance summary
106106

107-
The following table shows results from running the benchmark on a `c4a-standard-4` (4 vCPU, 16 GB memory) aarch64 VM in GCP using SUSE:
107+
The following table shows results from running the benchmark on a `c4a-standard-4` (4 vCPU, 16 GB memory) aarch64 VM in Google Cloud Platform (GCP) using SUSE Linux Enterprise Server (SLES):
108108

109109
| Model | Average Inference Time per Batch (seconds) | Throughput (images/sec) |
110110
|-------------|-------------------------------------------:|------------------------:|
111111
| ResNet50 | 1.2051 | 26.55 |
112112
| MobileNetV2 | 0.2909 | 110.02 |
113113
| InceptionV3 | 0.8971 | 35.67 |
114114

115-
The results demonstrate strong performance for lightweight CNNs like MobileNetV2, achieving over 110 images/sec on the aarch64 platform. Medium-depth models like InceptionV3 maintain balanced performance between accuracy and latency. Heavier architectures such as ResNet50 show longer inference times but deliver stable throughput, confirming that TensorFlow workloads run efficiently on Arm processors and provide a cost-effective alternative for AI inference tasks.
115+
The results show strong performance for lightweight CNNs like MobileNetV2, achieving over 110 images/sec on the aarch64 platform. Medium-depth models like InceptionV3 maintain balanced performance between accuracy and latency. Heavier architectures such as ResNet50 show longer inference times but deliver stable throughput.
116+
117+
You have successfully benchmarked TensorFlow models on your Arm-based VM. This demonstrates the efficiency and scalability of Arm platforms for deep learning workloads - great job!

content/learning-paths/servers-and-cloud-computing/tensorflow-gcp/installation.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Install TensorFlow
2+
title: Install TensorFlow
33
weight: 4
44

55
### FIXED, DO NOT MODIFY
@@ -8,11 +8,11 @@ layout: learningpathall
88

99
## Install TensorFlow on Google Axion C4A
1010

11-
TensorFlow is an open-source machine learning library developed by Google for building and deploying ML models efficiently. On aarch64 SUSE VMs, TensorFlow runs natively on CPU or GPU if available.
11+
TensorFlow is an open-source machine learning (ML) library developed by Google for building and deploying ML models efficiently. On 64-bit Arm architecture (aarch64) SUSE Linux Enterprise Server (SLES) VMs, TensorFlow runs natively on the CPU and can use the GPU if available.
1212

13-
### Update your system
13+
## Update your system
1414

15-
Update the system and install Python 3.11 with pip and virtual environment support:
15+
Update your system and install Python 3.11, pip, and virtual environment support:
1616

1717
```console
1818
sudo zypper refresh
@@ -21,13 +21,13 @@ sudo zypper install python311 python311-pip python311-venv
2121

2222
Enter "y" when prompted to confirm the installation. This ensures your system has the essential tools required for TensorFlow setup.
2323

24-
### Verify Python installation
24+
## Verify Python installation
2525

2626
Confirm that Python and pip are correctly installed:
2727

2828
```console
2929
python3.11 --version
30-
pip3 --version
30+
pip3.11 --version
3131
```
3232

3333
The output is similar to:
@@ -37,7 +37,7 @@ Python 3.11.10
3737
pip 22.3.1 from /usr/lib/python3.11/site-packages/pip (python 3.11)
3838
```
3939

40-
### Create a virtual environment
40+
## Create a virtual environment
4141

4242
Set up an isolated Python environment to keep TensorFlow dependencies separate from system packages:
4343

@@ -46,17 +46,18 @@ python3.11 -m venv tf-venv
4646
source tf-venv/bin/activate
4747
```
4848

49-
This creates and activates a virtual environment named `tf-venv` that prevents package conflicts.
49+
Your virtual environment `tf-venv` is now active and isolated from system packages.
5050

51-
### Upgrade pip
51+
## Upgrade pip
5252

5353
Upgrade pip to the latest version for reliable package installation:
5454

5555
```console
5656
pip3 install --upgrade pip
5757
```
5858

59-
### Install TensorFlow
59+
## Install TensorFlow
60+
6061
Install the latest stable TensorFlow version for Arm64:
6162

6263
```console
@@ -69,7 +70,7 @@ TensorFlow 2.18.0 introduced compatibility with NumPy 2.0, incorporating its upd
6970
The [Arm Ecosystem Dashboard](https://developer.arm.com/ecosystem-dashboard/) recommends TensorFlow version 2.18.0 as the minimum recommended version on Arm platforms.
7071
{{% /notice %}}
7172

72-
### Verify the installation
73+
## Verify the installation
7374

7475
Check that TensorFlow installed successfully and display the version:
7576

@@ -83,4 +84,4 @@ The output is similar to:
8384
2.20.0
8485
```
8586

86-
Your TensorFlow installation is now complete and ready for use.
87+
You have now installed TensorFlow on your Arm-based VM and are ready to start building and running machine learning models!

0 commit comments

Comments
 (0)