Tutorials

In this tutorial, you will find introductions to several machine learning projects across high energy physics, multi-messenger astrophysics, and systems neuroscience, along with corresponding hands-on exercises and demonstrations. These tutorials are designed for newcomers to each project and also assist trainees who want to broaden their perspectives and draw inspiration from other projects.

Some of these tutorials have been presented at recent conferences and workshops. Additionally, we plan to update this page with more tutorials in the future. Please contact the authors of the tutorials or the A3D3 outreach and education committee leader Dr. Matthew J. Graham if you have any questions or would like to share your feedback. Please contact the author of the tutorial page Dr. Yao Yao for updating the page.

HLS4ML

In this tutorial, you will get familiar with the hls4ml library. This library converts pre-trained Machine Learning models into FPGA firmware, targeting extreme low-latency inference to stay within the strict constraints imposed by the CERN particle detectors. You will learn techniques for model compression, including how to reduce the footprint of your model using state-of-the-art techniques such as quantization. Finally, you will learn how to synthesize your model for implementation on the chip. Familiarity with Machine Learning using Python and Keras is beneficial for participating in this tutorial but not required.
https://github.com/fastmachinelearning/hls4ml-tutorial
A previous zoom recording of a live tutorial section is available at Snowmass CSS 2022:
https://indico.cern.ch/event/1176254/

ML4GW/HERMES

Real-time gravitational wave astronomy stands to benefit substantially from the adoption of machine learning algorithms, which have demonstrated an ability to model complex signals, even in the presence of considerable noise, with minimal run-time latency and compute requirements. Moreover, many gravitational wave event morphologies and noise sources are well understood and easily simulated, acting as physical priors which can be exploited to regularize training to produce more robust models. However, adoption of production ML systems in this setting has been impeded by a lack of software tools simplifying the development of experimental and deployment pipelines that leverage these priors in a computationally efficient manner. In this demo, we’ll introduce ml4gw and hermes, two libraries for accelerating training and inference of models in the context of gravitational waves, and show how they can be combined with other infrastructure tools to build, evaluate, and deploy a competitive model for detecting binary black hole mergers in real LIGO gravitational strain data.
https://github.com/alecgunny/adass-2023-ml4gw-demo/tree/main

A previous zoom recording of a live tutorial section is available at ADASS 2023:
https://adass2023.lpl.arizona.edu/events/focus-demo-f401

Using GPUs for distributed training

This tutorial will give an overview of using pytorch lightning for building and training neural networks. A simple problem in inference: measuring the parameters of a line will be presented. The tutorial will also introduce distributed training with pytorch lightning.
https://github.com/deepchatterjeeligo/iap-2024/tree/main

This tutorial is part of the Workshop on Basic Computing Services in the Physics Department – subMIT. The workshop has other helpful tutorials, including batch job and workflow management, software management, etc.
https://indico.mit.edu/event/956/

SONIC

SONIC is the short name for Service for Optimized Network Inference on Co-processors. It is based on inference as a service. Instead of the usual case where the co-processors (GPUs, FPGAs, ASICs) are directly connected to the CPUs, as-a-Service connects the CPUs and co-processors via networks. With as-a-Service computing, clients only need to communicate with the server and handle the IOs, and the servers will direct the co-processors for computing. In the CMS Software (CMSSW), we set up the SONIC workflow to run inference as a service. The clients are deployed in CMSSW to handle the IOs; an Nvidia Triton inference server is chosen to run inferences for Machine-Learning models (and also classical domain algorithms).

This tutorial is intended to provide you with some basic familiarity with SONIC and Machine learning inference as a Service. Some examples for models, producers, and configs are discussed.
https://yongbinfeng.gitbook.io/sonictutorial/

ScaleHLS-HIDA

High-Level Synthesis (HLS) is vital for rapidly developing efficient, high-density hardware accelerators, enabling quick evaluation of different algorithmic choices. The challenge lies in effectively exploring the vast design space of large-scale HLS accelerators, which can lead to sub-optimal solutions if not done well, undermining the productivity benefits of HLS. This tutorial will introduce ScaleHLS-HIDA, a MLIR- based open-source HLS framework, which can compile HLS C/C++ or PyTorch model to optimized HLS C/C++ in order to generate high-efficiency RTL designs using downstream tools, such as Vitis HLS. Despite being fully automated and able to handle various applications, ScaleHLS-HIDA achieves a 1.29x higher throughput over a state-of-the-art RTL-based neural network accelerator on FPGAs. This tutorial aims to enable attendees to use the ScaleHLS-HIDA tool and participate in its development.
Here are the introduction slides https://hanchenye.com/assets/pdf/FPGA24_Tutorial_Slides.pdf and hands-on tutorials can be accessed: https://github.com/UIUC-ChenLab/ScaleHLS-HIDA.

Tracking as-a-Service

Tracking algorithms in high energy physics can be accelerated by coprocessors such as GPUs. This tutorial deploys tracking algorithms in an as-a-service (aaS) approach using the Nvidia Triton inference server. The merits of heterogeneous computing are discussed—the most straightforward way to deploy algorithms where the CPU and GPU both are connected on a single node. The tutorial provides a brief demo on deploying GNN-tracking aaS. This was followed by a hands-on tutorial deploying the resnet50 image recognition deep neural network as-a-service on computing resources at CERN. The tutorial material focused on building the proper model repository structure and configuration for image detection on a GPU server. Students set-up a work environment, deployed a backend on the server, and sent an image to the server to be classified.

Tutorial: https://hrzhao76.github.io/AthenaTriton/intro.html

Future tutorials