cWendi commited on
Commit
526ef83
·
verified ·
1 Parent(s): dc995cd

Upload 5 files

Browse files
Files changed (5) hide show
  1. README.md +92 -0
  2. SHA256SUMS +1 -0
  3. config.json +146 -0
  4. model.json +17 -0
  5. sala_ema.ckpt +3 -0
README.md ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ library_name: pytorch
5
+ tags:
6
+ - chemistry
7
+ - molecular-crystals
8
+ - crystal-structure-prediction
9
+ - flow-matching
10
+ - materials-science
11
+ ---
12
+
13
+ # SALA
14
+
15
+ **Symmetry-Aware Lattice and Asymmetric-unit generation**
16
+
17
+ Generate molecular crystal candidates with a symmetry-constrained flow model. This repository hosts the full-precision pretrained checkpoint; preprocessing, training and inference code are available on [GitHub](https://github.com/WENDI-CAI/SALA).
18
+
19
+ [Code and quick start](https://github.com/WENDI-CAI/SALA) · [Inference guide](https://github.com/WENDI-CAI/SALA/blob/main/docs/inference.md) · [Project website](https://wendi-cai.github.io/SALA/)
20
+
21
+ ## Start from SMILES
22
+
23
+ ```bash
24
+ git clone https://github.com/WENDI-CAI/SALA.git
25
+ cd SALA
26
+ python -m pip install -e '.[inference]'
27
+
28
+ sala-predict \
29
+ --smiles 'CC(=O)Oc1ccccc1C(=O)O' \
30
+ --space-group 1 \
31
+ --num-samples 4 \
32
+ --output outputs/aspirin
33
+ ```
34
+
35
+ The first run downloads and verifies `sala_ema.ckpt` (1.95 GB). Later runs reuse the local cache. Input molecules are processed locally. `--device cpu` selects CPU execution; compatible CUDA devices are used automatically when available.
36
+
37
+ Space group 1 (P1) is an explicit assumption in this example. SALA does not infer the space group or asymmetric-unit composition from SMILES. Specify the intended `--space-group`, optionally an exact `--hall-number`, and `--copies` of the complete molecular composition in the asymmetric unit. Include counterions and coformers in dot-separated SMILES where appropriate.
38
+
39
+ ## Use a local CIF or checkpoint
40
+
41
+ ```bash
42
+ sala-predict --input /path/to/target.cif --output outputs/crystal
43
+
44
+ sala-predict \
45
+ --smiles 'CCO' --space-group 1 \
46
+ --checkpoint /path/to/sala_ema.ckpt \
47
+ --device cpu --output outputs/local
48
+ ```
49
+
50
+ The local checkpoint option supports offline execution. `--local-files-only` uses an already populated Hugging Face cache without downloading. The advanced `sala-generate` command supports folders and preprocessed dataset indices.
51
+
52
+ ## Model specification
53
+
54
+ | Property | Value |
55
+ |---|---|
56
+ | Architecture | Full-cell Crystal DiT |
57
+ | Trainable parameters | 486,282,617 |
58
+ | Transformer | 24 layers · 1,024 hidden width · 16 heads |
59
+ | SwiGLU branch width | 2,816 |
60
+ | Self-conditioning / pair bias | Enabled |
61
+ | Sampler | Flow-2M · 24 steps |
62
+ | Stored precision | float32, no quantization |
63
+ | Weight selection | Power-function EMA, relative standard deviation 0.05 |
64
+ | Source optimizer step | 249,000 |
65
+ | Source epoch | 175 |
66
+ | Checkpoint schema | 16 |
67
+
68
+ Training combines full-cell coordinate velocity, lattice velocity, and contact/clash objectives. Coordinate and lattice endpoint-loss weights are zero. `config.json` records the architecture and flow settings; `model.json` records the weight provenance and checksum.
69
+
70
+ The checkpoint contains the selected EMA state, model buffers and public model configuration. It excludes the optimizer, training loop, extra EMA profiles and private data paths. Use it for inference or initialize a new run with `finetune_from`; exact training continuation requires a full training checkpoint from your own run.
71
+
72
+ ## Outputs and scope
73
+
74
+ Each run writes heavy-atom CIF candidates, `generated_results.pt`, input metadata and a run manifest. Candidates are unranked and unrelaxed. The model assumes general-position symmetry orbits. Explicit stereochemistry, isotope labels and radicals are outside the supported SMILES representation and are rejected rather than silently discarded. See the code repository for detailed input constraints.
75
+
76
+ These weights are not served by a Hugging Face hosted inference endpoint. Run the SALA package locally. Memory use depends on the expanded cell atom count and sampling batch size; the checkpoint size is not a complete memory estimate.
77
+
78
+ ## Data and license
79
+
80
+ Training data, crystallographic records, dataset indices and samples are not distributed because of data licensing restrictions. Supply your own appropriately licensed inputs.
81
+
82
+ The code repository uses the MIT License. A separate license for these model weights has not been specified.
83
+
84
+ ## Integrity
85
+
86
+ SHA-256 for `sala_ema.ckpt`:
87
+
88
+ ```text
89
+ 453db9f2dc8af7047d117b156ff3e8568789fbff349f2f3063577620b290804f
90
+ ```
91
+
92
+ The exported tensors were checked for exact equality with the selected source EMA state. Local CPU execution checks cover preprocessing, training/continuation, and full-model sampling; they do not constitute a benchmark or a guarantee of physical validity.
SHA256SUMS ADDED
@@ -0,0 +1 @@
 
 
1
+ 453db9f2dc8af7047d117b156ff3e8568789fbff349f2f3063577620b290804f sala_ema.ckpt
config.json ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_family": "sala_full_cell_crystal_dit_rectified_flow",
3
+ "checkpoint_schema_version": 16,
4
+ "denoiser_config": {
5
+ "architecture": "full_cell_crystal_dit_flow",
6
+ "d_model": 1024,
7
+ "num_heads": 16,
8
+ "num_layers": 24,
9
+ "d_ffn": 2816,
10
+ "dropout": 0.0,
11
+ "num_elements": 119,
12
+ "use_gradient_checkpointing": false,
13
+ "embedding": {
14
+ "num_fourier_freqs": 4,
15
+ "num_hybridizations": 8,
16
+ "formal_charge_range": 16,
17
+ "num_covalent_layers": 2
18
+ },
19
+ "attention": {
20
+ "attn_dropout": 0.0,
21
+ "use_flash": true,
22
+ "backend": "sdpa",
23
+ "qk_norm": true
24
+ },
25
+ "pair": {
26
+ "enabled": true,
27
+ "d_pair": 128,
28
+ "num_rbf": 32,
29
+ "rbf_cutoff": 12.0,
30
+ "inter_component_cutoff": 8.0,
31
+ "max_bond_types": 16,
32
+ "max_image_candidates": 65536,
33
+ "feature_chunk_size": 131072,
34
+ "pair_chunk_size": 2048,
35
+ "image_chunk_size": 256,
36
+ "cuda_static_image_radius": 2,
37
+ "cuda_dynamic_image_radius": true
38
+ },
39
+ "orbit": {
40
+ "require_general_position": true,
41
+ "special_position_tolerance": 1e-05
42
+ },
43
+ "self_conditioning": {
44
+ "enabled": true
45
+ },
46
+ "atom_coord_repr": "canonical_cartesian",
47
+ "lattice_parameterization": "constrained_q",
48
+ "component_representation": "base_instance_type_v2"
49
+ },
50
+ "flow_config": {
51
+ "state": {
52
+ "coordinate": "canonical_cartesian",
53
+ "lattice": "constrained_q",
54
+ "model": "normalized_cartesian_whitened_q",
55
+ "output": "fractional_unwrapped",
56
+ "coord_scale": 8.0
57
+ },
58
+ "path": {
59
+ "type": "rectified_linear",
60
+ "prediction": "velocity",
61
+ "data_time": 0.0,
62
+ "noise_time": 1.0
63
+ },
64
+ "time_sampling": {
65
+ "type": "logit_normal",
66
+ "mean": 0.0,
67
+ "std": 1.0,
68
+ "clamp": 1e-05
69
+ },
70
+ "time_condition": {
71
+ "type": "scaled_time",
72
+ "scale": 1000.0
73
+ },
74
+ "geometry": {
75
+ "stabilization_start": 0.5,
76
+ "latent_clip": 1.5
77
+ },
78
+ "self_conditioning": {
79
+ "enabled": true,
80
+ "train_probability": 0.5,
81
+ "prepass_selected_only": true,
82
+ "detach": true,
83
+ "sampling_enabled": true,
84
+ "representation": "normalized_clean_residual"
85
+ },
86
+ "loss": {
87
+ "coord_velocity_weight": 1.0,
88
+ "coord_velocity_mode": "full_cell_orbit",
89
+ "lattice_velocity_weight": 1.0,
90
+ "full_cell_endpoint_weight": 0.0,
91
+ "coord_endpoint_pred_lattice_mode": "input",
92
+ "lattice_endpoint_weight": 0.0,
93
+ "lattice_normalize_by_dof": true,
94
+ "contact_clash": {
95
+ "enabled": true,
96
+ "weight": 0.1,
97
+ "max_time": 0.4,
98
+ "vdw_offset_A": 1.0,
99
+ "contact_cutoff_A": 5.0,
100
+ "contact_match_weight": 1.0,
101
+ "huber_delta_A": 0.5,
102
+ "predicted_lattice_mode": "input",
103
+ "pair_chunk_size": 65536,
104
+ "checkpoint_pair_distances": false,
105
+ "periodic_image_radius": 1,
106
+ "periodic_fallback_max_candidates": 65536
107
+ }
108
+ },
109
+ "prior": {
110
+ "lattice": {
111
+ "type": "volume",
112
+ "length_log_std": 0.3,
113
+ "angle_std": 0.2
114
+ }
115
+ },
116
+ "sampler": {
117
+ "solver": "flow_2m",
118
+ "num_steps": 24,
119
+ "time_grid": "uniform",
120
+ "count_nfe": true
121
+ },
122
+ "uncertainty_weighting": {
123
+ "enabled": false,
124
+ "channels": 128,
125
+ "clamp": [
126
+ -4.0,
127
+ 4.0
128
+ ]
129
+ },
130
+ "diagnostics": {
131
+ "time_bucket_edges": [
132
+ 0.0,
133
+ 0.1,
134
+ 0.25,
135
+ 0.5,
136
+ 0.75,
137
+ 0.9,
138
+ 1.0
139
+ ]
140
+ }
141
+ },
142
+ "architectures": [
143
+ "FullCellCrystalDiT"
144
+ ],
145
+ "model_type": "sala"
146
+ }
model.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "format_version": 1,
3
+ "weights": "ema",
4
+ "ema_profile_std": 0.05,
5
+ "source_global_step": 249000,
6
+ "source_epoch": 175,
7
+ "trainable_parameters": 486282617,
8
+ "training_state_included": false,
9
+ "release_date": "2026-10-21",
10
+ "filename": "sala_ema.ckpt",
11
+ "bytes": 1945255862,
12
+ "sha256": "453db9f2dc8af7047d117b156ff3e8568789fbff349f2f3063577620b290804f",
13
+ "tensor_count": 335,
14
+ "floating_point_dtype": "float32",
15
+ "model_family": "sala_full_cell_crystal_dit_rectified_flow",
16
+ "checkpoint_schema_version": 16
17
+ }
sala_ema.ckpt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:453db9f2dc8af7047d117b156ff3e8568789fbff349f2f3063577620b290804f
3
+ size 1945255862