-
Notifications
You must be signed in to change notification settings - Fork 1
Add FlashMD #21
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
base: metatomic
Are you sure you want to change the base?
Add FlashMD #21
Conversation
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.
Can you remove directory from git?
|
|
||
| kokkosable = 1; | ||
| execution_space = ExecutionSpaceFromDevice<DeviceType>::space; | ||
| atomKK = (AtomKokkos *) atom; |
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.
why this change?
|
|
||
| #ifdef FIX_CLASS | ||
| // clang-format off | ||
| FixStyle(flashmd,FixFlashMD); |
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.
So as mentioned already I don't think we should call this fix flashmd, unless we want to use FlashMD as the name for the generic method of generating positions and not the specific model. I also feel like this should contain metatomic in the name, like the pair style.
Couple of ideas: fix metatomic_pm, fix metatomic_pos_vel, fix metatomic_ml_dyn. I don't really love any of these though, so we should keep thinking about it!
|
|
||
| namespace LAMMPS_NS { | ||
| class MetatomicSystemAdaptor; | ||
| class PairMetatomicData; |
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.
This should be a separate FixFlashMDData/Fix<WhateverNameWeEndUpWith>Data class, so we can evolve the two parts separately.
| std::vector<torch::DeviceType> available_devices(); | ||
| void pick_device(torch::Device* device, const char* requested); | ||
| void initial_integrate(int) override; | ||
| void init_list(int id, NeighList *ptr) override; | ||
|
|
||
| protected: |
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.
| std::vector<torch::DeviceType> available_devices(); | |
| void pick_device(torch::Device* device, const char* requested); | |
| void initial_integrate(int) override; | |
| void init_list(int id, NeighList *ptr) override; | |
| protected: | |
| void initial_integrate(int) override; | |
| void init_list(int id, NeighList *ptr) override; | |
| protected: | |
| std::vector<torch::DeviceType> available_devices(); | |
| void pick_device(torch::Device* device, const char* requested); |
just to make it clear which functions are part of the fix API or not
| double *mass = atom->mass; | ||
| int *type = atom->type; | ||
| int *mask = atom->mask; | ||
| if (igroup == atom->firstgroup) nlocal = atom->nfirst; |
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.
| if (igroup == atom->firstgroup) nlocal = atom->nfirst; | |
| if (igroup == atom->firstgroup) { | |
| nlocal = atom->nfirst; | |
| } |
| int nghost = atom->nghost; | ||
| int nall = nlocal + nghost; | ||
|
|
||
| double *mass = atom->mass; |
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.
what's the difference between rmass and mass?
|
|
||
| auto properties = metatensor_torch::LabelsHolder::single()->to(mta_data->device); | ||
| auto block = torch::make_intrusive<metatensor_torch::TensorBlockHolder>( | ||
| // TODO: is there a way to check what dtype the model expects for input data? |
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.
yes, model->capabilities().dtype
| ); | ||
| mta_data->evaluation_options->set_selected_atoms(selected_atoms); | ||
|
|
||
| // call the model to get delta-positions and updated momenta |
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.
| // call the model to get delta-positions and updated momenta | |
| // call the model to get new positions and momenta |
| v[i][0] = momenta[i][0].item<double>(); | ||
| v[i][1] = momenta[i][1].item<double>(); | ||
| v[i][2] = momenta[i][2].item<double>(); |
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.
shouldn't these be divided by the masses?
Add a new fix that uses a model to predict future positions and momenta.