Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GSoC 2024 | Benchmark | First objective | Israel Roldan #2565

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
edb0e8f
Added the development environment to make easy the test of the changes.
airvzxf Mar 15, 2024
65ae093
Improved the ASV framework; Added benchmarks taking the unit tests.
airvzxf Mar 28, 2024
d930c08
Added the script for the run the ASV benchmarks by tag release in Git.
airvzxf Mar 29, 2024
bdb9f0a
Added my conact information in the mail map.
airvzxf Mar 29, 2024
8e60056
Merge branch 'tardis-sn:master' into gsoc-benchmark-first-objective-iarv
airvzxf Apr 1, 2024
25c5dfd
Removed the Docker files.
Apr 2, 2024
d2ef722
Merge branch 'tardis-sn:master' into gsoc-benchmark-first-objective-iarv
airvzxf Apr 18, 2024
bbbee26
Updated the release script which runs the benchmarks.
airvzxf Apr 18, 2024
b1eb517
Updated the runtime timeout for the benchmarks.
airvzxf Apr 18, 2024
44287de
Updated the function get relative paths for benchmarks.
airvzxf Apr 19, 2024
945d86c
Added comments for the deprecated function 'delim_whitespace'.
airvzxf Apr 19, 2024
ab98e61
Fixed the usage of the regression data class.
airvzxf Apr 19, 2024
3aa02eb
Added proposal to divide the main functionality of the Benchmark Base…
airvzxf Apr 19, 2024
9b9d968
Update the benchmark for Gamma Ray.
airvzxf Apr 20, 2024
67a73c9
Renamed the class name for NLTE in benchmarks.
airvzxf Apr 20, 2024
3642a13
Merge branch 'tardis-sn:master' into gsoc-benchmark-first-objective-iarv
airvzxf Apr 20, 2024
abe3b0d
Applied the 'black' formatter to main_gamma_ray_loop.
airvzxf Apr 22, 2024
5ff452d
Revert "Applied the 'black' formatter to main_gamma_ray_loop."
airvzxf Apr 22, 2024
dca5a85
Added documentation for the benchmarks.
airvzxf Apr 30, 2024
9b91bf3
Merge branch 'master' into gsoc-benchmark-first-objective-iarv
airvzxf Apr 30, 2024
6021a76
Fixed the format error warning by black.
airvzxf Apr 30, 2024
558d57c
Fixed again the format error warning by black.
airvzxf Apr 30, 2024
5d364e8
Merge branch 'tardis-sn:master' into gsoc-benchmark-first-objective-iarv
airvzxf May 6, 2024
c32a7bf
Deleted all benchmarks except montecarlo numba and tardis;
airvzxf May 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ __pycache__
*/cython_version.py
htmlcov
.coverage
coverage.xml
andrewfullard marked this conversation as resolved.
Show resolved Hide resolved
MANIFEST
.ipynb_checkpoints

Expand Down Expand Up @@ -77,3 +78,11 @@ pip-wheel-metadata/

# Random files
.hypothesis/unicode_data/11.0.0/charmap.json.gz

# Data files
benchmarks/data/*.h5

# ASV
.asv/
pkgs/
release_hashes.txt
4 changes: 4 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,7 @@ Kim Lingemann <[email protected]> kimsina <[email protected]>
Kim Lingemann <[email protected]> kim <[email protected]>

Sumit Gupta <[email protected]>

Israel Roldan <[email protected]> Israel Roldan <[email protected]>
Israel Roldan <[email protected]> AirvZxf <[email protected]>
Israel Roldan <[email protected]> airv_zxf <[email protected]>
2 changes: 1 addition & 1 deletion asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"branches": ["master"],
"environment_type": "mamba",
"show_commit_url": "https://github.com/tardis-sn/tardis/commit",
"show_commit_url": "https://github.com/tardis-sn/tardis/commit/",
"conda_environment_file": "tardis_env3.yml",
"benchmark_dir": "benchmarks",
"env_dir": ".asv/env",
Expand Down
99 changes: 99 additions & 0 deletions benchmarks/asv_by_release.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
#!/usr/bin/env bash

RELEASE_LIST=$(git tag -l "release-202[34]*" | sort -r)

readarray -t RELEASE_TAGS <<<"${RELEASE_LIST[@]}"
RELEASE_HASHES=()
for release_tag in "${RELEASE_TAGS[@]}"; do
echo "Tag: ${release_tag}"
HASH_COMMIT=$(git show-ref -s "${release_tag}")
RELEASE_HASHES+=("${HASH_COMMIT}")
done
echo "RELEASE_HASHES: ${#RELEASE_HASHES[*]}"

ASV_CONFIG_PATH="/app/asv"
cd "${ASV_CONFIG_PATH}" || exit

rm -f release_hashes.txt
touch release_hashes.txt
for release_hash in "${RELEASE_HASHES[@]}"; do
echo "${release_hash}" >>release_hashes.txt
done

function show_timed_time {
local time=${1}
local milliseconds="${time: -3}"
local seconds=$((time / 1000))
local minutes=0
local minutes_display=""
local hours=0
local hours_display=""
local days=0
local days_display=""

if [[ "${seconds}" -gt 59 ]]; then
minutes=$((seconds / 60))
seconds=$((seconds % 60))
minutes_display="${minutes}m "
fi

if [[ "${minutes}" -gt 59 ]]; then
hours=$((minutes / 60))
minutes=$((minutes % 60))
minutes_display="${minutes}m "
hours_display="${hours}h "
fi

if [[ "${hours}" -gt 23 ]]; then
days=$((hours / 24))
hours=$((hours % 24))
hours_display="${hours}h "
days_display="${days}d "
fi

echo "${days_display}${hours_display}${minutes_display}${seconds}.${milliseconds}s"
}

start=$(date +%s%N | cut -b1-13)

# ASV has an argument called “bench”, which filters the benchmarks.
# I had two problems with ASV regarding benchmark filtering.
# 1. If we want to run only the `time_read_stella_model` benchmark.
# ASV will run 3 benchmarks using this argument
# `--bench time_read_stella_model`:
# - `time_read_stella_model`.
# - `time_read_stella_model_meta`.
# - `time_read_stella_model_data`.
# It is because the ASV uses regular expressions to match the name.
# To run only the benchmark `time_read_stella_model` we need to run:
# - `--bench "time_read_stella_model$"`
# - The `$` means that it matches the end of a string without
# consuming any characters.
# Note:
# - If the benchmark doesn't have parameters (`@parameterize`),
# then the name in ASV is the benchmark name without parameters.
# 2. The second problem is when I want to search for some benchmark that
# has parameters (`@parameterize`) because the name of the benchmark
# includes parenthesis and the parameters and their values.
# One example is `time_get_inverse_doppler_factor` which has 3 benchmarks
# with this prefix, and has parameters.
# To prevent it, we need to add the argument with this syntax:
# `--bench time_benchmark_name([^_A-Za-z]|$)`
# The regular expression match with all the parameters generated by ASV.
#time asv run \
# --bench "time_read_stella_model$"
# --bench "time_get_inverse_doppler_factor([^_A-Za-z]|$)" \
# --bench "time_get_inverse_doppler_factor_full_relativity([^_A-Za-z]|$)" \
# release-2023.01.11..master

# This command runs all benchmarks for all commits that have not been run.
time asv run \
--skip-existing-commits \
ALL

end=$(date +%s%N | cut -b1-13)
runtime=$((end - start))
display_time="$(show_timed_time ${runtime})"
echo ""
echo "Time: ${display_time}"
echo ""
Loading
Loading