Skip to content

Commit c4c16fa

Browse files
authored
Make plotting script work without running the banchmarks first (#916)
This way the benchmark can be run e.g. from a bash script of manually first, calling the plotting script in a second step (the plotting has a lot of dependencies and may not work everywhere). This mainly changes how the files to be plotted are registered in the python tool and that some additional data needs to be added to the benchmarks context. This will be used to e.g. distinguish the different algebra plugins and to set the plot labels correctly. Also removed the 'interleave' option again, as that makes mostly sense for microbenchmarks and would need an additional sorting step to work correctly
1 parent 961900c commit c4c16fa

File tree

5 files changed

+192
-119
lines changed

5 files changed

+192
-119
lines changed

README.md

+4-11
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
Detray is part of the [ACTS project](https://github.com/acts-project/acts) (R&D line for parallelization).
88

9-
This is a C++20 header-only library providing a GPU-friendly tracking detector description using different [linear algebra](https://github.com/acts-project/algebra-plugins) libraries. It follows the navigation and propagation concept of ACTS, implementing a geometry using a flat memory layout and no abstract interfaces (virtual functions). A detray detector can therefore be constructed on the host and copied to an accelerator device in a straight-forward way.
9+
This is a modern, C++20 header-only library providing a GPU-friendly tracking detector description using different [linear algebra](https://github.com/acts-project/algebra-plugins) libraries. It follows the navigation and propagation concept of ACTS, implementing a geometry using a flat memory layout and no abstract interfaces (virtual functions). A detray detector can therefore be constructed on the host and copied to an accelerator device in a straight-forward way.
1010

1111
With the geometry description comes a fully featured, GPU-ready track state propagation implementation in inhomogeneous magnetic fields (vector field description using [covfie](https://github.com/acts-project/covfie)), with track parameter covariance transport including material interactions.
1212

@@ -125,24 +125,17 @@ detray-build/bin/detray_propagation_benchmark_<backend>_<algebra> \
125125
--grid_file ./toy_detector/toy_detector_surface_grids.json \
126126
--material_file ./toy_detector/toy_detector_homogeneous_material.json \
127127
--sort_tracks --randomize_charge --eta_range -3 3 --pT_range 0.5 100 \
128-
--search_window 3 3 --covariance_transport
128+
--search_window 3 3 --covariance_transport --bknd_name [HW_BACKEND_NAME]
129129
```
130130
For every algebra-plugin that was built, a corresponding benchmark executable will be present. The CPU-backend benchmark is built by default and the CUDA-backend benchmark will be available if detray was built with CUDA enabled (`-DDETRAY_BUILD_CUDA=ON`). This executable can additionally be configured with any arguments targeted at [google benchmark](https://github.com/google/benchmark/blob/main/docs/user_guide.md).
131131

132-
If the data is dumped into json files using the options `--benchmark_out_format=json` and `--benchmark_out=<detector_name>_benchmark_data_<backend>_<algebra>.json`, it can afterwards be plotted with e.g.:
132+
If the data is dumped into json files using the options `--benchmark_repetitions=N` (N standing for the number of repitions), `--benchmark_display_aggregates_only=true`, as well as `--benchmark_out_format=json` and `--benchmark_out=<some_file_name>.json`, it can afterwards be plotted with e.g.:
133133
```shell
134134
python3 detray/tests/tools/python/propagation_benchmarks.py \
135135
--geometry_file ./toy_detector/toy_detector_geometry.json \
136-
--algebra_plugins array eigen \
137-
--cuda \
138-
--data_files ./toy_detector_benchmark_data_cpu_array.json \
139-
./toy_detector_benchmark_data_cpu_eigen.json \
140-
./toy_detector_benchmark_data_cuda_array.json \
141-
./toy_detector_benchmark_data_cuda_eigen.json
136+
--data_files [FILES]...
142137
```
143138

144-
using the *std::array* and [*Eigen3*](https://eigen.tuxfamily.org) based linear algebra plugins with CUDA backend as an example.
145-
146139
### Continuous benchmark
147140

148141
Monitoring the propagation throughput with the toy geometry per commit:

tests/tools/python/impl/plot_benchmark_results.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
def read_benchmark_data(logging, input_path, benchmark_file):
3939

40-
file_path = input_path + benchmark_file
40+
file_path = os.path.join(input_path, benchmark_file)
4141
with open(file_path, "r") as file:
4242
logging.debug(f"Reading file '{file_path}'")
4343

0 commit comments

Comments
 (0)