Skip to content

feat(validation): make the callable check usable on CPU and on any structure - #95

Merged
hydrogen1222 merged 2 commits into
mainfrom
feat/runtime-probe-cpu-gpu
Nov 14, 2026
Merged

hydrogen1222 merged 2 commits into
mainfrom
feat/runtime-probe-cpu-gpu

Conversation

@hydrogen1222

Copy link
Copy Markdown
Owner

Tracking: #61 (model-support spec §6.2). Draft: ready for independent review.

What was wrong

scripts/validate_runtime.py could not run at all (ImportError: cannot import name '_hash_model') and, when it did, hard-coded cuda:0, UMA's omat task, a Cu cell and
a v100- evidence prefix — so it could not check a CPU run, another structure or
another task.

What changes

  • Required --device cpu|cuda:N: a CPU run needs no GPU UUID and fails closed if the
    runtime reports CUDA; a CUDA run keeps the UUID/ordinal confirmation.
  • --structure (any ASE-readable file, 2-32 unconstrained atoms), recorded by SHA-256,
    symbols, cell and PBC — never by path.
  • --task: required for uma, bulk otherwise.
  • Evidence id names the device type; the hardware block is written only for GPU runs;
    peak-VRAM probe skipped on CPU. Report schema mliport.runtime-validation/2.
  • --full reuses the fixture and relaxes NEB endpoints.
  • Real-backend follow-ups: GRACE's GPU-only memory cap is no longer sent on CPU;
    dpa/grace require CUDA_VISIBLE_DEVICES isolation, so the probe refuses to start
    without it and prints the exact command.
  • Tests with a LennardJones stub (no weights, no GPU): argument handling, CPU/CUDA
    branches, isolation preflight, GRACE kwargs. docs/validation.md (+ .zh.md).

Evidence

All 15 in-scope MACE/DPA/GRACE profiles completed this probe on CPU and GPU on the
V100 host; the records are in #75.

Tests

pytest tests/mliport/mliport/test_validate_runtime_probe.py tests/mliport/mliport/test_docs_contract.py -q → 69 passed.

DATA IMPACT

No scientific record invalidated; no stored evidence rewritten. Old /1 records keep
their schema and ids.

…ructure

Tracking: #61 (model-support spec §6.2)

What was failing: scripts/validate_runtime.py did not import -- it asked
mliport.neb.workflow for _hash_model, which moved to mliport.model_record --
and it hard-coded device="cuda:0", UMA's "omat" task, a Cu cell and a "v100-"
evidence prefix. It could not check a CPU run, a different structure or a
non-UMA task, so it was not the reusable probe the model-support checks need.

What changes:
- --device (cpu | cuda:N) is required and validated. A cpu run needs no GPU
  UUID and now fails closed if the runtime reports a CUDA placement; a cuda:N
  run keeps the UUID confirmation, hashes the UUID as before, and additionally
  rejects a model that landed on another ordinal.
- --structure replaces the built-in rattled fcc Cu cell and is identified in
  the report by SHA-256, symbols, atom count, cell and PBC -- never by path.
- --task names the model task family: required for uma, "bulk" otherwise.
- The evidence id names the device type (cpu-.../cuda-...), the hardware block
  is written only for GPU runs, and the peak-VRAM probe is skipped on CPU.
- The report schema is mliport.runtime-validation/2; existing v100 records
  stay on /1.
- The five-image NEB of --full reuses the fixture and relaxes its endpoints, so
  the check measures the band rather than the fixture's initial forces.
- Real backends found three follow-ups, all fixed here: GRACE rejects the
  GPU-only gpu_memory_limit_mb on CPU; dpa and grace require process-level
  device isolation and refuse to run without CUDA_VISIBLE_DEVICES, so the probe
  now says so with the exact command instead of failing inside the adapter.
- tests/mliport/mliport/test_validate_runtime_probe.py drives argument
  handling, the CPU/CUDA branches, the isolation preflight and the GRACE
  kwargs with a LennardJones stub: no weights, no GPU, no downloads.
- docs/validation.md (+ .zh.md) documents the usage.

Evidence: all 15 in-scope MACE/DPA/GRACE profiles completed this probe on both
devices (see #75).

DATA IMPACT: no scientific record invalidated. No stored evidence was
rewritten; old records keep their schema and ids.
Resolve the CHANGELOG `Unreleased` conflict by keeping both entries: the
DPA-3.1 lossless-widening note from #98 and this branch's probe note. No code
file conflicted.

DATA IMPACT: none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GYQHUBfRm75zyaocAPWhEb
@hydrogen1222
hydrogen1222 marked this pull request as ready for review November 14, 2026 14:04
@hydrogen1222
hydrogen1222 merged commit 22bd005 into main Nov 14, 2026
14 checks passed
@hydrogen1222
hydrogen1222 deleted the feat/runtime-probe-cpu-gpu branch November 14, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants