|
| 1 | +--- |
| 2 | +name: matmaster-dpa4-workflows |
| 3 | +description: Run prepared DPA4 training, fine-tuning, inference, and LAMMPS cases on MatMaster/Bohrium. Use when an agent must stage persistent inputs, resolve Bohrium projects/images/GPU resources, generate and validate a job specification, submit or monitor jobs, collect outputs, recover checkpoints or restarts, and record platform provenance. Delegate scientific setup and acceptance to the installed DeePMD-kit skills. |
| 4 | +compatibility: Install with deepmd-train, deepmd-finetune-dpa4, deepmd-python-inference, and lammps-deepmd. Requires Python 3; production submission requires a MatMaster platform tool or a Bohrium CLI compatible with 2.5.17. |
| 5 | +license: LGPL-3.0-or-later |
| 6 | +metadata: |
| 7 | + author: MatMaster |
| 8 | + version: '1.0' |
| 9 | + repository: https://github.com/deepmodeling/deepmd-kit |
| 10 | +--- |
| 11 | + |
| 12 | +# Run DPA4 workflows on MatMaster |
| 13 | + |
| 14 | +Act only as the MatMaster/Bohrium platform layer. Own storage, resource |
| 15 | +resolution, job packaging, submission, monitoring, collection, and retry |
| 16 | +lineage. Do not own model architecture, training parameters, checkpoint/head |
| 17 | +selection, inference semantics, LAMMPS input design, or scientific acceptance. |
| 18 | + |
| 19 | +## Route scientific work |
| 20 | + |
| 21 | +- Use `deepmd-train` for a new DPA4 training case. |
| 22 | +- Use `deepmd-finetune-dpa4` for standard or LoRA fine-tuning. |
| 23 | +- Use `deepmd-python-inference` for Python inference or `dp test`. |
| 24 | +- Use `lammps-deepmd` for deployment, minimization, and MD. |
| 25 | + |
| 26 | +Require the owning skill to return a prepared case contract. If that skill is |
| 27 | +unavailable, install or reload the complete DeePMD-kit skill set instead of |
| 28 | +reconstructing its instructions here. |
| 29 | + |
| 30 | +Read references only when needed: |
| 31 | + |
| 32 | +- [workflow-handoffs.md](references/workflow-handoffs.md): required inputs, |
| 33 | + outputs, and acceptance boundary for each workflow; |
| 34 | +- [matmaster-operations.md](references/matmaster-operations.md): storage, |
| 35 | + resources, Bohrium CLI fallback, lifecycle, and recovery. |
| 36 | + |
| 37 | +## Execute |
| 38 | + |
| 39 | +### 1. Accept a prepared case |
| 40 | + |
| 41 | +Require a relative entry command, normally `bash run.sh`, plus all referenced |
| 42 | +files or durable paths, checksums, runtime/resource requirements, declared |
| 43 | +outputs, smoke-test criteria, and checkpoint/restart policy. Do not change the |
| 44 | +scientific command to fit an available resource. |
| 45 | + |
| 46 | +### 2. Inventory and stage |
| 47 | + |
| 48 | +Run: |
| 49 | + |
| 50 | +```bash |
| 51 | +python scripts/check_environment.py --case-dir CASE_DIR |
| 52 | +``` |
| 53 | + |
| 54 | +Use `--require-file`, `--require-deepmd`, and `--require-lammps` as required by |
| 55 | +the handoff. Keep durable inputs and results under `/personal` or `/share`. |
| 56 | +Use relative paths inside job packages; the Bohrium working directory is not a |
| 57 | +stable absolute path. |
| 58 | + |
| 59 | +### 3. Resolve execution resources |
| 60 | + |
| 61 | +Discover a real project ID, full image address, current machine type, wall |
| 62 | +time, and output destination. Never reuse a historical project, image tag, GPU |
| 63 | +SKU, or case count as a default. Prove image/data/output compatibility with the |
| 64 | +bounded smoke test supplied by the owning skill. |
| 65 | + |
| 66 | +### 4. Build and validate the job |
| 67 | + |
| 68 | +Generate a concrete job specification: |
| 69 | + |
| 70 | +```bash |
| 71 | +python scripts/make_job_spec.py CASE_DIR \ |
| 72 | + --output CASE_DIR/job.json \ |
| 73 | + --project-id PROJECT_ID \ |
| 74 | + --image FULL_IMAGE_ADDRESS \ |
| 75 | + --machine MACHINE_TYPE \ |
| 76 | + --name JOB_NAME |
| 77 | +``` |
| 78 | + |
| 79 | +Preview submission, then use the installed platform tool or the native Bohrium |
| 80 | +CLI dry run. Submit only after validation and explicit authorization. Stop if |
| 81 | +neither a submission tool nor a compatible `bohr` executable exists. |
| 82 | + |
| 83 | +### 5. Monitor and collect |
| 84 | + |
| 85 | +Reconcile every job/group ID with `assets/bohrium-job/manifest.json`. Download |
| 86 | +finished and failed cases, retain partial checkpoints/restarts, and run a |
| 87 | +filesystem/log first pass: |
| 88 | + |
| 89 | +```bash |
| 90 | +python scripts/audit_cases.py ROOT --json REPORT.json |
| 91 | +``` |
| 92 | + |
| 93 | +Add `--mode` and repeat `--require` for declared outputs. A scheduler success |
| 94 | +or file-audit pass is not scientific acceptance; return artifacts to the owning |
| 95 | +DeePMD skill. |
| 96 | + |
| 97 | +### 6. Recover the smallest subset |
| 98 | + |
| 99 | +Classify packaging, path, image, quota, queue, resource, interruption, and |
| 100 | +wall-time failures here. Route training divergence/configuration, checkpoint |
| 101 | +validity, inference correctness, model export, type mapping, LAMMPS input, and |
| 102 | +numerical failures back to the owning skill. Retry only invalid cases and set |
| 103 | +`retry_of`; never overwrite evidence from an earlier attempt. |
| 104 | + |
| 105 | +## Return the platform ledger |
| 106 | + |
| 107 | +Return persistent paths, project/image/machine selections, case/job/group and |
| 108 | +attempt mappings, expected/submitted/downloaded/platform-valid counts, retry |
| 109 | +lineage, logs, declared outputs, audit report, and unresolved platform risks. |
| 110 | +Keep the platform verdict separate from training, inference, MD, and scientific |
| 111 | +verdicts. |
0 commit comments