Skip to content

Commit 2374ceb

Browse files
Merge pull request #2152 from madeline-underwood/Arcee
Arcee_JA to sign off
2 parents 4e47544 + a3857d8 commit 2374ceb

10 files changed

Lines changed: 410 additions & 369 deletions
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: Overview
3+
weight: 2
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
## The AFM-4.5B model
10+
11+
AFM-4.5B is a 4.5-billion-parameter foundation model designed to balance accuracy, efficiency, and broad language coverage. Trained on nearly 7 trillion tokens of carefully filtered data, it performs well across a wide range of languages, including Arabic, English, French, German, Hindi, Italian, Korean, Mandarin, Portuguese, Russian, and Spanish.
12+
13+
In this Learning Path, you'll deploy AFM-4.5B using [Llama.cpp](https://github.com/ggerganov/llama.cpp) on an Arm-based AWS Graviton4 instance. You’ll walk through the full workflow, from setting up your environment and compiling the runtime, to downloading, quantizing, and running inference on the model. You'll also evaluate model quality using perplexity, a common metric for measuring how well a language model predicts text.
14+
15+
This hands-on guide helps developers build cost-efficient, high-performance LLM applications on modern Arm server infrastructure using open-source tools and real-world deployment practices.
16+
17+
### LLM deployment workflow on Arm Graviton4
18+
19+
- **Provision compute**: launch an EC2 instance using a Graviton4-based instance type (for example, `c8g.4xlarge`)
20+
21+
- **Set up your environment**: install the required build tools and dependencies (such as CMake, Python, and Git)
22+
23+
- **Build the inference engine**: clone the [Llama.cpp](https://github.com/ggerganov/llama.cpp) repository and compile the project for your Arm-based environment
24+
25+
- **Prepare the model**: download the **AFM-4.5B** model files from Hugging Face and use Llama.cpp's quantization tools to reduce model size and optimize performance
26+
27+
- **Run inference**: load the quantized model and run sample prompts using Llama.cpp.
28+
29+
- **Evaluate model quality**: calculate **perplexity** or use other metrics to assess model performance
30+
31+
{{< notice Note>}}
32+
You can reuse this deployment flow with other models supported by Llama.cpp by swapping out the model file and adjusting quantization settings.
33+
{{< /notice >}}
34+
35+
36+
37+
Lines changed: 68 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -1,171 +1,118 @@
11
---
2-
title: Launching a Graviton4 instance
3-
weight: 2
2+
title: Provision your Graviton4 environment
3+
weight: 3
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

99
## Requirements
1010

11-
- An AWS account
11+
Before you begin, make sure you have the following:
1212

13-
- Access to launch an EC2 instance of type `c8g.4xlarge` (or larger) with at least 128 GB of storage
13+
- An AWS account
14+
- Permission to launch a Graviton4 EC2 instance of type `c8g.4xlarge` (or larger)
15+
- At least 128 GB of available storage
1416

15-
For more information about creating an EC2 instance using AWS refer to [Getting Started with AWS](/learning-paths/servers-and-cloud-computing/csp/aws/).
17+
If you're new to EC2, check out the Learning Path [Getting Started with AWS](/learning-paths/servers-and-cloud-computing/csp/aws/).
1618

17-
## AWS Console Steps
19+
## Create an SSH key pair
1820

19-
Follow these steps to launch your EC2 instance using the AWS Management Console:
21+
To deploy the Arcee AFM-4.5B model, you need an EC2 instance running on Arm-based Graviton4 hardware.
2022

21-
### Step 1: Create an SSH Key Pair
23+
To do this, start by signing in to the [AWS Management Console](https://console.aws.amazon.com), then navigate to the **EC2** service.
2224

23-
1. **Navigate to EC2 Console**
25+
From there, you can create an SSH key pair that allows you to connect to your instance securely.
2426

25-
- Go to the [AWS Management Console](https://console.aws.amazon.com)
27+
## Set up secure access
2628

27-
- Search for "EC2" and click on "EC2" service
29+
Open the **Key Pairs** section under **Network & Security** in the sidebar, and create a new key pair named `arcee-graviton4-key`.
2830

29-
2. **Create Key Pair**
31+
Next, select **RSA** as the key type, and **.pem** as the file format. Once you create the key, your browser will download the `.pem` file automatically.
3032

31-
- In the left navigation pane, click "Key Pairs" under "Network & Security"
33+
To ensure the key remains secure and accessible, move the `.pem` file to your SSH configuration directory, and update its permissions to restrict access.
3234

33-
- Click "Create key pair"
35+
To do this, on macOS or Linux, run:
3436

35-
- Enter name: `arcee-graviton4-key`
37+
```bash
38+
mkdir -p ~/.ssh
39+
mv arcee-graviton4-key.pem ~/.ssh/
40+
chmod 400 ~/.ssh/arcee-graviton4-key.pem
41+
```
42+
internet
43+
## Launch and configure the EC2 instance
3644

37-
- Select "RSA" as the key pair type
45+
In the left sidebar of the EC2 dashboard, select **Instances**, and then **Launch instances**.
3846

39-
- Select ".pem" as the private key file format
47+
Use the following settings to configure your instance:
4048

41-
- Click "Create key pair"
49+
- **Name**: `Arcee-Graviton4-Instance`
50+
- **Application and OS image**:
51+
- Select the **Quick Start** tab
52+
- Select **Ubuntu Server 24.04 LTS (HVM), SSD Volume Type**
53+
- Ensure the architecture is set to **64-bit (ARM)**
54+
- **Instance type**: select `c8g.4xlarge` or larger
55+
- **Key pair name**: select `arcee-graviton4-key` from the list
4256

43-
- The private key file will automatically download to your computer
57+
## Configure network
4458

45-
3. **Secure the Key File**
59+
To enable internet access, choose a VPC with at least one public subnet.
4660

47-
- Move the downloaded `.pem` file to the SSH configuration directory
61+
Then select a public subnet from the list.
4862

49-
```bash
50-
mkdir -p ~/.ssh
51-
mv arcee-graviton4-key.pem ~/.ssh
52-
```
63+
Under **Auto-assign public IP**, select **Enable**.
5364

54-
- Set proper permissions on macOS or Linux:
65+
## Configure firewall
5566

56-
```bash
57-
chmod 400 ~/.ssh/arcee-graviton4-key.pem
58-
```
67+
Select **Create security group**. Then select **Allow SSH traffic from** and select **My IP**.
5968

60-
### Step 2: Launch EC2 Instance
69+
{{% notice Note %}}
70+
You'll only be able to connect to the instance from your current host, which is the most secure setting. Avoid selecting **Anywhere** unless absolutely necessary, as this setting allows anyone on the internet to attempt a connection.
6171

62-
1. **Start Instance Launch**
63-
64-
- In the left navigation pane, click "Instances" under "Instances"
65-
66-
- Click "Launch instances" button
67-
68-
2. **Configure Instance Details**
69-
70-
- **Name and tags**: Enter `Arcee-Graviton4-Instance` as the instance name
71-
72-
- **Application and OS Images**:
73-
- Click "Quick Start" tab
74-
75-
- Select "Ubuntu"
76-
77-
- Choose "Ubuntu Server 24.04 LTS (HVM), SSD Volume Type"
78-
79-
- **Important**: Ensure the architecture shows "64-bit (ARM)" for Graviton compatibility
80-
81-
- **Instance type**:
82-
- Click on "Select instance type"
83-
84-
- Select `c8g.4xlarge` or larger
85-
86-
3. **Configure Key Pair**
87-
88-
In "Key pair name", select the SSH keypair you created earlier (`Arcee-Graviton4-Instance`)
89-
90-
4. **Configure Network Settings**
91-
92-
- **Network**: Select a VPC with a least one public subnet.
93-
94-
- **Subnet**: Select a public subnet in the VPC
95-
96-
- **Auto-assign Public IP**: Enable
97-
98-
- **Firewall (security groups)**
99-
100-
- Click on "Create security group"
101-
102-
- Click on "Allow SSH traffic from"
103-
104-
- In the dropdown list, select "My IP".
105-
106-
107-
{{% notice Notes %}}
108-
You will only be able to connect to the instance from your current host, which is the safest setting. Selecting "Anywhere" allows anyone on the Internet to attempt to connect; use at your own risk.
109-
110-
Although this demonstration only requires SSH access, it is possible to use one of your existing security groups as long as it allows SSH traffic.
72+
You only need SSH access for this Learning Path. If you already have a security group that allows inbound SSH traffic, you can reuse it.
11173
{{% /notice %}}
11274

113-
5. **Configure Storage**
114-
115-
- **Root volume**:
116-
- Size: `128` GB
117-
118-
- Volume type: `gp3`
119-
120-
7. **Review and Launch**
121-
122-
- Review all settings in the "Summary" section
75+
## Configure storage
12376

124-
- Click "Launch instance"
77+
Set the **root volume size** to `128` GB, then select **gp3** as the volume type.
12578

126-
### Step 3: Monitor Instance Launch
79+
## Review and launch the instance
12780

128-
1. **View Launch Status**
81+
Review all your configuration settings, and when you're ready, select **Launch instance** to create your EC2 instance.
12982

130-
After a few seconds, you should see a message similar to this one:
83+
## Monitor the instance launch
13184

132-
`Successfully initiated launch of instance (i-<unique instance ID>)`
85+
After a few seconds, you should see a confirmation message like this:
13386

134-
If instance launch fails, please review your settings and try again.
87+
```
88+
Successfully initiated launch of instance (i-xxxxxxxxxxxxxxxxx)
89+
```
13590

136-
2. **Get Connection Information**
91+
If the launch fails, double-check the instance type, permissions, and network settings.
13792

138-
- Click on the instance id, or look for the instance in the Instances list in the EC2 console.
93+
To retrieve the connection details, go to the **Instances** list in the EC2 dashboard.
13994

140-
- In the "Details" tab of the instance, note the "Public DNS" host name
95+
Then select your instance by selecting **Instance ID**.
14196

142-
- This is the host name you'll use to connect via SSH, aka `PUBLIC_DNS_HOSTNAME`
97+
In the **Details** tab, copy the **Public DNS** value - youll use this to connect through SSH.
14398

144-
### Step 4: Connect to Your Instance
99+
## Connect to your instance
145100

146-
1. **Open Terminal/Command Prompt**
101+
Open a terminal and connect to the instance using the SSH key you downloaded earlier:
147102

148-
2. **Connect via SSH**
149-
```bash
150-
ssh -i ~/.ssh/arcee-graviton4-key.pem ubuntu@<PUBLIC_DNS_HOSTNAME>
151-
```
103+
```bash
104+
ssh -i ~/.ssh/arcee-graviton4-key.pem ubuntu@<PUBLIC_DNS_HOSTNAME>
105+
```
152106

153-
3. **Accept Security Warning**
107+
When prompted, type `yes` to confirm the connection.
154108

155-
- When prompted about authenticity of host, type `yes`
156-
157-
- You should now be connected to your Ubuntu instance
158-
159-
### Important Notes
160-
161-
- **Region Selection**: Ensure you're in your preferred AWS region before launching
162-
163-
- **AMI Selection**: The Ubuntu 24.04 LTS AMI must be ARM64 compatible for Graviton processors
164-
165-
- **Security**: Think twice about allowing SSH from anywhere (0.0.0.0/0). It is strongly recommended to restrict access to your IP address.
166-
167-
- **Storage**: The 128GB EBS volume is sufficient for the Arcee model and dependencies
168-
169-
- **Backup**: Consider creating AMIs or snapshots for backup purposes
109+
You should now be connected to your Ubuntu instance running on Graviton4.
170110

111+
{{% notice Note %}}
112+
**Region**: make sure you're launching in your preferred AWS region.
113+
**AMI**: confirm that the selected AMI supports the Arm64 architecture.
114+
**Security**: for best practice, restrict SSH access to your own IP.
115+
**Storage**: 128 GB is sufficient for the AFM-4.5B model and dependencies.
116+
**Backup**: consider creating an AMI or snapshot after setup is complete.
117+
{{% /notice %}}
171118

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,58 @@
11
---
2-
title: Setting up the instance
3-
weight: 3
2+
title: Configure your Graviton4 environment
3+
weight: 4
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9-
In this step, you'll set up the Graviton4 instance with all the necessary tools and dependencies required to build and run the Arcee Foundation Model. This includes installing the build tools and Python environment.
9+
In this step, you'll set up the Graviton4 instance with the tools and dependencies required to build and run the Arcee Foundation Model. This includes installing system packages and a Python environment.
1010

11-
## Step 1: Update Package List
11+
## Update the package list
12+
13+
Run the following command to update your local APT package index:
1214

1315
```bash
1416
sudo apt-get update
1517
```
1618

17-
This command updates the local package index from the repositories:
19+
This step ensures you have the most recent metadata about available packages, including versions and dependencies. It helps prevent conflicts when installing new packages.
1820

19-
- Downloads the latest package lists from all configured APT repositories
20-
- Ensures you have the most recent information about available packages and their versions
21-
- This is a best practice before installing new packages to avoid potential conflicts
22-
- The package index contains metadata about available packages, their dependencies, and version information
21+
## Install system dependencies
2322

24-
## Step 2: Install System Dependencies
23+
Install the build tools and Python environment:
2524

2625
```bash
2726
sudo apt-get install cmake gcc g++ git python3 python3-pip python3-virtualenv libcurl4-openssl-dev unzip -y
2827
```
2928

30-
This command installs all the essential development tools and dependencies:
29+
This command installs the following tools and dependencies:
30+
31+
- **CMake**: cross-platform build system generator used to compile and build Llama.cpp
32+
33+
- **GCC and G++**: GNU C and C++ compilers for compiling native code
34+
35+
- **Git**: version control system for cloning repositories
36+
37+
- **Python 3**: Python interpreter for running Python-based tools and scripts
38+
39+
- **Pip**: Python package manager
40+
41+
- **Virtualenv**: tool for creating isolated Python environments
42+
43+
- **libcurl4-openssl-dev**: development files for the curl HTTP library
3144

32-
- **cmake**: Cross-platform build system generator used to compile Llama.cpp
33-
- **gcc & g++**: GNU C and C++ compilers for building native code
34-
- **git**: Version control system for cloning repositories
35-
- **python3**: Python interpreter for running Python-based tools and scripts
36-
- **python3-pip**: Python package installer for managing Python dependencies
37-
- **python3-virtualenv**: Tool for creating isolated Python environments
38-
- **libcurl4-openssl-dev**: client-side URL transfer library
45+
- **Unzip**: tool to extract `.zip` files (used in some model downloads)
3946

40-
The `-y` flag automatically answers "yes" to prompts, making the installation non-interactive.
47+
The `-y` flag automatically approves the installation of all packages without prompting.
4148

42-
## What's Ready Now?
49+
## Ready for build and deployment
4350

44-
After completing these steps, your Graviton4 instance has:
51+
After completing the setup, your instance includes the following tools and environments:
4552

4653
- A complete C/C++ development environment for building Llama.cpp
47-
- Python 3 with pip for managing Python packages
54+
- Python 3, pip, and virtualenv for managing Python tools and environments
4855
- Git for cloning repositories
49-
- All necessary build tools for compiling optimized ARM64 binaries
56+
- All required dependencies for compiling optimized Arm64 binaries
5057

51-
The system is now prepared for the next steps: building Llama.cpp and downloading the Arcee Foundation Model.
58+
You're now ready to build Llama.cpp and download the Arcee Foundation Model.

0 commit comments

Comments
 (0)