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

WIP: New JSON Interface #231

Merged
merged 20 commits into from
Sep 10, 2024
Merged

WIP: New JSON Interface #231

merged 20 commits into from
Sep 10, 2024

Conversation

iamveronika
Copy link
Contributor

@iamveronika iamveronika commented Aug 26, 2024

Command line interface
julia scripts/runfit.jl -p fitting_params.json

fitting_params.json

Results:

bash-4.4$ julia scripts/runfit.jl -p fitting_params.json
  Activating project at `/z1-vekondra/vekondra/ACEP`
[ Info: making ACEmodel
       |      E    |    F  
 train | 2.69e-03  |  2.91e-01  
  test | 8.07e-03  |  3.13e-01  

New results:

bash-4.4$ julia runfit.jl -p fitting_params.json
  Activating project at `/z1-vekondra/vekondra/tmp/ACEpotentials.jl`
[ Info: making ACEmodel
┌───────────────┬──────────┬───────┬────┬─────┬─────┐
│          Type │ #Configs │ #Envs │ #E │  #F │  #V │
├───────────────┼──────────┼───────┼────┼─────┼─────┤
│ isolated_atom │        1 │     1 │  1 │   3 │   0 │
│           dia │       25 │    50 │ 25 │ 150 │ 150 │
│            bt │       25 │    50 │ 25 │ 150 │ 150 │
│           liq │        2 │   128 │  2 │ 384 │  12 │
├───────────────┼──────────┼───────┼────┼─────┼─────┤
│         total │       53 │   229 │ 53 │ 687 │ 312 │
│       missing │        0 │     0 │  0 │   0 │   6 │
└───────────────┴──────────┴───────┴────┴─────┴─────┘
[ Info: Assembling linear problem.
[ Info:   - Creating feature matrix with size (1052, 120).
[ Info:   - Beginning assembly with processor count:  1.
Progress: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| Time: 0:00:41
[ Info:   - Assembly completed.
[ Info: Assembling full weight vector.
Progress: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| Time: 0:00:00
┌ Warning: Need to apply preconditioner in LSQR.
└ @ ACEfit /z1-vekondra/vekondra/tmp/ACEfit.jl/src/solvers.jl:95
damp  0.005
atol  1.0e-6
maxiter  100000
Converged after 20 iterations.
relative RMS error  0.09083234883494287
[ Info: RMSE Table
┌───────────────┬────────────┬──────────┬───────────┐
│          Type │    E [meV] │ F [eV/A] │   V [meV] │
├───────────────┼────────────┼──────────┼───────────┤
│ isolated_atom │ 158544.968 │    0.000 │     0.000 │
│           dia │    153.972 │    0.346 │  5052.524 │
│           liq │     66.949 │    4.232 │ 11817.642 │
│            bt │    406.986 │    2.670 │  4291.416 │
├───────────────┼────────────┼──────────┼───────────┤
│           set │  21779.881 │    3.405 │  5147.665 │
└───────────────┴────────────┴──────────┴───────────┘
[ Info: MAE Table
┌───────────────┬────────────┬──────────┬──────────┐
│          Type │    E [meV] │ F [eV/A] │  V [meV] │
├───────────────┼────────────┼──────────┼──────────┤
│ isolated_atom │ 158544.968 │    0.000 │    0.000 │
│           dia │    103.150 │    0.278 │ 3548.744 │
│           liq │     65.941 │    3.447 │ 8521.847 │
│            bt │    306.851 │    1.889 │ 2838.204 │
├───────────────┼────────────┼──────────┼──────────┤
│           set │   3187.300 │    2.400 │ 3398.412 │
└───────────────┴────────────┴──────────┴──────────┘
[ Info: RMSE Table
┌───────────────┬────────────┬──────────┬───────────┐
│          Type │    E [meV] │ F [eV/A] │   V [meV] │
├───────────────┼────────────┼──────────┼───────────┤
│ isolated_atom │ 158544.968 │    0.000 │     0.000 │
│           dia │    153.972 │    0.346 │  5052.524 │
│           liq │     66.949 │    4.232 │ 11817.642 │
│            bt │    406.986 │    2.670 │  4291.416 │
├───────────────┼────────────┼──────────┼───────────┤
│           set │  21779.881 │    3.405 │  5147.665 │
└───────────────┴────────────┴──────────┴───────────┘
[ Info: MAE Table
┌───────────────┬────────────┬──────────┬──────────┐
│          Type │    E [meV] │ F [eV/A] │  V [meV] │
├───────────────┼────────────┼──────────┼──────────┤
│ isolated_atom │ 158544.968 │    0.000 │    0.000 │
│           dia │    103.150 │    0.278 │ 3548.744 │
│           liq │     65.941 │    3.447 │ 8521.847 │
│            bt │    306.851 │    1.889 │ 2838.204 │
├───────────────┼────────────┼──────────┼──────────┤
│           set │   3187.300 │    2.400 │ 3398.412 │
└───────────────┴────────────┴──────────┴──────────┘

@@ -0,0 +1,54 @@
using ACEpotentials
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be a sub-module of ACEpotentials?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... answering myself. Yes, I think that would be better.

pyimport("pprint")["pprint"](controller.select(user_api="blas").info())
end

include("../src/ace1_compat.jl")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This include should definitely not be here. Use ACEpotentials.ACE1compat to access the submodule.

Project.toml Outdated
@@ -8,6 +8,7 @@ ACE1x = "5cc4c08c-8782-4a30-af6d-550b302e9707"
ACEbase = "14bae519-eb20-449c-a949-9c58ed33163e"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a lengthy comment about maintaining a separate project inside scripts in the other PR. Can you copy that over please?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also don't like this activation here. In general a user should create a working directory for their project, where ACEpotentials is added (to the local Project.toml). This will then be the activated project.

@cortner
Copy link
Member

cortner commented Aug 26, 2024

thank you - looks much better but still some re-organization to be discussed. Before our meeting can you please also take a look at the documentation.

@iamveronika iamveronika changed the title Updated and corrected errors WIP: New JSON Interface Aug 26, 2024
@iamveronika
Copy link
Contributor Author

Just a few quesions:

  1. Do we want a dry run?
  2. We don't have multithreaded assembly yet. Do we want to include this in our first example?
  3. Weight for lsq is not yet "by config_type" @cortner

@cortner
Copy link
Member

cortner commented Aug 27, 2024

Do we want a dry run?

yes. The point is that the user can check how big the problem is.

We don't have multithreaded assembly yet. Do we want to include this in our first example?

I guess not. Just get anything to run, we can add the distributed and multi-threaded aspects later.

Weight for lsq is not yet "by config_type"

I don't understand this. Can you say more please?

@iamveronika
Copy link
Contributor Author

I mean that here (in scripts/runfit,jl) weight should be also depending on config_type
wE = 30.0; wF = 1.0; wV = 1.0
weights = (wE = wE/u"eV", wF = wF / u"eV/Å", )

@cortner
Copy link
Member

cortner commented Aug 28, 2024

Yes, weights should be provided in the "old" style. My little hacked together assembly was just for a quick demo. The docs and tests should show how weights are correctly specified. E.g. look at test_silicon

@cortner
Copy link
Member

cortner commented Aug 28, 2024

Btw - the assembly with the new kernels is essentially ready. we can discuss that tomorrow.

@cortner
Copy link
Member

cortner commented Aug 31, 2024

@iamveronika okease update the PR again by merging main into your branch

@cortner
Copy link
Member

cortner commented Sep 10, 2024

I think this is ready to merge. That will enable us to make further progress through separate smaller PRs.

@cortner cortner merged commit 0807f85 into ACEsuit:main Sep 10, 2024
2 checks passed
@cortner cortner deleted the ve/updt branch September 10, 2024 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants