MaterialInverseDesignDemo / DEPLOYMENT.md
feiyang-cai's picture
Support ZeroGPU and T4 hosting
dc6ff35 verified
|
Raw
History Blame Contribute Delete
1.85 kB
# Hugging Face migration notes
This repository was pulled from:
- source Space: `https://huggingface.co/spaces/ChemFM/MaterialInverseDesignDemo`
Target destination:
- destination org: `https://huggingface.co/aim4composites`
## What changed for GPU hosting
- README front matter now recommends `suggested_hardware: t4-small`
- `spaces` is kept in `requirements.txt` so ZeroGPU can allocate GPU time through `@spaces.GPU`
- the app text now describes the Space as compatible with both ZeroGPU and dedicated GPU hardware
- runtime knobs were added so the thermoforming step can be tuned without code edits:
- `MG_DEFAULT_N_GENERATE`
- `MG_MAX_GENERATE`
- `MG_THERMO_RESTARTS`
- `MG_THERMO_EPOCHS`
## Recommended Hugging Face Space settings
1. Create a new Gradio Space under `aim4composites`.
2. Push this repository to that new Space.
3. In the Space hardware settings, choose either ZeroGPU or `Nvidia T4 small`.
4. Leave storage at the default unless larger artifacts are added later.
5. Restart the Space and verify generation completes. On `Nvidia T4 small`, logs should show CUDA is available. On ZeroGPU, CUDA is allocated when the decorated generation function runs.
## Suggested first validation pass
1. Open the Space and load the default test condition.
2. Run material inverse design with the default `3` candidates.
3. Select the top-ranked design.
4. Run thermoforming once with a small target example.
5. Confirm:
- the app starts successfully
- candidate generation completes
- thermoforming completes
- no out-of-memory or timeout errors appear in the logs
## Optional runtime tuning if the Space feels slow
Set these Space variables:
- `MG_DEFAULT_N_GENERATE=2`
- `MG_MAX_GENERATE=4`
- `MG_THERMO_RESTARTS=6`
- `MG_THERMO_EPOCHS=300`
If runtime remains comfortably fast, increase these gradually.