Draft
Conversation
…ysis, and reproducibility docs based on 2019_DCPT experimental data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
2019_DCPT Backend Engines (BE) Benchmark
Objective
This PR documents backend engine (BE) comparison for
IonTracks-Cythonon the2019_DCPT experimental data.The comparison focuses on:
Scope and benchmark setup
Benchmark target:
benchmark/2019_DCPT/Compared backends:
pythoncythonnumbaBenchmark metadata (
benchmark/2019_DCPT/benchmark_results/metadata_20251210_003508.json):success,efficiency_failed,failedExperimental reference data (used for BE comparison)
The benchmark is evaluated against the experimental dataset now available under:
benchmark/2019_DCPT/experimental-data-200V/recombination_200V_data.csvDataset summary:
k_sSupporting context is included in:
benchmark/2019_DCPT/experimental-data-200V/README.mdWhere benchmark outputs are stored
Main benchmark outputs are in:
benchmark/2019_DCPT/benchmark_results/summary_all_runs_20251210_003508.csvbenchmark/2019_DCPT/benchmark_results/statistics_summary_20251210_003508.csvbenchmark/2019_DCPT/benchmark_results/plots/benchmark/2019_DCPT/benchmark_results/cython/run_001 ... run_010/benchmark/2019_DCPT/benchmark_results/numba/run_001 ... run_010/benchmark/2019_DCPT/benchmark_results/python/run_001 ... run_010/Each successful
cython/numbarun contains:comparison_initial.csvcomparison_continuous.csvcomparison_continuous_clean.csvinitial_recombination_comparison.pngcontinuous_beam_comparison.pngrelative_error.pngrun_log.txtpythonruns store logs only (run_log.txt) due to efficiency failures.BE comparison results
1) Performance (execution time)
Average runtime over 10 runs:
numba: 404.58 s (std 7.80 s, min 394.73 s, max 420.40 s)cython: 1155.34 s (std 38.46 s, min 1093.96 s, max 1208.29 s)python: 6953.67 s (10/10efficiency_failed, max 47830.96 s)Outlier-aware view:
pythonwithout the 47,830.96 s outlier: 2411.75 s mean (n=9)Relative speed:
numbavscython: 2.86x fasternumbavspython: 17.19x faster (with outlier)cythonvspython: 6.02x faster (with outlier)numbais still 5.96x faster thanpython2) Accuracy - initial recombination
For
cythonandnumba, results are effectively identical:Interpretation: no meaningful BE-level difference for initial recombination on this case.
3) Accuracy - continuous beam
Mean relative error across runs:
cython: 0.05997% (std 0.00298 pp)numba: 0.09935% (std 0.00433 pp)Observed maxima in runs:
cython: typically ~0.10-0.12%numba: typically ~0.18-0.20%Accuracy delta (
cythonadvantage):numba: ~39.6%4) Stability
numba: very stable runtime distribution (low variance).cython: moderate runtime variance, all runs successful.python: fails the efficiency criterion in all runs.Efficiency criterion used for
pythonin this benchmark:cython, runtime ofnumba),efficiency_failed.Interpretation for backend choice
numba.cython.pythonis not suitable for this benchmark profile under the current efficiency constraint.pythonshould be considered not recommended in all cases (performance and efficiency are consistently inferior to both accelerated backends).In short, this benchmark shows a clear BE trade-off:
numba= best speedcython= best continuous-beam accuracyHow to reproduce the benchmark inputs/results
A short reproduction note is included here:
benchmark/2019_DCPT/experimental-data-200V/how_to_reproduce_results.mdUse that guide to regenerate the comparison artifacts (
comparison_*.csv, plots, relative error chart) from the experimental data configuration.Primary scripts for rerunning BE benchmark/plots:
benchmark/2019_DCPT/run_benchmark.pybenchmark/2019_DCPT/plot_benchmark_results.pyPowerShell example:
Note: if you reproduce from custom config files, make sure the experimental data path points to the current benchmark-local dataset (
benchmark/2019_DCPT/experimental-data-200V/...).