You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## 2024-05-19 - Caching YAML Load for Model Parsing
2
+
**Learning:**`yaml.safe_load` on large configuration files like `models.yml` is significantly slower than parsing JSON or doing other basic IO. It can become a bottleneck when called repeatedly throughout an application's lifecycle (e.g., getting subsets of models, instantiating apps).
3
+
**Action:** Always memoize or `@lru_cache` functions that load static, read-only configuration files (like `models.yml`) to prevent repeated disk I/O and parsing overhead.
4
+
5
+
## 2024-05-19 - Caching YAML Load for Framework Registry
6
+
**Learning:**`yaml.safe_load` on `frameworks.yml` within `load_framework_registry()` was taking ~2-3 ms per call and it was repeatedly called for every framework entry via `get_framework_config()`. This was a micro-bottleneck, especially when dealing with lists or multiple frameworks.
7
+
**Action:** Applied the `@lru_cache` and `deepcopy` pattern successfully again to `load_framework_registry()` and `get_framework_config()` to avoid caching a mutable dictionary directly and avoid repeated YAML I/O parsing.
A description of each subcommand, as well as valid options, can be listed using the
90
+
`--help` option. For example:
91
+
92
+
```shell
93
+
ml_peg calc --help
94
+
```
95
+
96
+
The `ml_peg list` command provides a further set of subcommands:
97
+
98
+
```shell
99
+
ml_peg list calcs
100
+
ml_peg list analysis
101
+
ml_peg list app
102
+
ml_peg list models
103
+
```
104
+
105
+
which list the available tests and categories that may be run for `ml_peg calc`,
106
+
`ml_peg analyse` and `ml_peg app`, and the MLIPs that these can be run for.
107
+
108
+
109
+
### Tutorials
110
+
111
+
We encourage developers new to the ML-PEG framework to work through the detailed
112
+
step-by-step guides provided by our Jupyter Notebook tutorials:
113
+
-[Adding a New Benchmark](docs/source/tutorials/python/adding_benchmark.ipynb)[](https://colab.research.google.com/github/ddmms/ml-peg/blob/main/docs/source/tutorials/python/adding_benchmark.ipynb)
114
+
115
+
69
116
## Docker/Podman images
70
117
71
118
You can use [Docker](https://www.docker.com) or [Podman](https://podman.io/) to build
0 commit comments