We’ve published a small update to Lab 5 that simplifies some of the testing tooling, makes the default builds faster, and simplifies the baseline comparison and make benchmark output. If you’ve already started the lab, please run the following command in your checkout to update it in-place:

curl -fsSL https://cs152.org/assets/lab5-update.py | python3

If you haven’t started yet, you’ll get the updates by default.

Introduction and Goals

The goal of this lab is to explore performance engineering on AWS Graviton. You will optimize a Canny edge-detection program that turns a grayscale image into a line drawing. The program removes noise, finds edges, connects them into paths, and simplifies those paths into line segments.

In the directed portion, you will reduce repeated work in Gaussian blur and measure the effect on the program’s running time. In the open-ended portion, you will use profiling to choose and evaluate your own optimizations. Your instance has four Graviton3 cores; the open-ended portion allows vector instructions and multiple threads.

Getting Started

Complete the setup to connect to your instance and build the program, then begin the directed portion. Its introduction covers the code and the lab rules before you make changes. Finish the directed work before moving on to the open-ended portion.

The Program Guide illustrates the pipeline stages and explains the program’s arguments. Refer to it as needed. The resources include instructions for profiling and measurement, machine specifications, and optimization references.

Graded Items

See the course calendar for the deadline. The directed portion is submitted on Gradescope; the open-ended portion is submitted by pushing to your student GitHub repository.

  • Directed portion: answers to the graded questions, your blur source diff, correctness checks, and before-and-after timings.
  • Open-ended portion: source changes and a report explaining your optimizations and results. Complete this portion individually.

You may also enter the optional competition for prizes. It carries no additional course credit and must be completed individually. Winning submissions require an oral exam.

Acknowledgements

This lab was developed for CS 152 by Safin Singh. Yan Zhu developed the AWS infrastructure and setup documentation, and Ryan Lee integrated the lab into the course website and revised the specifications and crib sheet.

Jonathan Ji wrote the Performance Engineering Reader. Annie Zhang and Sam Bai wrote the original c7g.xlarge Crib Sheet and APerf guide. Anish Shrestha, Boru Chen, Jonathan Ji, and the rest of the CS 152 Fall ‘26 course staff contributed testing and feedback.

The prizes are graciously sponsored by Annapurna Labs, the creators of the Graviton SoC.


Table of contents