-
Notifications
You must be signed in to change notification settings - Fork 7
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
OpenMP Issue #1
Comments
Hi, this error is due to there being different, conflicting OpenMP libraries in your Python environment. This sounds like an environment-specific issue, and not directly related to the code itself. Sometimes this happens if dependencies are installed from different sources (e.g. some from wheels, some from conda, etc.). If you haven't already done so, I would recommend creating a virtual Python environment:
There's also this issue in the PyTorch repo, which may provide some guidance. |
Training a model normally requires a GPU with sufficient memory, like an NVIDIA A10G or A100. It isn't practical to train on something like a laptop, as training will be extremely slow. If you're trying to train on a laptop, that may be why it's taking so long. Recall that these models have millions of parameters, even if the training set size is very small. You can adjust the number of parameters in the model by setting the number of layers and embedding size. However, even a model with 25 million parameters (what we call a small model) is going to be slow without a GPU. Inference (i.e. sampling from the model), on the other hand, may be practical on a laptop. |
Hi, thanks for bringing this up. I have added more information to the README related to prompting the model and generating CIF files. I have also added a new script to help create prompt files ( The strange-looking sequence of characters in your output was generated by the model you trained. However, I'm not sure how long you trained the model, and your model also has a relatively small number of parameters (0.01M). I therefore suspect that your model may not have sufficiently learned the data. Going forward, I will use the pre-trained small model (with 25M parameters) for my examples, which runs fine on my macbook for sampling. First, download the model. From the root of the project: python bin/download.py crystallm_v1_small.tar.gz Unpack the file: tar xvf crystallm_v1_small.tar.gz This will result in a folder named Next, make a prompt file. We'll generate a structure for NaCl with Z=2 and let the model determine the space group: python bin/make_prompt_file.py Na2Cl2 my_prompt.txt Finally, sample from the model: python bin/sample.py \
out_dir=crystallm_v1_small \
start=FILE:my_prompt.txt \
num_samples=1 \
top_k=10 \
max_new_tokens=3000 \
device=cpu This gives me the output:
You can also have the generated content be saved locally to a file by including the python bin/sample.py \
out_dir=crystallm_v1_small \
start=FILE:my_prompt.txt \
num_samples=1 \
top_k=10 \
max_new_tokens=3000 \
target=file \
device=cpu A file called Note that these generated CIF files must be post-processed. Create a directory called python bin/postprocess.py my_raw_cifs my_processed_cifs The post-processed CIF files will be in a new directory called |
Oh, I see, The sample.py script has been updated to accept the argument. |
Is it possible to put multiple composition in the same prompt file? Can I write python bin/make_prompt_file.py Na2Cl2 CdTe AlCl3 my_prompt.txt |
No, a prompt .txt file is expected to contain only a single prompt. You will need to make separate prompt files for each composition. Running that command with multiple compositions should result in an error. |
I do have another question. When it generates new CIF files, it only changes the lattice parameter and coordinate of each atom; are these all I'd expect? For example, if I say I want a CdTe-based crystal with a certain space group, it will give me some identical crystal files. We could have alternatively applied strain and compression to the parent CdTe to make these crystals too. Therefore, what is the point of training these generative models? Apologies if I am not understanding the key points of generative models. Can you please explain the benefits of these models in a bigger picture? |
Sorry but I don't understand what else you're expecting to see. These models generate a structure for you when all you know is the cell composition (and possibly space group). If you prompt the model with the same cell composition and space group, it will likely give you a very similar structure each time. I'm not sure what you mean by "parent CdTe", as there is no concept of a parent structure in this context. These models generate structures based on given compositions, independent of any "parent" structure. Have a look at our manuscript, located at https://arxiv.org/abs/2307.04340, if you'd like to know more about what the point is of these generative models. Thanks for your questions, but this discussion is no longer related to the original issue. Please create a new Issue if you have additional questions related to the code in this repo, thanks! |
When I tried to train the model it shows:
Creating out...
Found vocab_size = 371 (inside tokens_v1_all/meta.pkl)
Initializing a new model from scratch...
number of parameters: 85.24M
Compiling the model (takes a ~minute)...
OMP: Error #15: Initializing libomp.dylib, but found libiomp5.dylib already initialized.
OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://openmp.llvm.org/
zsh: abort python bin/train.py dataset=tokens_v1_all
The text was updated successfully, but these errors were encountered: