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

v1.3.0 - Into the multi-GPU-niverse #616

Merged
merged 429 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
429 commits
Select commit Hold shift + click to select a range
67e7c3f
Updating the path to test-data in the test suite and redirecting work…
pcagas Jun 7, 2024
032b21b
Merge branch 'develop' into test-improvement
pcagas Jun 7, 2024
a1faeba
Merge pull request #540 from franzpoeschel/fix-parallel-flushing
RandomDefaultUser Jun 7, 2024
e967711
Merge pull request #517 from pcagas/test-improvement
RandomDefaultUser Jun 7, 2024
6c2d438
Fix CI installation of openPMD-api
franzpoeschel Jun 6, 2024
35a4a8f
Adapt further dependencies
franzpoeschel Jun 7, 2024
b60fdd1
Fix typo
franzpoeschel Jun 7, 2024
9923992
Use RODARE api instead of hard coded URL:
DanielKotik Jun 10, 2024
849ff7d
Avoid necessity to rename top level directory:
DanielKotik Jun 10, 2024
e4a410d
This fixes Node.js 16 deprecation warning:
DanielKotik Jun 10, 2024
8e71856
Merge pull request #543 from DanielKotik/update-actions-in-cpu-tests
DanielKotik Jun 10, 2024
c3383a6
Merge pull request #542 from DanielKotik/ci-test-data-download
DanielKotik Jun 11, 2024
68fead8
Remove caches after pushes to develop/master (+tags)
DanielKotik Jun 11, 2024
940fd21
Update cleanup-caches.yml
DanielKotik Jun 11, 2024
4b32470
Merge pull request #544 from DanielKotik/update-cleanup-cache
DanielKotik Jun 11, 2024
789f909
Also added the forces for good measure
RandomDefaultUser Jun 11, 2024
979bab5
Enhance diff output of Conda environments:
DanielKotik Jun 12, 2024
6224824
Fix a typo and rename files for a better understanding
DanielKotik Jun 12, 2024
22ff604
Merge pull request #547 from DanielKotik/update-cpu-test-workflow
DanielKotik Jun 12, 2024
29348ee
be less specific about openpmd-api version
franzpoeschel Jun 7, 2024
2bf4933
Enforce installation of openPMD via pip
DanielKotik Jun 12, 2024
dd37531
Merge pull request #541 from franzpoeschel/fix-ci-installation-of-ope…
DanielKotik Jun 12, 2024
031fab3
Use legacy builder to build Docker image:
DanielKotik Jun 13, 2024
8434b8b
Merge pull request #548 from DanielKotik/temp-fix-docker-build
DanielKotik Jun 13, 2024
4ea9adc
Update mirror-to-casus.yml:
DanielKotik Jun 13, 2024
d59a57f
Merge pull request #549 from DanielKotik/update-mirror-to-casus-workflow
DanielKotik Jun 13, 2024
c4c587f
doc: link to GPU usage docs from lammps install section
elcorto Jun 20, 2024
bf10ea0
doc: QE install: fix typos, add cmake note
elcorto Jun 21, 2024
340db25
Merge pull request #552 from elcorto/feature-doc-lammps-gpu
elcorto Jun 26, 2024
01e46be
Be explicit about the fetch depth
DanielKotik Jun 29, 2024
b579fbf
Calculate short commit SHA via parameter expansion:
DanielKotik Jul 3, 2024
20a9176
Suppress verbose output from docker pull/load
DanielKotik Jul 3, 2024
b64fb14
Suppress detailed layer status while pushing images:
DanielKotik Jul 3, 2024
92eb513
Refactor a bit
DanielKotik Jul 3, 2024
bf14f35
Merge pull request #557 from DanielKotik/improve-ci
DanielKotik Jul 3, 2024
4ba5dbe
Condition-based display of Conda environment diffs:
DanielKotik Jul 4, 2024
0fed9cc
Merge pull request #558 from DanielKotik/improve-ci
DanielKotik Jul 4, 2024
4139713
Unified error calculation
Jun 24, 2024
ba660fe
Got rid of superfluous print statement
RandomDefaultUser Jul 17, 2024
4a3f56d
Fix error saving
Jul 22, 2024
a9925b2
Updated .gitignore
Jul 22, 2024
049d51d
Fix UnboundLocal error
Jul 22, 2024
c86a799
2D calculations not segfaulting, but some term still missing
RandomDefaultUser Jul 25, 2024
9aec118
Merge branch 'refs/heads/more_qe_readout' into TEM_2D
RandomDefaultUser Jul 25, 2024
5c960e6
Fixed Ewald energy for 2D case
RandomDefaultUser Jul 25, 2024
44fd34a
Merge branch 'develop' into uniform_error_calculation
RandomDefaultUser Jul 26, 2024
f392ee7
Miniscule error in docstring
RandomDefaultUser Jul 26, 2024
c3489e7
Unifed timing calls
RandomDefaultUser Jul 29, 2024
43c7b31
predictor: remove wrong module doc string
elcorto Apr 21, 2024
da0ce13
predictor: remove some code duplications (#508)
elcorto Apr 21, 2024
8b24c09
predictor: format remaining code
elcorto Apr 22, 2024
31e0e5f
predictor: simplify code (use slice)
elcorto Apr 23, 2024
3de8619
predictor: add Tensor type check
elcorto Apr 23, 2024
d087714
Add module doc string in predictor
elcorto Jul 29, 2024
7604252
Merge pull request #3 from mala-project/develop
timcallow Jul 31, 2024
6c65fc1
First implementation with tempfile package, WIP
timcallow Jul 31, 2024
93e1d16
Add setup_lammps_tmp_files which fixes mpi issue
timcallow Aug 1, 2024
6ff7d58
Update gaussian and minterpy to use new tempfile workflow
timcallow Aug 1, 2024
85f9a24
Allow for arbitrary grid points (WIP)
timcallow Aug 2, 2024
a078a87
pre-commit: don't fix python version
elcorto Jul 29, 2024
82881e2
fix errors
timcallow Aug 14, 2024
0c627ec
First pass at ldos alignment method
timcallow Aug 15, 2024
5239d4c
Added tqdm
Aug 21, 2024
515c165
Remove energy calculations with DFT fermi energy
Aug 21, 2024
7b093b5
Fixed exceptions and added missing band_energy_actual_fe calculation
Aug 21, 2024
29fab9a
Remove unused fe_dft
Aug 21, 2024
24f9f62
Get energy targets and predictions
Aug 21, 2024
51e0bd9
fix mse search and make other improvements
timcallow Aug 21, 2024
5249cb6
Improve writing of ldos shift info
timcallow Aug 22, 2024
1d812f6
Normalize zero tolerance and add n_shift_mse for better alignment
timcallow Aug 26, 2024
202e6ec
Add and fix docstrings
timcallow Aug 27, 2024
8b7cd3a
Add parallelization
timcallow Aug 28, 2024
31da07e
Replace manual ldos grid params with MALA parameters
timcallow Aug 28, 2024
5c945e9
allow for homogenous grid dimensions
timcallow Sep 4, 2024
a7bcc5a
Add ldos alignment example
timcallow Sep 4, 2024
873c795
Merge pull request #563 from timcallow/lammps_tempfile
RandomDefaultUser Oct 7, 2024
d56e2d1
Merge pull request #560 from mala-project/uniform_error_calculation
RandomDefaultUser Oct 7, 2024
f30f085
Merge pull request #569 from elcorto/feature-rm-python-version-in-pre…
RandomDefaultUser Oct 7, 2024
96e983d
Merge pull request #570 from timcallow/flexible_snapshot_number
RandomDefaultUser Oct 7, 2024
7be0287
Rename LDOSAlign to LDOSAligner
timcallow Oct 7, 2024
7a36d31
Merge pull request #574 from timcallow/ldos_align
RandomDefaultUser Oct 7, 2024
28c7ceb
Renamed all scipy calls from simps to simpson and trpz to trapezoid
RandomDefaultUser Oct 7, 2024
d8ae8ad
Made path naming consistent.
RandomDefaultUser Oct 7, 2024
99f42b7
Updated test data repo
RandomDefaultUser Oct 7, 2024
c2c2b2d
Forgot to rename parameter in trainer class
RandomDefaultUser Oct 7, 2024
3fe785b
Forgot to rename a block in runner.py
RandomDefaultUser Oct 7, 2024
b6e6437
Formatting
RandomDefaultUser Oct 7, 2024
e64fc2f
Merge pull request #579 from RandomDefaultUser/fix_scipy_deprecation
RandomDefaultUser Oct 7, 2024
f058456
Automatically added during training metric
RandomDefaultUser Oct 7, 2024
89c43ba
Merge pull request #580 from RandomDefaultUser/fix_during_training_me…
RandomDefaultUser Oct 7, 2024
0bd1ab5
Merge pull request #581 from RandomDefaultUser/inference_timings
RandomDefaultUser Oct 8, 2024
6e7bc44
Automatically added during training metric
RandomDefaultUser Oct 8, 2024
6eabf91
Rewrote docs
RandomDefaultUser Oct 9, 2024
4323274
Make from_numpy_file useable for DOS
RandomDefaultUser Oct 9, 2024
ff0ea2f
Merge pull request #583 from RandomDefaultUser/dos_from_numpy_file
RandomDefaultUser Oct 9, 2024
c316795
Validation every N steps, tensorboard logging bugfix
Oct 10, 2024
032feb7
Validation every N steps, tensorboard logging bugfix
Oct 10, 2024
e062deb
Merge pull request #584 from mala-project/validate_every_n_epochs
RandomDefaultUser Oct 14, 2024
8c78a62
Remove random type check in Predictor
elcorto Oct 18, 2024
e8ba079
Fix linter complaint in Predictor
elcorto Oct 18, 2024
1a637c0
Added missing docstring
RandomDefaultUser Oct 18, 2024
49ed05f
Merge pull request #562 from elcorto/feature-improve-predictor
RandomDefaultUser Oct 18, 2024
28ed972
Fixed warning
RandomDefaultUser Oct 18, 2024
2fa204d
Modified doc string
RandomDefaultUser Oct 18, 2024
b1dc51d
Fix ParametersNetwork doc strings (#589)
elcorto Oct 18, 2024
c810067
Merge pull request #582 from RandomDefaultUser/document_gaussian_desc…
RandomDefaultUser Oct 21, 2024
8e87783
Merge pull request #588 from RandomDefaultUser/rename_ase_calculator_…
RandomDefaultUser Oct 21, 2024
47ab001
Merge pull request #590 from elcorto/feature-fix-docstrings
RandomDefaultUser Oct 21, 2024
bca924c
Merge branch 'refs/heads/develop_lenz' into TEM_2D
RandomDefaultUser Oct 21, 2024
92dd561
Change default units for read_from_cube functions
timcallow Oct 23, 2024
055b5aa
Print warning statement if wrong units requested
timcallow Oct 23, 2024
e668799
Fixed docstring
RandomDefaultUser Oct 23, 2024
2de6782
Working on a fix for the OpenPMD interface
RandomDefaultUser Oct 23, 2024
6d6df8a
Writing seems to work, reading not yet
RandomDefaultUser Oct 24, 2024
d9eb104
Fixed OpenPMD interface
RandomDefaultUser Oct 24, 2024
e5a51fa
Now actually fixed the interface
RandomDefaultUser Oct 24, 2024
217e785
Merge pull request #546 from RandomDefaultUser/more_qe_readout
RandomDefaultUser Oct 24, 2024
ac557a3
Merge branch 'refs/heads/develop_lenz' into TEM_2D
RandomDefaultUser Oct 24, 2024
768daea
Added documentation
RandomDefaultUser Oct 24, 2024
7f52d06
Merge pull request #561 from RandomDefaultUser/TEM_2D
RandomDefaultUser Oct 24, 2024
063c01d
Fix for input units None and incorrect units for density
timcallow Oct 24, 2024
b0f9820
Add coverage to the tests
timcallow Oct 25, 2024
7defc18
Add pytest-cov to dockerfile
timcallow Oct 25, 2024
7c95e6b
Merge pull request #591 from timcallow/ldos_default_units
RandomDefaultUser Oct 25, 2024
3cb77e6
Add missing -m tag
timcallow Oct 25, 2024
15beaa3
add fail-under to coverage
timcallow Oct 25, 2024
0f3ea55
Basic predictor works, but we ASE calculator not yet
RandomDefaultUser Oct 25, 2024
db86eb9
Fixed parallel case and ASE
RandomDefaultUser Oct 25, 2024
33e319b
Merge pull request #594 from timcallow/test_coverage
RandomDefaultUser Oct 25, 2024
fd221a6
Merge pull request #595 from RandomDefaultUser/temp_file_qe
RandomDefaultUser Oct 25, 2024
c090317
This should work with the new pydocstyle
RandomDefaultUser Oct 25, 2024
4c21990
Merge pull request #596 from RandomDefaultUser/fix_pydocstyle_update
RandomDefaultUser Oct 25, 2024
1c222ab
Renamed "normal" to "minmax" and fixed docstrings.
RandomDefaultUser Oct 25, 2024
4312c07
Made DataScaler API consistent with sklearn
RandomDefaultUser Oct 25, 2024
f31f9b9
Made interface more consistent with sklearn
RandomDefaultUser Oct 25, 2024
dc6a8ff
Also made partial_fit consistent with the sklearn, but have to test t…
RandomDefaultUser Oct 25, 2024
3713e6e
Removed creation of files that were never used or deleted
RandomDefaultUser Oct 28, 2024
890efa2
Corrected ".to" statement for DDP case
RandomDefaultUser Oct 28, 2024
cb47e22
Merge pull request #600 from RandomDefaultUser/fix_qe_tempfile
RandomDefaultUser Oct 28, 2024
19ffa6a
Resetting the voxel to None is necessary in a shuffled/unshuffled laz…
RandomDefaultUser Oct 28, 2024
27dec15
Merge pull request #601 from RandomDefaultUser/fix_openpmd_lazyloading
RandomDefaultUser Oct 29, 2024
043a716
Merge remote-tracking branch 'refs/remotes/fork_lenz/develop' into fi…
RandomDefaultUser Oct 29, 2024
30768ee
Fixed docs
RandomDefaultUser Oct 29, 2024
1881d10
Corrected one line only to have the second one be incorrect too
RandomDefaultUser Oct 29, 2024
b3d117e
Merge pull request #602 from RandomDefaultUser/fix_ddp_training
RandomDefaultUser Oct 30, 2024
398555d
Merge remote-tracking branch 'refs/remotes/fork_lenz/develop' into qu…
RandomDefaultUser Oct 30, 2024
87edede
All functional code by Bartosz Brzoza, I just put it in to class comp…
RandomDefaultUser Oct 30, 2024
fbf811d
Fixed Mutual Information formula
Nov 11, 2024
0751c49
Blackified the MI class
RandomDefaultUser Nov 11, 2024
31a816b
Trying out different normalizer
RandomDefaultUser Nov 11, 2024
51d38be
Going back to component wise normalize
RandomDefaultUser Nov 11, 2024
a62cd00
Deleted unnecessary decorator I added
RandomDefaultUser Nov 12, 2024
7263abb
Adapt batch size in case of GPU graphs
RandomDefaultUser Nov 14, 2024
56ec97a
Deleted all instances of "SNAP" from MALA, as it will be deprecated s…
RandomDefaultUser Nov 14, 2024
db6ecbd
Merge pull request #603 from RandomDefaultUser/fix_train_graphs
RandomDefaultUser Nov 14, 2024
5765b48
Update mala/datahandling/data_scaler.py
RandomDefaultUser Nov 14, 2024
1ddd3c7
Update mala/datahandling/data_scaler.py
RandomDefaultUser Nov 14, 2024
5466623
Merge pull request #604 from RandomDefaultUser/deprecate_snap
RandomDefaultUser Nov 14, 2024
c0f80ff
Fixed dimensions as given in docstrings, added array check in DataScaler
RandomDefaultUser Nov 14, 2024
993ba68
Merge remote-tracking branch 'fork_lenz/fix_data_scaling' into fix_da…
RandomDefaultUser Nov 14, 2024
273fb35
Made a density read from a cube file a 4D array as well
RandomDefaultUser Nov 14, 2024
9a45d69
Merge pull request #605 from RandomDefaultUser/density_cube_reading_fix
RandomDefaultUser Nov 14, 2024
48c04f4
Read descriptors from openPMD
franzpoeschel May 30, 2024
d8c0a84
Implement reading targets from openPMD
franzpoeschel May 31, 2024
8f920e5
Add reading from numpy
franzpoeschel May 31, 2024
53fbb29
Put example under basic examples folder
franzpoeschel May 31, 2024
bde9e2d
Add missing newline
franzpoeschel May 31, 2024
10eafa9
Fixes for reading from numpy
franzpoeschel May 31, 2024
7f144ec
Rewrite to use sample data, add (currently failing) test
franzpoeschel Jun 7, 2024
234566f
This fixes that, but I don't understand why
franzpoeschel Jun 7, 2024
d287829
Consider parameterization in descriptors.descriptors_contain_xyz
franzpoeschel Aug 1, 2024
fd60624
Move example to advanced
franzpoeschel Aug 1, 2024
e324f55
Rename test, add to tested examples
franzpoeschel Nov 15, 2024
09ed574
Use BP5, add CI test
franzpoeschel Nov 15, 2024
68f2a2d
Merge pull request #530 from franzpoeschel/convert-numpy-openpmd
RandomDefaultUser Nov 15, 2024
2ed3c1c
Fixed shuffling for cases in which the overall number of data points …
RandomDefaultUser Nov 15, 2024
379cb1c
Added test
RandomDefaultUser Nov 15, 2024
fc6e2ec
Quickfix of OpenPMD and disabling one test
RandomDefaultUser Nov 15, 2024
930c6e0
Included missing parameters' docstrings
Nov 18, 2024
6040f11
Fix mistake
Nov 18, 2024
c1dce0c
Fixed pipeline
RandomDefaultUser Nov 19, 2024
cab6b12
Added documentation
Nov 19, 2024
e5ef826
Hotfixing the total energy module to enable y-splitting
RandomDefaultUser Nov 19, 2024
ae2e0ed
Fixing minor issues
Nov 19, 2024
a61a489
Merge pull request #607 from RandomDefaultUser/fix_shuffling_divisors
RandomDefaultUser Nov 19, 2024
88211ad
Implemented backwards compatible reading procedure
RandomDefaultUser Nov 19, 2024
a99d5a6
Trying to make OpenPMD interface more continuous
RandomDefaultUser Nov 21, 2024
4697216
Fixed the inconsistency between numpy and openPMD and added Exception…
RandomDefaultUser Nov 21, 2024
6519479
Added setter/getter for use_atomic_density_formula and updated docs
RandomDefaultUser Nov 21, 2024
6aa3bc8
Tested and working, only GPU needs to be tested.
RandomDefaultUser Nov 21, 2024
caab2cc
Small clarification in the docs
RandomDefaultUser Nov 21, 2024
01320fa
Merge pull request #611 from RandomDefaultUser/move_atomic_density_fo…
RandomDefaultUser Nov 21, 2024
3d4ee9e
Snapshot check should only be performed if OpenPMD is selected
RandomDefaultUser Nov 21, 2024
a402f79
Merge pull request #610 from RandomDefaultUser/openpmd_shuffling_and_…
RandomDefaultUser Nov 21, 2024
049e100
Started overhauling the docstrings
RandomDefaultUser Nov 22, 2024
b03afcc
Common (except for Parameters) and DataGeneration finished
RandomDefaultUser Nov 22, 2024
ee158e3
Some DataGeneration stuff was wrong
RandomDefaultUser Nov 22, 2024
9fe2f95
DataConverter
RandomDefaultUser Nov 22, 2024
0323864
Done data handler
RandomDefaultUser Nov 22, 2024
dffb463
Forgot to change an attribute reference
RandomDefaultUser Nov 22, 2024
85146db
Fix typo and indentation
Nov 22, 2024
59b629c
Did DataHandlerBase
RandomDefaultUser Nov 22, 2024
6721a7f
Did DataScaler, changes will have to be merged with data scaling PR
RandomDefaultUser Nov 22, 2024
c84b314
Some more data handling classes done
RandomDefaultUser Nov 22, 2024
259d3ed
Finished with data handling
RandomDefaultUser Nov 22, 2024
8557bb2
Finished with descriptors
RandomDefaultUser Nov 22, 2024
d7087d3
Update mala/datahandling/data_scaler.py
RandomDefaultUser Nov 22, 2024
ec4777b
Update mala/datahandling/data_scaler.py
RandomDefaultUser Nov 22, 2024
608ba39
Corrected (x,y,z) to (d) in two places
RandomDefaultUser Nov 22, 2024
1525529
Merge branch 'develop' into fix_data_scaling
RandomDefaultUser Nov 22, 2024
a98830b
Added note about propagating changes
RandomDefaultUser Nov 22, 2024
6cb1d3f
Merge pull request #598 from RandomDefaultUser/fix_data_scaling
RandomDefaultUser Nov 25, 2024
3d8db6d
Finished hyperparameter optimization classes
RandomDefaultUser Nov 25, 2024
9a351bc
Finished model and running classes
RandomDefaultUser Nov 25, 2024
f099a7c
Working on Target class
RandomDefaultUser Nov 25, 2024
5cb768e
Corrected some mistakes
RandomDefaultUser Nov 25, 2024
949cea0
Done with all classes except for Parameters classes
RandomDefaultUser Nov 25, 2024
b24a9fb
Made some non-overlapping changes in the Parameters classes
RandomDefaultUser Nov 25, 2024
4deab66
Fixed a few docstring problems when building
RandomDefaultUser Nov 25, 2024
8006d6d
Merge branch 'develop' into add_docstrings
RandomDefaultUser Nov 25, 2024
9aa1c14
Added missing docstring and commented a few redundant ones out
RandomDefaultUser Nov 26, 2024
db47311
Merge pull request #609 from mala-project/fix-missing-parameter-docst…
RandomDefaultUser Nov 26, 2024
47ef53c
Duplicate docstring
RandomDefaultUser Nov 26, 2024
5a7eed2
Merge remote-tracking branch 'refs/remotes/fork_lenz/develop' into ad…
RandomDefaultUser Nov 26, 2024
b9e4ed2
Small typo
RandomDefaultUser Nov 26, 2024
eed959c
Merge pull request #613 from RandomDefaultUser/add_docstrings
RandomDefaultUser Nov 26, 2024
f5570cc
Merge remote-tracking branch 'refs/remotes/fork_lenz/develop' into qu…
RandomDefaultUser Nov 26, 2024
69e9a9c
Implemented a base class for ACSD and mutual information
RandomDefaultUser Nov 26, 2024
632fe26
Finished with code for now
RandomDefaultUser Nov 27, 2024
1790092
Small final adjustments
RandomDefaultUser Nov 27, 2024
cdcf1b4
Slightly altering the parameter of the hyperparameter test because it…
RandomDefaultUser Nov 27, 2024
ad1b5fd
Merge pull request #513 from RandomDefaultUser/quickfix_acsd
RandomDefaultUser Nov 27, 2024
d52ca0c
Turning of logging by default
RandomDefaultUser Nov 28, 2024
c2e1bb7
Merge remote-tracking branch 'origin/develop' into develop
RandomDefaultUser Nov 28, 2024
618c4b8
Aligned python versions throughout MALA; there will likely be some fi…
RandomDefaultUser Nov 28, 2024
3b75e05
Forgot one place
RandomDefaultUser Nov 28, 2024
100bd45
Forgot one place
RandomDefaultUser Nov 28, 2024
59bc877
Going up to 3.10.4
RandomDefaultUser Nov 28, 2024
5c2976c
Updating the conda yaml files locally
RandomDefaultUser Nov 28, 2024
63a6575
Got rid of --color-always
RandomDefaultUser Nov 28, 2024
7da7f42
Debugging the command
RandomDefaultUser Nov 28, 2024
eec81da
Some debugging
RandomDefaultUser Nov 28, 2024
9994799
Let's see if cutting MALA out helps
RandomDefaultUser Nov 28, 2024
b7af1c3
Added requests to the environment.yml
RandomDefaultUser Nov 28, 2024
a769f3e
Added a line of documentation
RandomDefaultUser Nov 28, 2024
dddccd4
Merge pull request #614 from mala-project/align_mala_version
RandomDefaultUser Nov 28, 2024
8358e03
Reintroduced old validation loss calculation, let's see if this fixes…
RandomDefaultUser Nov 29, 2024
d3043e6
Forgot a renaming
RandomDefaultUser Nov 29, 2024
20a06f2
Refactored code internally
RandomDefaultUser Nov 29, 2024
03f6b96
Merge pull request #617 from RandomDefaultUser/fix_ddp_validation
RandomDefaultUser Nov 29, 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
37 changes: 37 additions & 0 deletions .github/workflows/cleanup-caches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Cleanup caches
on:
pull_request_target:
types:
- closed
push:
# Trigger on pushes to master or develop and for git tag pushes
branches:
- master
- develop
tags:
- v*

jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Cleanup caches
run: |
gh extension install actions/gh-actions-cache

echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )

## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
echo $cacheKey
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
15 changes: 15 additions & 0 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Delete Untagged Container Versions

on:
workflow_dispatch:

jobs:
delete-untagged-containers:
runs-on: ubuntu-latest
steps:
- name: mala_conda_cpu
uses: actions/delete-package-versions@v5
with:
package-name: 'mala_conda_cpu'
package-type: 'container'
delete-only-untagged-versions: 'true'
113 changes: 80 additions & 33 deletions .github/workflows/cpu-tests.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
name: CPU tests

on:
workflow_dispatch:
pull_request:
# Trigger on pull requests to master or develop
# Trigger on pull requests to master or develop that are
# marked as "ready for review" (non-draft PRs)
types:
- opened
- synchronize
- reopened
- ready_for_review
branches:
- master
- develop
Expand All @@ -21,11 +28,15 @@ env:

jobs:
build-docker-image-cpu:
# do not trigger on draft PRs
if: ${{ ! github.event.pull_request.draft }}
# Build and push temporary Docker image to GitHub's container registry
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: '1'

- name: Set environment variables
run: |
Expand All @@ -37,7 +48,7 @@ jobs:
echo "IMAGE_REPO=$IMAGE_REPO"

- name: Restore cache
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-docker
with:
path: ${{ env.DOCKER_CACHE_PATH }}
Expand All @@ -53,7 +64,7 @@ jobs:
fi

- name: Pull latest image from container registry
run: docker pull $IMAGE_REPO/$IMAGE_NAME || true
run: docker pull $IMAGE_REPO/$IMAGE_NAME --quiet || true

- name: Build temporary Docker image
run: |
Expand All @@ -65,7 +76,7 @@ jobs:
CACHE=$IMAGE_REPO/$IMAGE_NAME:latest
fi

docker build . --file Dockerfile --tag $IMAGE_NAME:local --cache-from=$CACHE --build-arg DEVICE=cpu
DOCKER_BUILDKIT=0 docker build . --file Dockerfile --tag $IMAGE_NAME:local --cache-from=$CACHE --build-arg DEVICE=cpu

# Show images
docker images --filter=reference=$IMAGE_NAME --filter=reference=$IMAGE_REPO/$IMAGE_NAME
Expand Down Expand Up @@ -114,20 +125,20 @@ jobs:
steps:
- name: "Prepare environment: Restore cache"
if: env.DOCKER_TAG != 'latest'
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-docker
with:
path: ${{ env.DOCKER_CACHE_PATH }}
key: ${{ github.run_id }}

- name: "Prepare environment: Load Docker image from cache"
if: env.DOCKER_TAG != 'latest'
run: docker load -i $DOCKER_CACHE_PATH/docker-image.tar.gz
run: docker load -i $DOCKER_CACHE_PATH/docker-image.tar.gz --quiet

- name: "Prepare environment: Pull latest image from container registry"
if: env.DOCKER_TAG == 'latest'
run: |
docker pull $IMAGE_REPO/$IMAGE_NAME:latest
docker pull $IMAGE_REPO/$IMAGE_NAME:latest --quiet
docker image tag $IMAGE_REPO/$IMAGE_NAME:latest $IMAGE_NAME:latest

- name: "Prepare environment: Run Docker container"
Expand All @@ -145,39 +156,81 @@ jobs:
[[ $(docker inspect --format '{{json .State.Running}}' mala-cpu) == 'true' ]]

- name: Check out repository (mala)
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: '1'

- name: Install mala package
# Exec all commands inside the mala-cpu container
shell: 'bash -c "docker exec -i mala-cpu bash < {0}"'
run: |
# epxort Docker image Conda environment for a later comparison
conda env export -n mala-cpu > env_1.yml
# export Docker image Conda environment for a later comparison
conda env export -n mala-cpu > env_before.yml

# install mala package
pip --no-cache-dir install -e .[opt,test]
pip --no-cache-dir install -e .[opt,test] --no-build-isolation


- name: Check if Conda environment meets the specified requirements
shell: 'bash -c "docker exec -i mala-cpu bash < {0}"'
run: |
# export Conda environment _with_ mala package installed in it (and extra dependencies)
conda env export -n mala-cpu > env_2.yml
conda env export -n mala-cpu > env_after.yml

# This command is necessary because conda includes even editable
# packages in an export, at least in the versions we recently used.
# That of course leads to the diff failing, since MALA can never
# be there before it has been installed.
sed -i '/materials-learning-algorithms/d' ./env_after.yml

# if comparison fails, `install/mala_cpu_[base]_environment.yml` needs to be aligned with
# `requirements.txt` and/or extra dependencies are missing in the Docker Conda environment
diff env_1.yml env_2.yml

- name: Check out repository (data)
uses: actions/checkout@v3
with:
repository: mala-project/test-data
path: mala_data
ref: v1.7.0
lfs: true
if diff --brief env_before.yml env_after.yml
then
echo "Files env_before.yml and env_after.yml do not differ."
else
diff --side-by-side env_before.yml env_after.yml
fi

- name: Download test data repository from RODARE
shell: 'bash -c "docker exec -i mala-cpu python < {0}"'
run: |
import requests, shutil, zipfile

# This DOI represents all versions, and will always resolve to the latest one
DOI = "https://doi.org/10.14278/rodare.2900"

# Resolve DOI and get record ID and the associated API URL
response = requests.get(DOI)
*_, record_id = response.url.split("/")
api_url = f"https://rodare.hzdr.de/api/records/{record_id}"

# Download record from API and get the first file
response = requests.get(api_url)
record = response.json()
size = record["files"][0]["size"]
download_link = record["files"][0]["links"]["self"]

print(size, "bytes", "--", download_link)

# TODO: implement some sort of auto retry for failed HTTP requests
response = requests.get(download_link)

# Saving downloaded content to a file
with open("test-data.zip", mode="wb") as file:
file.write(response.content)

# Get top level directory name
dir_name = zipfile.ZipFile("test-data.zip").namelist()[0]
shutil.unpack_archive("test-data.zip", ".")

print(f"Rename {dir_name} to mala_data")
shutil.move(dir_name, "mala_data")

- name: Test mala
shell: 'bash -c "docker exec -i mala-cpu bash < {0}"'
run: MALA_DATA_REPO=$(pwd)/mala_data pytest -m "not examples" --disable-warnings
run: MALA_DATA_REPO=$(pwd)/mala_data pytest --cov=mala --cov-fail-under=60 -m "not examples" --disable-warnings

retag-docker-image-cpu:
needs: [cpu-tests, build-docker-image-cpu]
Expand All @@ -193,34 +246,29 @@ jobs:
((contains(github.ref_name, 'develop') || contains(github.ref_name, 'master')) && needs.build-docker-image-cpu.outputs.docker-tag != 'latest')
|| startsWith(github.ref, 'refs/tags/')
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: "Prepare environment: Restore cache"
if: env.DOCKER_TAG != 'latest'
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-docker
with:
path: ${{ env.DOCKER_CACHE_PATH }}
key: ${{ github.run_id }}

- name: "Prepare environment: Load Docker image from cache"
if: env.DOCKER_TAG != 'latest'
run: docker load -i $DOCKER_CACHE_PATH/docker-image.tar.gz
run: docker load -i $DOCKER_CACHE_PATH/docker-image.tar.gz --quiet

- name: "Prepare environment: Pull latest image from container registry"
if: env.DOCKER_TAG == 'latest'
run: docker pull $IMAGE_REPO/$IMAGE_NAME:latest
run: docker pull $IMAGE_REPO/$IMAGE_NAME:latest --quiet

- name: Tag Docker image
run: |
# Execute on change of Docker image
if [[ "$DOCKER_TAG" != 'latest' ]]; then
GIT_SHA=${GITHUB_REF_NAME}-$(git rev-parse --short "$GITHUB_SHA")
echo "GIT_SHA=$GIT_SHA"

docker tag $IMAGE_NAME:$GITHUB_RUN_ID $IMAGE_REPO/$IMAGE_NAME:latest
docker tag $IMAGE_NAME:$GITHUB_RUN_ID $IMAGE_REPO/$IMAGE_NAME:$GIT_SHA
docker tag $IMAGE_NAME:$GITHUB_RUN_ID $IMAGE_REPO/$IMAGE_NAME:${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}
fi

# Execute on push of git tag
Expand All @@ -236,5 +284,4 @@ jobs:
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Push Docker image
run: docker push $IMAGE_REPO/$IMAGE_NAME --all-tags

run: docker push $IMAGE_REPO/$IMAGE_NAME --all-tags | grep -v -E 'Waiting|Layer already|Preparing|Pushed'
27 changes: 17 additions & 10 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
name: docs
name: Documenation

on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
branches:
- master
- develop
Expand All @@ -11,15 +16,17 @@ on:

jobs:
test-docstrings:
runs-on: ubuntu-22.04
# do not trigger on draft PRs
if: ${{ ! github.event.pull_request.draft }}
runs-on: ubuntu-24.04
steps:
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.10.4'

- name: Upgrade pip
run: python3 -m pip install --upgrade pip
Expand All @@ -29,21 +36,21 @@ jobs:

- name: Check docstrings
# Ignoring the cached_properties because pydocstyle (sometimes?) treats them as functions.
run: pydocstyle --convention=numpy --ignore-decorators=[cached_property,property] mala
run: pydocstyle --convention=numpy mala

build-and-deploy-pages:
needs: test-docstrings
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0 # 0 fetches complete history and tags

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.10.4'

- name: Upgrade pip
run: python3 -m pip install --upgrade pip
Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/mirror-to-casus.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
name: mirror
name: Mirror to CASUS

on: [push, delete]

jobs:
mirror-to-CASUS:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: mirror-repository
uses: spyoungtech/[email protected]
with:
REMOTE: 'ssh://[email protected]/casus/mala.git'
GIT_SSH_PRIVATE_KEY: ${{ secrets.GIT_SSH_KEY }}
GIT_SSH_NO_VERIFY_HOST: "true"
DEBUG: "true"
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: mirror-repository
uses: spyoungtech/[email protected]
with:
REMOTE: 'ssh://[email protected]/casus/mala.git'
GIT_SSH_PRIVATE_KEY: ${{ secrets.GIT_SSH_KEY }}
GIT_SSH_NO_VERIFY_HOST: "true"
DEBUG: "true"
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,13 @@ cython_debug/
# JupyterNotebooks
.ipynb_checkpoints
*/.ipynb_checkpoints/*
*.ipynb

# Lightning
lightning_logs/

# wandb
wandb/

# SQLite
*.db
Expand Down
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# https://black.readthedocs.io/en/stable/integrations/source_version_control.html

repos:
# Using this mirror lets us use mypyc-compiled black, which is about 2x faster
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.0
hooks:
- id: black
Loading
Loading