Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Production update #1267

Merged
merged 36 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
dcd95d2
LP on Serverless Framework showing how to deploy a static website to …
dawidborycki Aug 29, 2024
7a24aa0
Refreshed MySQL Tuning Learning Path
jsrz Sep 12, 2024
49510a8
automatic update of stats files
Sep 16, 2024
abdf573
Adapted command line to the latest changes
KeilChris Sep 16, 2024
f5a6a0b
Update _index.md
pareenaverma Sep 16, 2024
272ae01
Update objective.md
pareenaverma Sep 16, 2024
9c5046e
Update configuration.md
pareenaverma Sep 16, 2024
a28a811
Update configuration.md
pareenaverma Sep 16, 2024
923c5c7
Update website.md
pareenaverma Sep 16, 2024
5125fba
Update deployment.md
pareenaverma Sep 16, 2024
31b5613
Update _index.md
pareenaverma Sep 16, 2024
e862f2c
Merge pull request #1199 from dawidborycki/LP-Serverless-AWS-S3
pareenaverma Sep 16, 2024
de08c1a
Merge pull request #1255 from KeilChris/fix_for_issue_1245
jasonrandrews Sep 16, 2024
bbac229
Update pytorch-llama.md
pareenaverma Sep 16, 2024
acea1a7
spelling updates
jasonrandrews Sep 17, 2024
0bed590
Merge pull request #1257 from jasonrandrews/spelling
jasonrandrews Sep 17, 2024
6636450
Init version
dawidborycki Sep 18, 2024
d37551d
Merge pull request #1244 from jsrz/mysql_tuning_update
jasonrandrews Sep 18, 2024
da19144
review MySQL Tuning Learning Path
jasonrandrews Sep 18, 2024
e60f5eb
Merge pull request #1260 from jasonrandrews/review
jasonrandrews Sep 18, 2024
fcbf311
Merge pull request #1256 from pareenaverma/content_review
jasonrandrews Sep 18, 2024
101a888
First pass editorial of earlier files
madeline-underwood Sep 18, 2024
fbfd3bd
Editorial review
madeline-underwood Sep 18, 2024
f3477f1
Fix ACfL curl installer URL
LukeIreland1 Sep 19, 2024
083d8b9
add simd.info to resources
jasonrandrews Sep 19, 2024
763d6e8
add simd.info to resources
jasonrandrews Sep 19, 2024
2acad99
Merge pull request #1263 from jasonrandrews/review
jasonrandrews Sep 19, 2024
bf43b0a
Merge pull request #1262 from LukeIreland1/fix-acfl-installer-url
jasonrandrews Sep 19, 2024
108be23
Merge pull request #1259 from dawidborycki/LP-PyTorch-Intro
jasonrandrews Sep 20, 2024
d4ab748
first review of MNIST PyTorch Learning Path
jasonrandrews Sep 20, 2024
3a2d8f6
Merge pull request #1264 from jasonrandrews/review
jasonrandrews Sep 20, 2024
d6ad2f0
Update _index.md
madeline-underwood Sep 20, 2024
fe1ed5d
Merge pull request #1261 from madeline-underwood/Serverless_framework
jasonrandrews Sep 20, 2024
d5d1136
update spelling and tagging
jasonrandrews Sep 20, 2024
6c4413e
update broken links
jasonrandrews Sep 20, 2024
5a9f552
Merge pull request #1266 from jasonrandrews/spelling
jasonrandrews Sep 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 74 additions & 1 deletion .wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3114,4 +3114,77 @@ ifunc
ifuncs
lm
memcpy
multiversioning
multiversioning
AwsServerlessDynamoDbLambdaS
BLASes
BVH
Bindless
Calvo
Chowdary
CloudFormation
GDC
GLSL
Helpbox
Lista
LttE
Malhotra
Mandepudi
Nikhil
OPLTK
Rasterization
Ravi
Refractions
Rohr
RunsOn
SSR
Streamlit
TLASes
TorchAO
Torchchat
Vulkan's
Vulkanised
WebsiteBucket
aaaa
barycentric
bindless
bonza
calvo
chatbot's
createResponse
denoising
getAverageTemperatureButton
getAverageTemperatureUrl
jJyHzkWXEfY
lista
param
prismjs
quicktool
rasterization
rasterized
refractions
renderer
skybox
specular
ssr
streamlit
stylesheet
torchchat
tps
uQ
vulkan
vulkanised
writeTemperaturesUrl
IPython
NeuralNetwork
Sigmoid
Softmax
Tanh
backpropagation
diskio
feedforward
logits
prem
softmax
subclassing
tanh
torchsummary
2 changes: 1 addition & 1 deletion content/install-guides/acfl.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ You are now ready to install ACfL [manually](#manual) or with [Spack](#spack).
Use an Arm recommended script to select, download, and install your preferred `ACfL` package.

```console
bash <(curl -L https://developer.arm.com/-/media/Files/downloads/hpc/arm-compiler-for-linux/install.sh)
bash <(curl -L https://developer.arm.com/-/cdn-downloads/permalink/Arm-Compiler-for-Linux/Package/install.sh)
```

## Download and install manually {#manual}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ further_reading:
title: Eigen official Tutorial on Matrix class
link: https://libeigen.gitlab.io/docs/group__TutorialMatrixClass.html
type: documentation
- resource:
title: CS Tutorial on Eigen
link: https://cs2240.graphics/assignments/eigen_tutorial.pdf
type: documentation
- resource:
title: Eigen Webinar from Linaro
link: https://static.linaro.org/connect/webinars/presentations/Eigen_Webinar_3.pdf
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: Create a PyTorch model for digit classification
draft: true
cascade:
draft: true

minutes_to_complete: 40

who_is_this_for: This is an introductory topic for software developers interested in learning how to use PyTorch to create a feedforward neural network for digit classification.

learning_objectives:
- Prepare a PyTorch development environment.
- Understand the MNIST digit dataset.
- Create a neural network architecture using PyTorch.

prerequisites:
- Any computer which can run Python3 and Visual Studio Code, this can be Windows, Linux, or macOS.

author_primary: Dawid Borycki

### Tags
skilllevels: Introductory
subjects: ML
armips:
- Cortex-A
- Cortex-X
- Neoverse
operatingsystems:
- Windows
- Linux
- macOS
tools_software_languages:
- Android Studio
- Coding
shared_path: true
shared_between:
- servers-and-cloud-computing
- laptops-and-desktops
- smartphones-and-mobile

### FIXED, DO NOT MODIFY
# ================================================================================
weight: 1 # _index.md always has weight of 1 to order correctly
layout: "learningpathall" # All files under learning paths have this same wrapper
learning_path_main_page: "yes" # This should be surfaced when looking for related content. Only set for _index.md of learning path content.
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
# ================================================================================
# Edit
# ================================================================================

next_step_guidance: >
Proceed to Get Started with Arm Performance Studio for mobile to continue learning about Android performance analysis.

# 1-3 sentence recommendation outlining how the reader can generally keep learning about these topics, and a specific explanation of why the next step is being recommended.

recommended_path: "/learning-paths/smartphones-and-mobile/ams/"

# Link to the next learning path being recommended(For example this could be /learning-paths/servers-and-cloud-computing/mongodb).


# further_reading links to references related to this path. Can be:
# Manuals for a tool / software mentioned (type: documentation)
# Blog about related topics (type: blog)
# General online references (type: website)

further_reading:
- resource:
title: PyTorch
link: https://pytorch.org
type: documentation
- resource:
title: MNIST
link: https://en.wikipedia.org/wiki/MNIST_database
type: website
- resource:
title: Visual Studio Code
link: https://code.visualstudio.com
type: website



# ================================================================================
# FIXED, DO NOT MODIFY
# ================================================================================
weight: 21 # set to always be larger than the content in this path, and one more than 'review'
title: "Next Steps" # Always the same
layout: "learningpathall" # All files under learning paths have this same wrapper
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
# ================================================================================
# Edit
# ================================================================================

# Always 3 questions. Should try to test the reader's knowledge, and reinforce the key points you want them to remember.
# question: A one sentence question
# answers: The correct answers (from 2-4 answer options only). Should be surrounded by quotes.
# correct_answer: An integer indicating what answer is correct (index starts from 0)
# explanation: A short (1-3 sentence) explanation of why the correct answer is correct. Can add additional context if desired


review:
- questions:
question: >
Does the input layer of the model flatten the 28x28 pixel image into a 1D array of 784 elements?
answers:
- "Yes"
- "No"
correct_answer: 1
explanation: >
Yes, the model uses nn.Flatten() to reshape the 28x28 pixel image into a 1D array of 784 elements for processing by the fully connected layers.
- questions:
question: >
Does the model use dropout layers with a 20% dropout rate after each hidden layer?
answers:
- "Yes"
- "No"
correct_answer: 1
explanation: >
Yes, the model applies dropout layers after each hidden layer, randomly setting 20% of the neurons to 0 during training to prevent overfitting.
- questions:
question: >
Will the model make random predictions if it’s run before training?
answers:
- "Yes"
- "No"
correct_answer: 1
explanation: >
Yes, however in such the case the model will produce random outputs, as the network has not been trained to recognize any patterns from the data.

# ================================================================================
# FIXED, DO NOT MODIFY
# ================================================================================
title: "Review" # Always the same title
weight: 20 # Set to always be larger than the content in this path
layout: "learningpathall" # All files under learning paths have this same wrapper
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
---
# User change
title: "Prepare a PyTorch development environment"

weight: 2

layout: "learningpathall"
---

## Background

PyTorch is an open-source deep learning framework developed by Meta AI and now part of the Linux Foundation.

It is designed to provide a flexible and efficient platform for building and training neural networks. It is widely used due to its dynamic computational graph, which allows users to modify the architecture during runtime, making debugging and experimentation easier.

The major motivation for introducing PyTorch was to provide a more flexible, user-friendly deep learning framework that addressed the limitations of static computational graphs found in earlier tools like TensorFlow.

Prior to PyTorch, many frameworks used static computation graphs that required the entire model structure to be defined before training, making experimentation and debugging more cumbersome. PyTorch introduced dynamic computational graphs (also known as “define-by-run”), which allow the graph to be constructed on the fly as operations are executed. This flexibility significantly improved ease of use for researchers and developers, enabling faster prototyping, easier debugging, and more intuitive code.


Additionally, PyTorch was designed to have seamless integration with Python, encouraging a more native coding experience. Its deep integration with GPU acceleration also made it a powerful tool for both research and production environments. This combination of flexibility, usability, and performance contributed to PyTorch’s rapid adoption, especially in academic research, where experimentation and iteration are crucial.

A typical process for creating a feedforward neural network in PyTorch involves defining a sequential stack of fully connected layers (also known as linear layers). Each layer transforms the input by applying a set of weights and biases, followed by an activation function like ReLU. PyTorch supports this process using the torch.nn module, where layers are easily defined and composed.

To create a model, users subclass the torch.nn.Module class, defining the network architecture in the __init__ method, and implement the forward pass in the forward method. PyTorch’s intuitive API and strong support for GPU acceleration make it ideal for building efficient feedforward networks, particularly in tasks like image classification and digit recognition.

In this Learning Path, you will explore how to use PyTorch for creating a model for digit recognition.

## Before you begin

Before you begin make sure Python3 is installed on your system. You can check by running:

```console
python3 --version
```

The expected output is the Python version, for example:

```output
Python 3.11.2
```

If Python3 is not installed, download and install it from [python.org](https://www.python.org/downloads/).

Alternatively, you can also install Python3 using package managers such as Brew or APT.

If you are using Windows on Arm you can refer to the [Python install guide](https://learn.arm.com/install-guides/py-woa/).

Next, download and install [Visual Studio Code](https://code.visualstudio.com/download).

## Install PyTorch and additional Python packages

To prepare a virtual Python environment, install PyTorch, and the additional tools you will need for this Learning Path:

1. Open a terminal or command prompt and navigate to your project directory.

2. Create a virtual environment by running:

```console
python -m venv pytorch-env
```

This will create a virtual environment named pytorch-env.

3. Activate the virtual environment:

* On Windows:
```console
pytorch-env\Scripts\activate
```

* On macOS or Linux:
```console
source pytorch-env/bin/activate
```

Once activated, you should see the virtual environment name in your terminal prompt.

3. Install PyTorch using `pip`:

```console
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
```

4. Install torchsummary, Jupyter and IPython Kernel:

```console
pip install torchsummary
pip install jupyter
pip install ipykernel
```

5. Register your virtual environment as a new kernel:

```console
python3 -m ipykernel install --user --name=pytorch-env
```

6. Install the Jupyter Extension in VS Code:

* Open VS Code and go to the Extensions view (click on the Extensions icon or press Ctrl+Shift+X).

* Search for “Jupyter” and install the official Jupyter extension.

* Optionally, also install the Python extension if you haven’t already, as it improves Python language support in VS Code.

To ensure everything is set up correctly:

1. Open Visual Studio Code.
2. Click New file, and select `Jupyter Notebook .ipynb Support`.
3. Save the file as `pytorch-digits.ipynb`.
4. Select the Python kernel you created earlier (pytorch-env). To do so, click Kernels in the top right corner. Then, click Jupyter Kernel..., and you will see the Python kernel as shown below:

![img1](Figures/01.png)

5. In your Jupyter notebook, run the following code to verify PyTorch is working correctly:

```console
import torch
print(torch.__version__)
```

It will look as follows:
![img2](Figures/02.png)

With your development environment created you can proceed to creating a PyTorch model.
Loading
Loading