2
2
Scripts to handle running, testing, and benchmarking code generated by LLMs.
3
3
The drivers are split up by language.
4
4
5
+ ## Setup
6
+
7
+ The C++ drivers need some object files to be built before running. This can
8
+ be done by running the following lines.
9
+
10
+ ``` sh
11
+ cd cpp
12
+ make
13
+ ```
14
+
5
15
## Running the prompts
6
16
Given a prompt and output data set in ` generated-outputs.json ` you can run each
7
17
of the generated outputs using the below command.
8
18
9
- ``` bash
19
+ ``` sh
10
20
python run-all.py generated-outputs.json
11
21
12
- # usage: run-all.py [-h] [-o OUTPUT] [--scratch-dir SCRATCH_DIR] [--launch-configs LAUNCH_CONFIGS] [--yes-to-all] [--dry] [--overwrite]
13
- # [--exclude-models {serial,omp,mpi} [{serial,omp,mpi} ...] | --include-models {serial,omp,mpi} [{serial,omp,mpi} ...]]
14
- # [--log {INFO,DEBUG,WARNING,ERROR,CRITICAL}]
22
+ # usage: run-all.py [-h] [-o OUTPUT] [--scratch-dir SCRATCH_DIR] [--launch-configs LAUNCH_CONFIGS] [--problem-sizes PROBLEM_SIZES] [--yes-to-all]
23
+ # [--dry] [--overwrite] [--hide-progress]
24
+ # [--exclude-models {serial,omp,mpi,mpi+omp,kokkos,cuda,hip} [{serial,omp,mpi,mpi+omp,kokkos,cuda,hip} ...] | --include-models
25
+ # {serial,omp,mpi,mpi+omp,kokkos,cuda,hip} [{serial,omp,mpi,mpi+omp,kokkos,cuda,hip} ...]]
26
+ # [--problem PROBLEM | --problem-type PROBLEM_TYPE] [--early-exit-runs] [--build-timeout BUILD_TIMEOUT] [--run-timeout RUN_TIMEOUT]
27
+ # [--log {INFO,DEBUG,WARNING,ERROR,CRITICAL}] [--log-build-errors] [--log-runs]
15
28
# input_json
16
29
#
17
30
# Run all the generated code.
@@ -27,50 +40,61 @@ python run-all.py generated-outputs.json
27
40
# If provided, put scratch files here.
28
41
# --launch-configs LAUNCH_CONFIGS
29
42
# config for how to run samples.
43
+ # --problem-sizes PROBLEM_SIZES
44
+ # config for how to run samples.
30
45
# --yes-to-all If provided, automatically answer yes to all prompts.
31
46
# --dry Dry run. Do not actually run the code snippets.
32
47
# --overwrite If ouputs are already in DB for a given prompt, then overwrite them. Default behavior is to skip existing results.
33
- # --exclude-models {serial,omp,mpi} [{serial,omp,mpi} ...]
48
+ # --hide-progress If provided, do not show progress bar.
49
+ # --exclude-models {serial,omp,mpi,mpi+omp,kokkos,cuda,hip} [{serial,omp,mpi,mpi+omp,kokkos,cuda,hip} ...]
34
50
# Exclude the given parallelism models from testing.
35
- # --include-models {serial,omp,mpi} [{serial,omp,mpi} ...]
51
+ # --include-models {serial,omp,mpi,mpi+omp,kokkos,cuda,hip } [{serial,omp,mpi,mpi+omp,kokkos,cuda,hip } ...]
36
52
# Only test the given parallelism models.
53
+ # --problem PROBLEM Only test this probem if provided.
54
+ # --problem-type PROBLEM_TYPE
55
+ # Only test problems of this type if provided.
56
+ # --early-exit-runs If provided, stop evaluating a model output after the first run configuration fails.
57
+ # --build-timeout BUILD_TIMEOUT
58
+ # Timeout in seconds for building a program.
59
+ # --run-timeout RUN_TIMEOUT
60
+ # Timeout in seconds for running a program.
37
61
# --log {INFO,DEBUG,WARNING,ERROR,CRITICAL}
38
62
# logging level
63
+ # --log-build-errors On build error, display the stderr of the build process.
64
+ # --log-runs Display the stderr and stdout of runs.
39
65
```
40
66
41
- Depending on the parallel models being tested this will require a newer C++
42
- compiler and MPI being loaded.
43
-
44
- ### Running on Zaratan
45
- To run the drivers on Zaratan you needc the following modules (or similar).
46
-
47
- ``` bash
48
- ml gcc/11.3.0 openmpi/gcc/11.3.0 python
49
- ```
67
+ The launch configurations (node counts and launch commands) are defined in a
68
+ json file passed to ` --launch-configs ` . The default should work on any system
69
+ with the slurm workload manager. Depending on the parallel models being tested
70
+ you may require a newer C++ compiler and MPI being loaded.
50
71
51
- Additionally, the default ` /tmp ` scratch space for building and running is
52
- node-local on Zaratan, so you need to pass ` --scratch-dir ` as some root
53
- directory on the _ scratch _ or _ home _ filesystem, since these are accessible
54
- from all compute nodes and on the network.
72
+ It is likely you will need to split up the runs between execution models (there
73
+ are not many machines that have both NVIDIA and AMD GPUs on them). The
74
+ ` --include-models ` and ` --exclude-models ` options allow you to only run subsets
75
+ of prompts.
55
76
56
- To prevent _ cuda library not found errors_ with MPI you should run
57
- ` export OMPI_MCA_opal_warn_on_missing_libcuda=0 ` before running the drivers.
77
+ Additionally, the script uses ` /tmp ` for building and running the generated code.
78
+ On many machines ` /tmp ` is node-local, which will cause the MPI jobs to fail.
79
+ To solve this you can set ` --scratch-dir ` to point to a scratch directory
80
+ on a shared file system.
58
81
59
82
## Organization of Drivers
60
- Within ` drivers/ ` there are subdirectories for each programming language.
61
- In this subdirectory is a ` *_driver_wrapper.py ` file that handles running
62
- code for that language.
63
- This wrapper further uses functionality from drivers in ` models/ ` and
64
- ` benchmarks/ ` in the language subdirectory.
65
- These define behavior for running each programming model and benchmark.
83
+ Within ` drivers/ ` there are subdirectories for each programming language. In
84
+ this subdirectory is a ` *_driver_wrapper.py ` file that handles running code for
85
+ that language. This wrapper further uses functionality from drivers in ` models/ `
86
+ and ` benchmarks/ ` in the language subdirectory. These define behavior for
87
+ running each programming model and benchmark.
66
88
67
89
### Notes on Drivers
68
- The benchmark drivers (in ` benchmarks/ ` ) follow the nameing convention
69
- ` <test-name>-<model>-driver.<ext> ` . Likewise, the model drivers in ` models/ `
70
- follow the naming convention ` <model>-driver.<ext> ` . The test name is the name
71
- used in the prompts data set. The model is one of the parallel backend models
72
- available. These are used as keys in the code so this naming convention and
73
- spelling needs to be followed.
90
+ The benchmark drivers (in ` benchmarks/ ` ) follow the naming convention
91
+ ` <problem-type>/<problem-name>/<model>.<ext> ` . Likewise, the model drivers in
92
+ ` models/ ` follow the naming convention ` <model>-driver.<ext> ` . The test name is
93
+ the name used in the prompts data set. The model is one of the parallel backend
94
+ models available. These are used as keys in the code so this naming convention
95
+ and spelling needs to be followed. The ` /models ` subdirectory has the ` main `
96
+ function for each execution model. The actual testing code for each of the
97
+ prompts is in the ` benchmarks/ ` subdirectory.
74
98
75
99
Make sure to run ` make ` in the corresponding subdirectories for models that need
76
100
to be compiled. For example in ` cpp/ ` run ` make ` to build the driver binaries.
0 commit comments