Skip to content

Commit d74f790

Browse files
authored
Add getting started document for analysis notebook (llm-d#259)
Signed-off-by: Nick Masluk <nick@randombytes.net>
1 parent 2d1e5cb commit d74f790

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

analysis/README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# llm-d-benchmark Analysis
2+
3+
## Jupyter Analysis Notebook
4+
5+
Data analysis can be performed using the [Jupyter](https://docs.jupyter.org/en/latest/) notebook [analysis.ipynb](analysis.ipynb) using Jupyter Lab, an interactive development environment. This notebook is written in Python, and will import all benchmark report files found within a provided list of directories and populate a [Pandas](https://pandas.pydata.org/) DataFrame. You may then execute pre-built plotting functions, modify these functions, or add your own custom analysis.
6+
7+
### Creating a Python virtual environment
8+
9+
To get started, you must first have a Python ≥3.12 environment installed. If you are running Mac or Linux you likely already satisfy this requirement. For Windows you may download a Python distribution like [Anaconda](https://www.anaconda.com/download).
10+
11+
Next you will need to create a virtual environment, where we will install the requisite Python packages for analysis.
12+
13+
- [Create a new Python 3 virtual environment.](https://docs.python.org/3/library/venv.html) \
14+
Linux/Mac:
15+
```bash
16+
python -m venv /path/to/new/virtual/environment
17+
```
18+
Windows:
19+
```powershell
20+
PS> python -m venv C:\path\to\new\virtual\environment
21+
```
22+
- Activate the virtual environment \
23+
Linux/Mac:
24+
```bash
25+
source <venv_path>/bin/activate
26+
```
27+
Windows:
28+
```
29+
C:\> <venv_path>\Scripts\activate.bat
30+
```
31+
- Install packages from [../build/requirements-analysis.txt](../build/requirements-analysis.txt) \
32+
```bash
33+
pip install -r build/requirements-analysis.txt
34+
```
35+
- Install Jupyter Lab
36+
```bash
37+
pip install jupyterlab
38+
```
39+
40+
### Running `analysis.ipynb`
41+
42+
After activating the virtual environment, launch Jupyter Lab, optionally adding the path to `analysis.ipynb` as an argument to open it immediately.
43+
```bash
44+
jupyter lab analysis.ipynb
45+
```
46+
47+
This should open Jupyter Lab in your web browser. With the analysis notebook open, click to select the first cell, then press `Shift + Enter` to execute the cell. Any printouts or error messages will be shown immediately after the cell.
48+

build/requirements-analysis.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
matplotlib>=3.7.0
22
numpy>=2.3.1
33
seaborn>=0.12.0
4-
pandas
4+
pandas>=2.2.3
55
pydantic>=2.11.7
66
PyYAML>=6.0.2
77
scipy>=1.16.0

0 commit comments

Comments
 (0)