-
Notifications
You must be signed in to change notification settings - Fork 0
Initial documentation #53
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
62c6532
Initial documentation
treigerm fda45de
Change copyright comment type
treigerm cfdd24b
Prepare plotting code for documentation
treigerm 2e4f4fc
Add docstrings
treigerm c12d098
Benchmark tutorial
treigerm 0a4ff48
Formatting fixes
treigerm 4d3bab9
More detail on JPEG2000 and ErrorBound
treigerm 5374a8d
Merge branch 'documentation' of github.com:ClimateBenchPress/compress…
treigerm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,23 @@ | ||
| # compressor | ||
| # ClimateBenchPress | ||
|
|
||
| This repository contains the main functionality for the ClimateBenchPress compression benchmark. | ||
|
|
||
| ## Getting Started | ||
|
|
||
| This project uses the uv package manager to handle dependencies. If you don't already have it installed follow the instructions at <https://docs.astral.sh/uv/getting-started/installation/>. | ||
|
|
||
| Next, clone this repository and within the project directory install all the necessary dependencies with: | ||
| ```bash | ||
| uv sync | ||
| uv pip install -e "." | ||
| ``` | ||
|
|
||
| ### Downloading the Data | ||
|
|
||
| Make sure you have all the necessary data downloaded by following the instructions at <https://github.com/ClimateBenchPress/data-loader>. | ||
|
|
||
| ## Funding | ||
|
|
||
| ClimateBenchPress has been developed as part of [Embed2Scale](https://embed2scale.eu/) and [ESiWACE3](https://www.esiwace.eu/). | ||
|
|
||
| Funded by the European Union. This work has received funding from the European High Performance Computing Joint Undertaking (JU) under grant agreement No 101093054 and EU’s Horizon Europe program under grant agreement number 101131841. This work also received funding from [UK Research and Innovation (UKRI)](https://www.ukri.org/). |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,27 @@ | ||
| # compressor | ||
| # ClimateBenchPress | ||
|
|
||
| This repository contains the main functionality for the ClimateBenchPress compression benchmark. | ||
|
|
||
| ## Getting Started | ||
|
|
||
| This project uses the uv package manager to handle dependencies. If you don't already have it installed follow the instructions at <https://docs.astral.sh/uv/getting-started/installation/>. | ||
|
|
||
| Next, clone this repository and within the project directory install all the necessary dependencies with: | ||
| ```bash | ||
| uv sync | ||
| uv pip install -e "." | ||
| ``` | ||
|
|
||
| ### Downloading the Data | ||
|
|
||
| Make sure you have all the necessary data downloaded by following the instructions at <https://github.com/ClimateBenchPress/data-loader>. | ||
|
|
||
| ## Using the Benchmark | ||
|
|
||
| Further details on how to run the benchmark evaluation code. | ||
|
|
||
| ## Funding | ||
|
|
||
| ClimateBenchPress has been developed as part of [Embed2Scale](https://embed2scale.eu/) and [ESiWACE3](https://www.esiwace.eu/). | ||
|
|
||
| Funded by the European Union. This work has received funding from the European High Performance Computing Joint Undertaking (JU) under grant agreement No 101093054 and EU’s Horizon Europe program under grant agreement number 101131841. This work also received funding from [UK Research and Innovation (UKRI)](https://www.ukri.org/). |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| # Evaluating the Benchmark Results | ||
|
|
||
| To evaluate the benchmark results, ensure you have data at `path/to/data-loader/datasets`, which should be downloaded using the [data loader](https://github.com/ClimateBenchPress/data-loader). | ||
|
|
||
| On a high-level the benchmark evaluation pipeline progresses in the following steps: | ||
|
|
||
| 1. Compute three error bound levels for each input dataset. | ||
| 2. Compress each input dataset with all the benchmark compressors for all three error bounds. | ||
| 3. Compute compressor performance metrics for evaluation purposes. | ||
| 4. Optional: Create summary plots of the benchmark results. | ||
|
|
||
| We will now go through each of these steps in more detail. As you work through these steps, the pipeline will progressively populate the directories `datasets-error-bounds`, `compressed-datasets`, `metrics`, and `plots`. | ||
|
|
||
| ## Create Error Bounds | ||
|
|
||
| Begin by creating the error bounds for each dataset using the following command: | ||
| ```bash | ||
| uv run python -m climatebenchpress.compressor.scripts.create_error_bounds \ | ||
| --data-loader-basepath=path/to/data-loader | ||
| ``` | ||
| This step creates three error bounds for each variable in the datasets and stores the information in the `datasets-error-bounds` directory. | ||
|
|
||
| ## Compress Input Datasets | ||
|
|
||
| Next, compress all the input datasets by running: | ||
| ```bash | ||
| uv run python -m climatebenchpress.compressor.scripts.compress \ | ||
| --data-loader-basepath=path/to/data-loader | ||
| ``` | ||
| This command will populate the `compressed-datasets` directory with the following structure: | ||
| ``` | ||
| compressed-datasets/ | ||
| dataset1/ | ||
| {var_name}-{err_bound_type}={low_err_bound_val}_{var_name2}-{err_bound_type2}={low_err_bound_val2} | ||
| compressor1/ | ||
| decompressed.zarr | ||
| measurements.json | ||
| compressor2/ | ||
| ... | ||
| {var_name}-{err_bound_type}={mid_err_bound_val}_{var_name2}-{err_bound_type2}={mid_err_bound_val2}/ | ||
| ... | ||
| {var_name}-{err_bound_type}={high_err_bound_val}_{var_name2}-{err_bound_type2}={high_err_bound_val2}/ | ||
| ... | ||
| dataset2/ | ||
| ... | ||
| ... | ||
| ``` | ||
| For each dataset, the results for the three different error bounds are stored in different directories. The `var_name` indicates the variable(s) in the dataset that are being compressed, while `err_bound_type` will be either `abs_error` or `rel_error`. | ||
|
|
||
| You can use additional arguments to control which compressors and datasets are processed: `--exclude-compressor` and `--exclude-dataset` to avoid using certain compressors and datasets, or `--include-compressor` and `--include-dataset` to only use selected compressors on selected datasets. | ||
| For example, the command | ||
| ```bash | ||
| uv run python -m climatebenchpress.compressor.scripts.compress \ | ||
| --data-loader-basepath=path/to/data-loader \ | ||
| --include-compressor sz3 jpeg2000 \ | ||
| --include-dataset era5 | ||
| ``` | ||
| compresses the era5 data with the compressors SZ3 and JPEG2000. | ||
| These arguments are particularly useful if you wish to parallelize the benchmark evaluation using tools such as `xargs`. | ||
|
|
||
| ## Compute Metrics | ||
|
|
||
| After compression, evaluate compression metrics on the compressed datasets using: | ||
| ```bash | ||
| uv run python -m climatebenchpress.compressor.scripts.compute_metrics \ | ||
| --data-loader-basepath=path/to/data-loader | ||
| ``` | ||
| You can apply the same filtering options with `--exclude-compressor`, `--exclude-dataset`, `--include-compressor` and `--include-dataset` arguments as used in the compression step. | ||
|
|
||
| Once the metrics are computed, combine all the metrics into a single CSV file by running: | ||
| ```bash | ||
| uv run python -m climatebenchpress.compressor.scripts.concatenate_metrics | ||
| ``` | ||
| This will create the `metrics/all_results.csv` file which contains all the results. | ||
|
|
||
| ## Optional: Create Plots | ||
|
|
||
| Finally, generate visualization plots with the following command: | ||
| ```bash | ||
| uv run python -m climatebenchpress.compressor.plotting.plot_metrics \ | ||
| --data-loader-basepath=path/to/data-loader | ||
| ``` | ||
| This will create plots in the `plots` directory. By default, this assumes access to a LaTeX compiler. If you do not have one on your system, you can add the `--avoid-latex` flag to this command. | ||
|
|
||
| Note that the full plotting process can take quite a lot of time because it generates individual plots for each error bound-compressor-dataset combination. If you want to avoid generating individual plots for certain datasets, you can do so with the `--exclude-dataset` command line option. |
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,8 @@ | |
|
|
||
|
|
||
| class Sperr(Compressor): | ||
| """SPERR compressor.""" | ||
|
|
||
| name = "sperr" | ||
| description = "SPERR" | ||
|
|
||
|
|
||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,8 @@ | |
|
|
||
|
|
||
| class Sz3(Compressor): | ||
| """SZ3 compressor.""" | ||
|
|
||
| name = "sz3" | ||
| description = "SZ3" | ||
|
|
||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,8 @@ | |
|
|
||
|
|
||
| class Tthresh(Compressor): | ||
| """Tthresh compressor.""" | ||
|
|
||
| name = "tthresh" | ||
| description = "tthresh" | ||
|
|
||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,8 @@ | |
|
|
||
|
|
||
| class Zfp(Compressor): | ||
| """ZFP compressor.""" | ||
|
|
||
| name = "zfp" | ||
| description = "ZFP" | ||
|
|
||
|
|
||
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file still missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ups yes, it's added now!