Skip to content

feat(data): add dpdata format conversion - #5565

Open
njzjz wants to merge 29 commits into
deepmodeling:masterfrom
njzjz:feat/dpdata-auto-conversion
Open

njzjz wants to merge 29 commits into
deepmodeling:masterfrom
njzjz:feat/dpdata-auto-conversion

Conversation

@njzjz

@njzjz njzjz commented Jun 20, 2026 •

Copy link
Copy Markdown
Member

Add automatic training/validation conversion through dpdata format and out_format (output_format alias), defaulting to cached deepmd/lmdb output. Multiple converted paths compose through the native data-group API.

Conversion lives in a loader-independent module, eliminating import cycles between path discovery, data configuration, and LMDB. The legacy data_system.process_systems signature delegates to the common path router.

Conversion tracks file metadata, small-file content, and directory-symlink targets and children, with cycle protection. Owned locks serialize writers, and source changes during conversion prevent publication of a valid cache manifest. Setup failures close readers already acquired for the task or data group.

LMDB adaptations preserve the legacy mixed-type natoms_vec invariant and exactly partition periodic/nonperiodic frames, including rare zero-cell frames outside the optional-label probe. Neighbor-statistics proxies likewise separate periodicity. The legacy adapter uses the common batch iterator for grouped sampling and progress restoration. Bulk key mapping stays in NumPy; availability indexes are reused until the optional tracked key set changes.

The sampling rule follows current master: prob_uniform gives each retained system the same long-run frame share, including unequal automatic batch sizes; it does not promise equal batch counts. Uniform passes remain bounded by the mean system frame count rather than expanding every system to the largest size.

Constraints:

  • Requires dpdata >=1.1.0 and an explicit model type_map for LMDB.
  • TF/TF2/JAX/pt_expt shared statistics adapters require matching mixed_type across every retained source, including separate groups. LMDB is mixed-type; NPY/HDF5 used alongside it must also provide real_atom_types.npy. Fixed composition can use this representation. The native PyTorch loader can combine fixed-type NPY/HDF5 and LMDB directly. Filtering precedes this check, and TensorFlow LMDB additionally needs a mixed-type-capable descriptor such as se_atten.
  • Conversion preserves labels by default (labeled: true). A labeled read failure never falls back to dropping labels. Only explicit labeled: false requests structure-only conversion; it cannot supply supervised targets. Label modes have separate cache keys, and schema 4 invalidates caches from the old implicit fallback.
  • On Windows, LMDB refresh stages a new directory and publishes it with rollback; close old cache readers first. POSIX retains dpdata's transactional overwrite.
  • Paddle rejects converted LMDB in every task's training/validation config before neighbor-stat I/O. Modifiers and explicit sys_probs also require another output such as deepmd/hdf5.
  • Conversion is eager per input path. Parsed arrays and intermediate copies must fit in RAM; split large inputs or preconvert offline. This limit is documented in the input schema and training guide.

Validation:

  • November 17 follow-up (a2ffd4831): 213 common/data/schema tests and 44 subtests, 101 PT/TF tests (including native TF inference), and all 5 real checkpoint/restart training comparisons pass. These include both grouped seed variants, real partially labeled ASE rejection and recovery, explicit structure-only conversion, invalid-cell grouping, and Linux-hosted simulation of the real dpdata Windows overwrite guard. The 57 conversion tests and 14 subtests also pass after the final platform-aware assertion changes. Ruff, formatting, whitespace checks, and commit hooks pass.

  • After the module extraction: 224 data/conversion/LMDB/PT-exportable tests and 38 subtests passed; three fresh-process import orders and real dpdata-to-TensorFlow conversion/neighbor statistics also passed.

  • Latest availability-cache and bulk-key regressions plus the conversion/LMDB suites: 175 tests and 30 subtests passed.

  • Final targeted data/LMDB/PT/PT-exportable run: 269 tests and 28 subtests passed. Earlier broader validation also covered compiled training, task cleanup, and the TensorFlow core inference scenario.

  • Paddle fail-fast cases: 4 passed; JAX setup cleanup: 2 passed; TF2 entrypoint/cleanup: 4 passed.

  • Real dpdata conversion and TensorFlow neighbor statistics passed, including rewriting energy 0 to 42 while restoring the old source mtime.

  • A complete two-step TensorFlow training/validation run from EXTXYZ finished, reduced loss, and saved its checkpoint.

  • Ruff, formatting, whitespace checks, and commit hooks passed.

Closes #5237.

Coding agent: Codex
Codex version: codex-cli 0.167.0
Model: gpt-6.1-sol
Reasoning effort: xhigh

Comment thread deepmd/utils/data_system.py Fixed
Comment thread deepmd/utils/data_system.py Fixed
Comment thread deepmd/utils/data_system.py Fixed
Comment thread deepmd/utils/data_system.py Fixed
@coderabbitai

coderabbitai Bot commented Jun 20, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
Walkthrough

The change adds dpdata-based conversion for configured training and validation inputs, LMDB data adapters and backend routing, and explicit data-system cleanup across training setup and execution paths. It also updates LMDB sampling behavior and adds tests and documentation for these changes.

Changes: Dataset conversion and training data lifecycle

Layer / File(s) Summary
Format configuration and conversion pipeline
deepmd/utils/argcheck.py, deepmd/utils/data_config.py, deepmd/utils/data_path.py, deepmd/utils/data_system.py, deepmd/entrypoints/test.py, pyproject.toml, doc/train/training-advanced.md, source/tests/common/test_data_system_conversion.py
Training and validation groups accept input format and output out_format settings. Non-DeePMD inputs can be converted with dpdata, cached, and resolved through process_systems. The project adds dpdata as a runtime dependency. Tests cover conversion, cache behavior, source changes, locking, and format detection.
LMDB reader, adapter, and statistics
deepmd/dpmodel/utils/lmdb_data.py, deepmd/utils/data_system.py, source/tests/common/dpmodel/test_lmdb_data.py, source/tests/common/test_data_system_conversion.py
Adds a legacy-shaped LMDB data adapter and grouped statistical views. LMDB reads handle box availability, frame inspection, bounded statistics, and cleanup. Block-target calculation validates sampling styles and weights. Tests cover adapter behavior, periodicity grouping, and sampling targets.
Backend routing and seeded LMDB sampling
deepmd/utils/data_system.py, deepmd/pt/utils/dataloader.py, deepmd/pt/utils/lmdb_dataset.py, deepmd/pd/entrypoints/main.py, source/tests/pd/test_conversion_validation.py, source/tests/pt/test_lmdb_dataloader.py, source/tests/pt_expt/test_lmdb_training.py, source/tests/common/test_data_system_conversion.py
Data construction validates backend support and LMDB options, and routes compatible inputs to LMDB readers. Paddle rejects LMDB data. The PyTorch LMDB dataset forwards seeds to its sampler, including list seeds converted with SeedSequence. Tests cover routing and reproducible batch order.
Data-system ownership and cleanup
deepmd/dpmodel/train/data.py, deepmd/tf/entrypoints/train.py, deepmd/tf2/entrypoints/train.py, deepmd/jax/entrypoints/train.py, deepmd/pt_expt/entrypoints/main.py, deepmd/utils/data_system.py, source/tests/common/dpmodel/test_train_data.py, source/tests/tf/test_train_cleanup.py, source/tests/tf2/test_training.py, source/tests/jax/test_training.py, source/tests/pt_expt/test_entrypoint.py
Training and data-construction paths close acquired systems when setup or training raises, and close temporary data after selected operations. Successfully created task maps and trainers retain ownership. Tests exercise cleanup and successful ownership transfer.

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant DataConfig
  participant process_systems
  participant dpdata
  participant get_data
  participant LmdbDataSystem
  DataConfig->>process_systems: pass input and output formats
  process_systems->>dpdata: load selected input paths and write converted data
  dpdata-->>process_systems: return converted data paths
  process_systems-->>get_data: provide resolved paths
  get_data->>LmdbDataSystem: construct adapter for LMDB data
Loading

Possibly related PRs

Suggested reviewers: wanghan-iapcm

Merge Risk: Low · previous review d6306

Large LMDB datasets used with TensorFlow, JAX, or TF2 may see slow or memory-heavy setup, because availability scans and index-list construction repeat when requirements are registered. Results and training behavior are not affected. This is a performance follow-up that can be addressed soon, and the PR is mergeable with awareness of it.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title clearly and concisely describes the pull request’s main change: adding automatic dpdata format conversion.
Linked Issues check Passed Issue [#5237] requires automatic conversion of public dataset formats through dpdata. The PR adds format and out_format configuration, format-aware discovery, dpdata conversion, a default `deepmd/…
Out of Scope Changes check Passed The LMDB adapter, backend validation, sampling updates, cache locking, cleanup paths, and related tests support use of converted data across the declared backends. The dependency and documentation cha…
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Linked Issues check

Explanation

Issue [#5237] requires automatic conversion of public dataset formats through dpdata. The PR adds format and out_format configuration, format-aware discovery, dpdata conversion, a default deepmd/lmdb output, cache invalidation, and conversion tests. The runtime dependency includes dpdata>=1.1.0. The training and test entry points forward the conversion settings. These changes implement automatic external-format conversion and format detection.

Full details: Out of Scope Changes check

Explanation

The LMDB adapter, backend validation, sampling updates, cache locking, cleanup paths, and related tests support use of converted data across the declared backends. The dependency and documentation changes support the same conversion workflow. The available PR evidence does not show a separate unrelated product change.

Finishing Touches

🧪 Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (4)
deepmd/utils/data_system.py (4)

1147-1162: ⚖️ Poor tradeoff

Recursive mtime scan may be slow for large source directories.

_source_mtime walks the entire source directory tree to find the latest modification time. For datasets with many files, this could add noticeable latency on every cache freshness check. Consider caching the computed mtime or using a faster heuristic (e.g., only checking top-level directory mtime plus a sample of files).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@deepmd/utils/data_system.py` around lines 1147 - 1162, The `_source_mtime`
function performs a full recursive directory walk using source.rglob("*") to
find the latest modification time across all files, which becomes inefficient
for large source directories. To improve performance, implement a caching
mechanism to store previously computed mtimes so that repeated calls for the
same source directory do not re-scan the entire tree, or alternatively replace
the full recursive scan with a faster heuristic that only examines the top-level
directory mtime and a representative sample of files rather than traversing
every single file.

786-796: 💤 Low value

Mixed-type detection scans all frames at initialization.

_detect_mixed_type iterates through every frame in the LMDB dataset comparing atom types, which could be slow for very large datasets (thousands of frames). Consider caching this property in the LMDB metadata during conversion, or adding a sampling heuristic for large datasets.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@deepmd/utils/data_system.py` around lines 786 - 796, The _detect_mixed_type
method iterates through all frames in the dataset to check for mixed atom types,
which is inefficient for large datasets. Implement caching by storing the
detection result as an instance variable after the first call, and consider
adding a sampling heuristic for datasets with many frames such that for very
large datasets (e.g., more than a configurable threshold), only a sample of
frames are checked instead of all frames. Update the method to return the cached
result on subsequent calls and use the sampling strategy to limit iterations
while still maintaining reasonable confidence in the mixed-type detection.

1395-1408: 💤 Low value

Single-LMDB fast-path only; consider documenting multi-LMDB limitation.

The LMDB routing only handles the case where systems resolves to exactly one LMDB path. If multiple LMDB paths are provided (or conversion produces multiple systems), they fall through to DeepmdDataSystem. Consider adding a log warning or updating docstring to clarify this behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@deepmd/utils/data_system.py` around lines 1395 - 1408, The code currently
only provides optimized handling for a single LMDB system through
LmdbDataSystem, while multiple LMDB systems silently fall through to
DeepmdDataSystem. Add a log warning message when multiple LMDB paths are
detected (when len(systems) > 1 and all are LMDB) to alert users that they will
be handled through the standard DeepmdDataSystem path rather than the optimized
LmdbDataSystem, and update the function's docstring to document this single-LMDB
fast-path behavior and clarify what happens with multiple LMDB inputs.

1219-1277: ⚖️ Poor tradeoff

Stale lock files may persist after process crashes.

If a process crashes after creating the lock file (line 1242) but before the finally block runs (e.g., SIGKILL), the .lock file will remain. Subsequent processes will wait 5 minutes before timing out. Consider adding stale-lock detection using the PID written to the lock file, or a timestamp-based staleness check.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@deepmd/utils/data_system.py` around lines 1219 - 1277, The
_convert_system_by_dpdata function creates lock files to coordinate between
processes, but if a process crashes after creating the lock file but before the
finally block executes, the lock file persists causing other processes to wait 5
minutes before timing out. Add stale lock detection logic in the except
FileExistsError block before calling _wait_for_conversion. Read the PID from the
existing lock file and check if that process is still running using
platform-appropriate methods (e.g., os.kill with signal 0 on Unix, or process
existence checks). If the process is not running or if the lock file is older
than a reasonable threshold (e.g., 10 minutes), remove the stale lock file and
retry the lock acquisition instead of waiting. This prevents indefinite hangs on
stale locks from crashed processes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@deepmd/pd/entrypoints/main.py`:
- Around line 123-144: The current LMDB validation checks for both
training_systems and validation_systems only reject LMDB when the result is a
single system (len(...) == 1), but the error messages indicate that Paddle does
not support LMDB data in general. Remove the len(...) == 1 condition from both
the training_systems check (around line 123) and the validation_systems check
(around line 139) so that any LMDB dataset is rejected regardless of whether
it's a single system or multiple systems in the list. This ensures that any
LMDB-resolved dataset triggers the NotImplementedError with a clear message,
preventing less clear failures downstream.

In `@deepmd/pt_expt/entrypoints/main.py`:
- Around line 118-132: The current code in _get_neighbor_stat_data only
validates the single-LMDB case with `if len(systems) == 1 and
is_lmdb(systems[0])`, but when format-based conversion produces multiple LMDB
paths, this check is skipped and execution falls through to get_data() instead
of raising an appropriate error for list-form LMDB systems. Add validation
guards in both _get_neighbor_stat_data and _build_data_system functions to
ensure that after process_systems() is called, if any LMDB systems are returned,
they are validated to not be in list form (similar to what _detect_lmdb_path
does), and raise a clear error before reaching the fallback get_data() or
DeepmdDataSystem paths.

In `@deepmd/pt/entrypoints/main.py`:
- Around line 197-204: Add a validation guard before the existing condition that
checks `len(systems) == 1 and is_lmdb(systems[0])` to prevent multiple LMDB
paths from being passed to DpLoaderSet. The guard should use
`isinstance(systems, list)` combined with `any(isinstance(s, str) and is_lmdb(s)
for s in systems)` to detect when systems is a list containing LMDB paths and
raise a clear ValueError message explaining that LMDB datasets must be passed as
a scalar string rather than as a list.

In `@deepmd/utils/data_system.py`:
- Around line 848-852: Add a defensive check at the beginning of the
`_stack_frames` method to guard against empty frames lists. Before accessing
`frames[0]` at line 864, add validation to check if the frames list is empty and
handle this edge case appropriately, such as raising a more informative error or
returning early. This will prevent IndexError when the sampler yields an empty
batch due to malformed LMDB data, since both `_load_set` and `get_batch` call
this method with frames lists derived from sampler indices.

---

Nitpick comments:
In `@deepmd/utils/data_system.py`:
- Around line 1147-1162: The `_source_mtime` function performs a full recursive
directory walk using source.rglob("*") to find the latest modification time
across all files, which becomes inefficient for large source directories. To
improve performance, implement a caching mechanism to store previously computed
mtimes so that repeated calls for the same source directory do not re-scan the
entire tree, or alternatively replace the full recursive scan with a faster
heuristic that only examines the top-level directory mtime and a representative
sample of files rather than traversing every single file.
- Around line 786-796: The _detect_mixed_type method iterates through all frames
in the dataset to check for mixed atom types, which is inefficient for large
datasets. Implement caching by storing the detection result as an instance
variable after the first call, and consider adding a sampling heuristic for
datasets with many frames such that for very large datasets (e.g., more than a
configurable threshold), only a sample of frames are checked instead of all
frames. Update the method to return the cached result on subsequent calls and
use the sampling strategy to limit iterations while still maintaining reasonable
confidence in the mixed-type detection.
- Around line 1395-1408: The code currently only provides optimized handling for
a single LMDB system through LmdbDataSystem, while multiple LMDB systems
silently fall through to DeepmdDataSystem. Add a log warning message when
multiple LMDB paths are detected (when len(systems) > 1 and all are LMDB) to
alert users that they will be handled through the standard DeepmdDataSystem path
rather than the optimized LmdbDataSystem, and update the function's docstring to
document this single-LMDB fast-path behavior and clarify what happens with
multiple LMDB inputs.
- Around line 1219-1277: The _convert_system_by_dpdata function creates lock
files to coordinate between processes, but if a process crashes after creating
the lock file but before the finally block executes, the lock file persists
causing other processes to wait 5 minutes before timing out. Add stale lock
detection logic in the except FileExistsError block before calling
_wait_for_conversion. Read the PID from the existing lock file and check if that
process is still running using platform-appropriate methods (e.g., os.kill with
signal 0 on Unix, or process existence checks). If the process is not running or
if the lock file is older than a reasonable threshold (e.g., 10 minutes), remove
the stale lock file and retry the lock acquisition instead of waiting. This
prevents indefinite hangs on stale locks from crashed processes.
🪄 Autofix (Beta)

❌ Autofix failed (check again to retry)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 54161e1f-c01b-4956-b3a7-a6ab0d33cb04

📥 Commits

Reviewing files that changed from the base of the PR and between 4b6506d and 37b3b76.

📒 Files selected for processing (7)
  • deepmd/pd/entrypoints/main.py
  • deepmd/pt/entrypoints/main.py
  • deepmd/pt_expt/entrypoints/main.py
  • deepmd/utils/argcheck.py
  • deepmd/utils/data_system.py
  • pyproject.toml
  • source/tests/common/test_data_system_conversion.py

Comment thread deepmd/pd/entrypoints/main.py Resolved
Comment thread deepmd/pt_expt/entrypoints/main.py Resolved
Comment thread deepmd/pt/entrypoints/main.py Resolved
Comment thread deepmd/utils/data_system.py Resolved
@codecov

codecov Bot commented Jun 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.47986% with 84 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.87%. Comparing base (d08ba98) to head (bf3ccd1).
⚠️ Report is 13 commits behind head on master.

Files with missing lines Patch % Lines
deepmd/utils/data_conversion.py 89.62% 41 Missing ⚠️
deepmd/tf/entrypoints/train.py 71.11% 13 Missing ⚠️
deepmd/utils/data_system.py 95.88% 13 Missing ⚠️
deepmd/pt/utils/dataloader.py 77.77% 6 Missing ⚠️
deepmd/dpmodel/utils/lmdb_data.py 97.00% 3 Missing ⚠️
deepmd/pt/utils/lmdb_dataset.py 83.33% 3 Missing ⚠️
deepmd/entrypoints/test.py 93.10% 2 Missing ⚠️
deepmd/tf/descriptor/hybrid.py 50.00% 1 Missing ⚠️
deepmd/utils/data_path.py 85.71% 1 Missing ⚠️
deepmd/utils/path.py 96.87% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5565      +/-   ##
==========================================
- Coverage   79.00%   78.87%   -0.13%     
==========================================
  Files        1253     1259       +6     
  Lines      152408   153516    +1108     
  Branches     5193     5227      +34     
==========================================
+ Hits       120412   121089     +677     
- Misses      30063    30493     +430     
- Partials     1933     1934       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai

coderabbitai Bot commented Jun 21, 2026 •

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

An unexpected error occurred while generating fixes: Not Found - https://docs.github.com/rest/git/refs#get-a-reference

@njzjz
njzjz marked this pull request as draft June 30, 2026 08:09
Break the LMDB/data-system import cycle, reject ambiguous multi-LMDB results across backends, reject LMDB on Paddle, and guard empty LMDB frame batches with direct regressions.

Coding-Agent: Codex
Codex-Version: codex-cli 0.144.4
Model: gpt-5.6-sol
Reasoning-Effort: xhigh
Resolve the data-loader conflicts while preserving dpdata format conversion, LMDB routing, and the new multi-LMDB validation behavior.

Coding-Agent: Codex
Codex-Version: codex-cli 0.144.4
Model: gpt-5.6-sol
Reasoning-Effort: xhigh
@njzjz

njzjz commented Jul 18, 2026 •

Copy link
Copy Markdown
Member Author

Possible reviewers based on changed lines, exact file history, and exact-file review history:

  • @wanghan-iapcm — 20 commits on changed files; 74 reviews on exact changed files (deepmd/dpmodel/utils/lmdb_data.py, deepmd/pd/entrypoints/main.py, deepmd/pt/entrypoints/main.py, deepmd/pt_expt/entrypoints/main.py, deepmd/utils/argcheck.py, deepmd/utils/data_system.py, pyproject.toml, source/tests/pt_expt/test_lmdb_training.py).
  • @iProzd — 29 commits on changed files (deepmd/dpmodel/utils/lmdb_data.py, deepmd/pt/entrypoints/main.py, deepmd/utils/argcheck.py, deepmd/utils/data_system.py, pyproject.toml).

No review request was made automatically.

Coding agent: Codex
Codex version: codex-cli 0.144.4
Model: gpt-5.6-sol
Reasoning effort: xhigh

Load the dpmodel LMDB helpers only after the legacy data-system module has initialized, preventing backend imports from re-entering a partially initialized module.

Coding-Agent: Codex
Codex-Version: codex-cli 0.144.4
Model: gpt-5.6-sol
Reasoning-Effort: xhigh
@njzjz
njzjz requested review from iProzd and wanghan-iapcm and removed request for iProzd and wanghan-iapcm July 18, 2026 07:24
deepmd.utils.data_system imports is_lmdb inside the validating function
rather than at module scope, so patching the import site no longer
resolves and mock raises AttributeError.
Copilot AI review requested due to automatic review settings July 27, 2026 12:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds dpdata-backed automatic dataset format conversion (with caching) to the DeePMD-kit training/validation data pipeline, defaulting converted outputs to LMDB and routing those datasets through backend-appropriate data loaders.

Changes:

  • Introduce format / out_format (output_format) options for training/validation datasets and wire them through TF/JAX legacy loaders, PyTorch, and PT-expt entrypoints.
  • Add an LMDB adapter (LmdbDataSystem) plus LMDB-path validation helpers to ensure backends either consume a single LMDB path or raise clear errors (notably for Paddle).
  • Add tests for conversion/caching behavior and LMDB validation, and promote dpdata>=1.0.1 to a runtime dependency.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
source/tests/pt_expt/test_lmdb_training.py Adds PT-expt validation tests ensuring converted LMDB resolves to exactly one path.
source/tests/common/test_data_system_conversion.py New unit tests for dpdata conversion defaults, caching behavior, and LMDB validation errors.
pyproject.toml Adds dpdata>=1.0.1 as a runtime dependency (removes it from test extras).
deepmd/utils/data_system.py Implements dpdata conversion + cache/locking, adds validate_lmdb_systems, and introduces LmdbDataSystem.
deepmd/utils/argcheck.py Documents and registers new format / out_format dataset options.
deepmd/pt/entrypoints/main.py Routes converted datasets through PT dataloaders and LMDB dataset path validation (incl. neighbor-stat path).
deepmd/pt_expt/entrypoints/main.py Adds conversion-aware system processing and LMDB validation for PT-expt training + neighbor-stat.
deepmd/pd/entrypoints/main.py Ensures Paddle rejects LMDB-resolved datasets with a clear error.
deepmd/dpmodel/utils/lmdb_data.py Removes data_system import dependency to avoid cycles by computing prob weights locally.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread deepmd/utils/data_system.py Resolved
Comment thread deepmd/utils/data_system.py Resolved
Comment thread deepmd/utils/data_system.py Resolved
Coding-Agent: Codex
Codex-Version: codex-cli 0.144.6
Model: gpt-5.6-sol
Reasoning-Effort: xhigh
Copilot AI review requested due to automatic review settings August 1, 2026 14:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Suppressed comments (4)

deepmd/utils/data_system.py:1205

  • If the converting process crashes after creating the lock file, the .lock can persist indefinitely and every future run will wait ~5 minutes and then fail. Consider adding stale-lock recovery: include PID+timestamp in the lock file and, when waiting, remove the lock if it's older than a threshold and the recorded PID is not alive (or the lock mtime is старе than threshold). This avoids permanent failure modes on shared filesystems/cluster retries.
def _wait_for_conversion(source: Path, output: Path, lock_path: Path) -> bool:
    for _ in range(300):
        if not lock_path.exists():
            return _is_conversion_current(source, output)
        if _is_conversion_current(source, output):
            return True
        time.sleep(1.0)
    return False

deepmd/utils/data_system.py:1148

  • When format='auto' and systems points to a directory (common for existing DeePMD npy/raw datasets), suffix is empty and this returns 'auto', which then forces dpdata conversion via process_systems() even though the input may already be valid DeePMD data. This can lead to unexpected conversion attempts or failures. A concrete fix is to treat directory inputs specially under auto: detect DeePMD directory structure (e.g., set.* + type_map.raw/type.raw/coord.npy) and skip conversion (set fmt=None), otherwise fall back to suffix-based inference for files.
def _normalize_dpdata_format(fmt: str, source: Path) -> str:
    fmt = fmt.lower()
    if fmt == "ase":
        return "ase/structure"
    if fmt != "auto":
        return fmt
    suffix = source.suffix.lower().lstrip(".")
    if suffix == "traj":
        return "ase/traj"
    if suffix == "extxyz" or (suffix == "xyz" and _looks_like_extxyz(source)):
        return "extxyz"
    return suffix or fmt

deepmd/utils/data_system.py:40

  • PR description says converted datasets are cached under an absolute path (/home/jzzeng/codes/deepmd-kit/.deepmd_dpdata_cache), but the implementation caches under Path.cwd() / '.deepmd_dpdata_cache'. Please update the PR description to match the implemented behavior, or (if the absolute path is intended) implement/configure the absolute cache location (e.g., via an env var or config key).
_DPDATA_CACHE_DIR = ".deepmd_dpdata_cache"

deepmd/utils/data_system.py:1189

  • For directory sources this walks the entire tree (rglob('*')) to compute freshness, and it can be called repeatedly (e.g., per process_systems() invocation and during lock waits). On large datasets this becomes a noticeable overhead. A more scalable approach is to scope the scan to only the selected conversion inputs (especially when patterns is provided), cache the computed source timestamp per (source, cwd) within the process, or use a cheaper invalidation scheme (e.g., top-level mtime + a manifest hash) to avoid full-tree scans.
def _source_mtime(source: Path, cache_file: Path) -> float:
    if source.is_file():
        return source.stat().st_mtime
    if not source.is_dir():
        return 0.0
    cache_dir = cache_file.parent.resolve(strict=False)
    latest = source.stat().st_mtime
    for item in source.rglob("*"):
        try:
            item_resolved = item.resolve(strict=False)
            if item_resolved == cache_file or cache_dir in item_resolved.parents:
                continue
            latest = max(latest, item.stat().st_mtime)
        except OSError:
            continue
    return latest

Comment thread deepmd/dpmodel/utils/lmdb_data.py Resolved
Comment thread deepmd/utils/data_system.py Resolved
Reject invalid auto-probability weights before normalization and prevent cache cleanup from following directory symlinks. Add focused regression coverage for both validation paths.

Coding-Agent: Codex
Codex-Version: codex-cli 0.144.6
Model: gpt-5.6-sol
Reasoning-Effort: xhigh
Copilot AI review requested due to automatic review settings August 1, 2026 16:23
@njzjz
njzjz requested a review from iProzd November 27, 2026 06:45
Preserve JAX batch configuration and data cleanup, the shared NumPy LMDB
adapter, and deterministic native PyTorch LMDB seeding.

Coding-Agent: Codex
Codex-Version: codex-cli 0.172.0
Model: gpt-6.2-sol
Reasoning-Effort: xhigh

@OutisLi OutisLi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rechecked the updated head af1e755f. The previous merge conflicts are resolved; I am not asking for another conflict-resolution pass. Two data-integrity issues remain. I reproduced both on this head with dpdata 1.1.0 and small labeled EXTXYZ inputs.

  1. A new HDF5 reader can silently return the old energy after a successful refresh. Convert one H atom with energy 1 to deepmd/hdf5 and read its energy via DPPath. Change only the source energy to 42, call process_systems again in the same process, and construct a new DPPath. Opening the published file afresh with h5py returns 42; the new DeePMD reader returns 1. Publication replaces the file at the same pathname, but the reader caches its open handle by pathname and mode. New readers must resolve the newly published file, without globally closing handles that existing readers still own.

  2. A process can silently omit a training system published by another process. Process A converts EXTXYZ to deepmd/npy and discovers H1. Add an H2 frame and let process B complete conversion: B discovers both systems. After B exits, A calls process_systems again and still gets only H1. The fast path validates the current disk manifest but returns a list expanded for an earlier publication. Rediscover the systems on a disk-cache hit, or bind the memoized list to the exact source signature/publication it describes. Clearing only the writer's process-local cache cannot fix another reader.

Please fix freshness in the shared conversion/discovery and reader layers, and add these two public-path regressions. The contract is for new reads after completed publication, not hot-reloading an active training iterator. It should hold for training and validation on every backend that accepts the chosen output format. This does not require a new Paddle LMDB reader: Paddle can use explicit NPY/HDF5; the LMDB and mixed-type restrictions should remain explicit. One regression per distinct cache mechanism is more useful than duplicating the same tests per backend.

@wanghan-iapcm wanghan-iapcm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This review re-checks the current head af1e755f (the 22 threads from my earlier reviews on this PR are all addressed at this commit).

One blocking finding: the conversion-lock liveness probe calls os.kill(pid, 0), which on Windows terminates the process it is supposed to probe. Details in the inline comment.

if expected_start is not None and current_start is not None:
return str(expected_start) == current_start
try:
os.kill(pid, 0)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Windows this liveness probe can terminate the process it is meant to observe.

Trigger. Windows with Python 3.10/3.11 (the win_amd64 wheel is cp311 and requires-python is >=3.10), two processes converting the same source. _process_start_time reads /proc/<pid>/stat, which does not exist there, so both the owner's stored token and the current lookup are None; the token comparison above is skipped and this os.kill(pid, 0) runs on the first poll of a live lock. No staleness is involved.

Call chain. deepmd.utils.data_path.process_systems -> _convert_system_by_dpdata (line 541) -> _ConversionLock(lock_path) raises FileExistsError (line 583) -> _wait_for_conversion (line 448) -> _recover_stale_conversion_lock (line 399) -> _lock_owner_is_alive -> os.kill(pid, 0) here.

Consequence. In CPython's Windows os.kill, sig == 0 is CTRL_C_EVENT; when GenerateConsoleCtrlEvent fails for a pid that is not a console process-group leader (the normal case), 3.10/3.11 fall through to TerminateProcess(handle, 0). The waiting process therefore terminates the process that is doing the conversion with exit code 0 -- it looks like a clean exit, but no cache or manifest is published -- and then fails itself; on 3.12+ the same call raises an uncaught OSError in the waiter instead. This is exactly the concurrent-conversion scenario the lock exists for, so the Windows coordination path is destructive rather than serializing.

Evidence boundary. No Windows host was available for this review: the deepmd side is read at af1e755f, and the os.kill semantics come from CPython Modules/posixmodule.c (3.10, 3.11, 3.12, main) plus the Windows SDK's CTRL_C_EVENT == 0, not from a run. A platform-independent liveness decision for this branch (e.g. treating "no start token" as unknown instead of probing with os.kill) would not depend on that semantics.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 66457d103. Liveness probing now calls os.kill(pid, 0) only on POSIX. On Windows, a same-host owner with unknown liveness is left alone; if its heartbeat stalls, the waiter reports an error rather than evicting the lock. The regression exercises both a fresh and an expired heartbeat with the Windows branch enabled and asserts that no signal is sent. This was not run on a native Windows host.

Coding agent: Codex
Codex version: codex-cli 0.172.0
Model: gpt-6.2-sol
Reasoning effort: xhigh

Rediscover systems after any cache publication, reuse HDF5 handles only
for the same file identity, and never signal conversion owners on Windows.

Coding-Agent: Codex
Codex-Version: codex-cli 0.172.0
Model: gpt-6.2-sol
Reasoning-Effort: xhigh
@njzjz

njzjz commented Nov 27, 2026

Copy link
Copy Markdown
Member Author

The two freshness findings from OutisLi’s review are fixed in 66457d103. A new HDF5 path reuses a handle only if it names the same file identity; paths derived from an existing reader stay on that reader’s snapshot. Conversion now rediscovers NPY/HDF5 systems on disk-cache hits rather than returning a process-local list. The public-path tests cover an energy refresh from 1 to 42 while the old reader remains open, and an independent process publishing H1 plus H2. The conversion, path, statistics-file, and TensorFlow single-frame tests passed (98 tests and 10 subtests).

Coding agent: Codex
Codex version: codex-cli 0.172.0
Model: gpt-6.2-sol
Reasoning effort: xhigh

@OutisLi OutisLi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous HDF5 and cross-process discovery freshness findings are addressed at this head. Please simplify the legacy LMDB startup path before merging and measure the impact separately on a large dataset. Keep the exact periodic/nonperiodic grouping; replacing it with a sampled check would reintroduce a correctness issue.

Comment thread deepmd/utils/data_system.py Outdated
self._test_data.add_data_requirement(data_requirements)
for item in data_requirements:
self._data_dict[item.key] = item.dict
self._refresh_groups()

@OutisLi OutisLi Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add() calls this path for a single requirement, so several consecutive registrations can rebuild the same statistics/validation views, allocate a new dataset-sized selection mask, and remap all frame indices repeatedly. The reader already distinguishes unchanged availability keys from changes that invalidate its partition. Please reuse that distinction (or defer materializing the views until the requirements are complete) so unrelated registrations do not repeat the dataset-wide work. Keep per-key requirement updates and exact grouping when the availability contract really changes. A focused regression counting rebuilds is enough. Separately report wall time and peak RSS on the same large LMDB and machine before/after the change, breaking out reader/index construction, label registration/view assembly, and first-batch readiness. Please measure existing LMDB startup without dpdata conversion in that timed region and report the dataset size/frame count and the filesystem.

Measured follow-up at 66457d10: on a 1,000,000-frame synthetic LMDB (655 MiB, Linux tmpfs, all energy/force labels present, one nonperiodic frame), registering energy and force together as tracked must=False requirements triggers a second exact scan. The constructor took 27.67 s (21.65 s scanning box); grouped registration took another 21.90 s (21.85 s scanning box, energy, and force), before a 5.6 ms first batch. This is one run of the legacy adapter, not a production-filesystem benchmark. Please test the tracked optional-label case as well as unchanged keys: simply reusing unchanged views will not avoid this second scan. If there is no legitimate early consumer, defer both initial grouping and the sampler-length query until the requirements are known, while keeping exact PBC partitioning.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 6e78ba979.

The legacy adapter now defers view construction and the nominal pass-length query. It still forwards every requirement, but keeps existing views and the sampling plan when the availability keys do not change. The regression covers tracked optional energy and force, a truly changed contract after early access, and unchanged-key updates. It checks scan/view counts and exact missing-label/PBC boundaries.

Measured startup, 66457d10 vs this commit: same 1,000,000-frame synthetic LMDB, 458,653,696 bytes (437.4 MiB), on Linux tmpfs on the same AMD EPYC 7K62 machine, pinned to the same CPU. All frames had energy/force labels, and one was nonperiodic. Batch size 64, seed 2026, one run per revision, existing LMDB only (generation and dpdata conversion excluded). Registration timing includes fetching the views and nominal batch count so the deferred work is included.

Phase Wall before Wall after Parent peak RSS before Parent peak RSS after
Reader/index construction 32.00 s 0.10 s 213.4 MiB 188.9 MiB
Optional-label registration, views and pass length 33.68 s 33.82 s 222.5 MiB 213.2 MiB
First batch after setup 11.3 ms 11.2 ms 229.6 MiB 220.7 MiB

Total to first batch: 65.69 s → 33.93 s. Exact scans: box-only plus box/energy/force → one box/energy/force scan. RSS is the cumulative high-water mark at each phase boundary. The scan helper's per-child peak RSS was 590.6 MiB before and 590.8 MiB after, measured separately (not summed with the parent peak).

Validation: conversion, common LMDB, native PyTorch LMDB, and single-frame TensorFlow tests passed across the runs (299 tests, 42 subtests); Ruff passed.

Coding agent: Codex
Codex version: codex-cli 0.172.0
Model: gpt-6.2-sol
Reasoning effort: xhigh

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rechecked 5c14a707: the shared PT-expt/JAX adapter now defers the scan for one LMDB. The grouped startup path still scans each leaf twice. Both entrypoints print data summaries before registering loss requirements; GroupedDataSystem.print_summary() asks for exact component probabilities, which materializes the child batch plans with only box registered. Registering optional energy/force then invalidates that index.

I reproduced this with two real small LMDBs using the shared adapter and the same call order: print_summary → add_data_requirements with optional E/F → first stats/batch-plan access. Each leaf scanned once for box and again for box/energy/force. Moving the same summary after registration reduced this to one scan per leaf and preserved final batch counts (4 and 2) and the separation of periodic/nonperiodic frames. This is an adapter-level reproduction, not a full trainer benchmark.

Please defer exact grouped probability logging until requirements are registered, or make the early summary metadata-only. A focused two-source regression using the entrypoint order and checking one exact scan per leaf would cover the remaining case.

Defer the initial LMDB views and pass sizing until requested.
Reuse exact groups and sampling plans for unchanged availability keys.

Coding-Agent: Codex
Codex-Version: codex-cli 0.172.0
Model: gpt-6.2-sol
Reasoning-Effort: xhigh
@njzjz
njzjz requested a review from OutisLi November 28, 2026 12:23
Publish converted LMDBs as immutable generations so live readers remain consistent, and defer experimental adapter statistics scans until label registration is complete.

Coding-Agent: Codex
Codex-Version: codex-cli 0.172.0
Model: gpt-6.2-sol
Reasoning-Effort: xhigh

@wanghan-iapcm wanghan-iapcm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A re-review of the two commits since the previous round (per-generation LMDB publication and deferred legacy availability grouping). No blocking issue was found.

Four points on the HDF5 handle/signature layer, unchanged by these commits but still live at this head:

  1. deepmd/utils/path.py:334 — a handle keyed only by stat identity is returned after a cache refresh on filesystems whose st_ino is constant or zero, so a new reader keeps the pre-refresh snapshot.
  2. deepmd/utils/data_conversion.py:252 — directory dedup by (st_dev, st_ino) prunes unrelated subtrees when inode numbers are not unique, so nested source edits leave the signature unchanged.
  3. deepmd/utils/data_conversion.py:425 — without /proc start tokens, a successful os.kill(pid, 0) is taken as proof of life; a reused PID leaves the waiter in an unbounded loop.
  4. deepmd/utils/path.py:439 — the weak-key pending-names map can drop entries for a file whose writer handle was collected while an equal handle is still live, so flushed datasets can be reported missing.

Comment thread deepmd/utils/path.py
with cls._open_lock:
info = os.stat(path)
# Atomic publication replaces the inode, not the existing handle.
key = (path, mode, info.st_dev, info.st_ino)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shared-handle key is (realpath, mode, st_dev, st_ino), so it changes only when the stat identity changes. On filesystems that report a constant or zero st_ino (some network and FUSE mounts), the key is effectively just the path: a handle opened before a cache refresh is returned to a reader created after the refresh, and the new reader keeps reading the pre-refresh dataset. That contradicts the documented guarantee that a new reader sees the refreshed labels. This was reproduced at 66457d1 by forcing st_ino=0: the reader constructed after the cache replacement returned the old values. Keying on something that changes with publication (mtime/size, or an explicit generation), or bypassing the shared cache when the identity is not distinguishing, would avoid the stale snapshot.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a0e12dd81. Read-only handle reuse now checks the file's timestamps and size as well as its device and inode, and bypasses the Python handle cache for a zero inode. Descendant paths stay pinned to the parent handle. The EXTXYZ-to-HDF5 regression forces a constant nonzero inode and verifies that a new reader sees energy 42 while the original reader still sees 1. The full local validation passed: 124 tests and 12 subtests, including TensorFlow single-frame inference.

Coding agent: Codex
Codex version: codex-cli 0.172.0
Model: gpt-6.2-sol
Reasoning effort: xhigh

).encode()
)
if identity in visited:
dirs[:] = []

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_source_signature prunes a directory subtree whenever (st_dev, st_ino) was already visited. On filesystems where inode numbers are not unique (FAT/exFAT/ReFS/FUSE-style volumes), the first directory's identity matches unrelated later directories, so their files are never hashed and edits below them leave the digest unchanged. The manifest then matches and a stale conversion is judged current. With st_ino=0 forced, editing a nested system file produced an identical digest at 66457d1. The dedup is only sound when identity is unique; otherwise it needs a realpath or root-relative component in the visited key.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a0e12dd81. The source walk now deduplicates directories by resolved path rather than by device and inode. Distinct subtrees remain visible even when they report the same inode, while symlink aliases and back edges are still visited at most once. The regression forces zero directory inodes and verifies that editing a nested file changes the signature; the existing symlink cycle test also passed.

Coding agent: Codex
Codex version: codex-cli 0.172.0
Model: gpt-6.2-sol
Reasoning effort: xhigh

Comment thread deepmd/utils/data_conversion.py Outdated
except ProcessLookupError:
return False
except PermissionError:
return True

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When /proc start tokens are unavailable (macOS, restricted /proc), both expected_start and current_start are None, and this path treats a successful os.kill(pid, 0) as proof of life. If the owner died and its PID was reused, the lock is never recovered: _recover_stale_conversion_lock never evicts it and _wait_for_conversion loops without a timeout, bypassing both the lease and the error path. PID liveness is not a stable identity; an upper bound on the wait (then raise) would keep this fallback from hanging.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a0e12dd81. A successful signal-zero probe (or a permission error) no longer confirms that the PID belongs to the writer. When the start token is unavailable, a fresh heartbeat still protects the writer; after lease expiry the waiter reports the unverifiable owner without deleting the lock. The regression covers a live but unverifiable PID and checks that the wait ends at expiry.

Coding agent: Codex
Codex version: codex-cli 0.172.0
Model: gpt-6.2-sol
Reasoning effort: xhigh

Comment thread deepmd/utils/path.py Outdated

__file_new_keys: ClassVar[dict[h5py.File, list[str]]] = {}
_file_keys: ClassVar[WeakKeyDictionary[h5py.File, list[str]]] = WeakKeyDictionary()
_file_new_keys: ClassVar[WeakKeyDictionary[h5py.File, list[str]]] = (

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_file_new_keys is a WeakKeyDictionary: entries are dropped when the key object is collected, while lookups are by handle equality (h5py handles for the same file compare and hash equal regardless of mode). With two live handles for one file, collecting the writer handle drops the "names written since the last scan" state even though an equal reader handle still uses it, after which is_file/glob report the flushed dataset as missing. This was reproduced at 66457d1 with two simultaneous handles; no in-repo caller currently does that, but the equality-based contract makes it reachable. An explicit-release dict keyed by the same identity, or storing pending names on the handle holder rather than in a weak map, avoids the lifetime mismatch.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a0e12dd81. Removed the weak-key namespace caches. File and group checks now query the live HDF5 handle, and glob traverses only the requested group. The regression opens separate writer and reader handles, flushes a new dataset, drops the writer, and verifies that both is_file and glob still see it from the reader.

Coding agent: Codex
Codex version: codex-cli 0.172.0
Model: gpt-6.2-sol
Reasoning effort: xhigh

Distinguish refreshed HDF5 snapshots and scan canonical source paths independently of inode uniqueness. Consult live HDF5 names and honor the heartbeat lease when a conversion owner cannot be verified.

Coding-Agent: Codex
Codex-Version: codex-cli 0.172.0
Model: gpt-6.2-sol
Reasoning-Effort: xhigh
Comment thread deepmd/utils/data_conversion.py Fixed

@OutisLi OutisLi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The single-LMDB startup improvement is useful, and the later HDF5/cache identity fixes do not change the remaining grouped LMDB startup issue. On the grouped PT-expt/JAX path the startup summary materializes exact sampling probabilities before optional loss labels are registered. That builds per-leaf plans using just box; registering optional energy/force invalidates them, so each leaf is scanned again. I reproduced the repeated scan with two real LMDBs. The reported 1M-frame single-source benchmark does not cover this path.

Please defer exact grouped probabilities until loss requirements are registered, or make the preliminary summary metadata-only. Keep exact periodic/nonperiodic grouping. Add a small two-leaf scan-count regression with the same final probabilities, and separately report startup to first batch on a genuinely large grouped LMDB dataset.

Keep GroupedDataSystem.print_summary metadata-only until child LMDB
batch plans are materialized so preliminary startup summaries do not
scan leaves with box-only availability before optional loss requirements
are registered. Also invalidate cached grouped sampling weights in
legacy add/add_dict and replace the empty PermissionError handler in
data_conversion._lock_owner_is_alive with an explicit return.

Coding-Agent: Antigravity
Antigravity-Version: 1.5.23
Model: Gemini 4 Neon (High)
Reasoning-Effort: high
@njzjz-bot

Copy link
Copy Markdown
Contributor

Pushed e122daee0 addressing the remaining review and CodeQL findings:

  1. Grouped LMDB startup summary (OutisLi's review):

    • Added has_cached_plan on LmdbBatchSampler / DistributedLmdbBatchSampler and sampling_weights_ready on both LmdbDataSystem adapters and GroupedDataSystem.
    • GroupedDataSystem.print_summary() now stays metadata-only (logging configured/deferred group probability notes plus each leaf's metadata summary) whenever any child LMDB lacks a cached sampling plan for its current availability/layout contract, and logs exact batch probabilities once plans are built (or immediately for NPY/HDF5 groups).
    • Also invalidated cached grouped sampling weights in legacy GroupedDataSystem.add() and add_dict().
    • Exact periodic/nonperiodic partitioning and final group probabilities/batch counts are unchanged.
    • Added two-leaf regressions (test_grouped_lmdb_summary_defers_scan_until_requirements_are_registered and test_grouped_lmdb_configured_prob_summary_and_legacy_add_invalidation) covering both the native (pt_expt/jax) and legacy (tf/tf2) adapters and both prob_sys_size and prob_uniform in the entrypoint order (print_data_summaries → add_data_requirements → stats/probabilities/first batch), verifying exactly 1 exact scan per leaf with ("box", "energy", "force"), identical final probabilities and batch counts [4, 2], and exact PBC separation.
  2. CodeQL empty except alert (deepmd/utils/data_conversion.py:425):

    • Replaced except PermissionError: pass in _lock_owner_is_alive() with an explicit return None and explanatory comment.

Measured grouped LMDB startup (a0e12dd81 vs e122daee0): two-leaf synthetic LMDB on Linux tmpfs (/dev/shm), leaf_a = 600,000 frames (295.8 MiB) + leaf_b = 400,000 frames (197.2 MiB) = 1,000,000 frames / 493.0 MiB total, AMD EPYC 7K62 pinned to CPU 0, batch size 64, seed 2026, all frames labeled with energy/force and 1 nonperiodic frame per leaf, existing LMDBs only (generation and dpdata conversion excluded), using the native pt_expt/jax adapter (num_workers=0, auto_prob="prob_sys_size"):

Phase Wall before Wall after Exact scans before Exact scans after
Grouped reader construction 0.101 s 0.105 s 0 0
print_data_summaries 29.751 s 0.000 s 2 (box) 0
Optional-label registration, stats & batch plan 30.726 s 31.165 s +2 (box/energy/force) 2 (box/energy/force)
First batch 10.27 ms 11.48 ms — —
Total startup to first batch 60.588 s 31.282 s 4 2

Final parent peak RSS: 580.2 MiB → 470.3 MiB. Both runs produced identical stat_nsystems=4, nbatches=[9376, 6251], and component_probabilities=[0.599987, 0.400013].

Local validation (Python 3.10.12 worktree):

  • ruff check, ruff format --check, git diff --check, and all pre-commit hooks (isort, ruff, pylint, whitespace/EOF) passed across all touched files.
  • Passed: new grouped LMDB summary/invalidation regressions (4 tests, 6 subtests), test_lmdb_data.py (common/JAX/TF/TF2) + pt_expt/test_entrypoint.py (155 passed, 1 skipped, 30 subtests), pt/test_lmdb_dataloader.py group/uniform/summary subset (19 passed), pt_expt/test_data_progress_restart.py grouped subset (3 passed), tf/test_train_cleanup.py, tf/test_dp_test.py::TestDPTestEner::test_1frame, and pt_expt/test_lmdb_training.py (44 passed, 8 subtests; 1 torch.compile test failed locally due to missing Python.h on host; 7 real dpdata>=1.1.0 conversion tests could not pass locally because the local venv has dpdata 1.0.2).
Coding agent: Antigravity
Antigravity version: 1.5.23
Model: Gemini 4 Neon (High)
Reasoning effort: high

@OutisLi OutisLi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The extra startup scan is gone in the legacy adapter. On the same one-million-frame LMDB fixture, time to first batch dropped from 53.10 s to 25.84 s with identical batch counts and sampling weights. The conversion suite passed locally (67 tests and 16 subtests).

@wanghan-iapcm wanghan-iapcm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at e122dae. Two findings, both on the conversion path.

  1. The cache name is built from the source stem and gains a 16-hex digest plus a 32-hex generation, so a legal 189-byte stem produces a 256-byte component and conversion aborts with OSError: [Errno 36].
  2. The fallback intended for formats without a MultiSystems reader also catches per-frame ValueError, and the single-system retry reads only the first frame, so a partially labeled multi-frame input is silently truncated and the truncated result is cached.

stem = source_resolved.stem or source_resolved.name or "dataset"
safe_out_fmt = out_fmt.replace("/", "-")
suffix = ".lmdb" if _is_dpdata_lmdb_format(out_fmt) else ""
return Path.cwd() / _DPDATA_CACHE_DIR / f"{stem}-{safe_out_fmt}-{digest}{suffix}"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_conversion_cache_path builds the cache basename as f"{stem}-{safe_out_fmt}-{digest}{suffix}", and _lmdb_generation_path appends -<32 hex>.lmdb. With the default out_format (deepmd/lmdb) the published basename is stem + 67 bytes, so a source whose stem is 189 bytes or longer — a perfectly legal file name — yields a 256-byte component and the first write fails with OSError: [Errno 36] File name too long (a 188-byte stem gives exactly 255 and still works). Nothing truncates or hashes the stem and no validation rejects the input.

Trigger. Non-native format (e.g. extxyz), out_format omitted (defaults to deepmd/lmdb), source stem length S >= 189 bytes.

Call chain. resolve_data_groups -> _convert_system_by_dpdata -> _conversion_cache_path (S+34) -> _lmdb_generation_path (S+67) -> multi_systems.to -> OSError.

Consequence. Training aborts during data setup with a bare OSError; renaming the input or choosing another out_format (threshold ~S=208) is the only workaround.

Evidence boundary. Code read at HEAD plus standard POSIX NAME_MAX semantics; no run with a 189-byte name.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 869f92375. _conversion_cache_path now truncates the readable stem to at most 48 UTF-8 bytes and the sanitized output format to at most 32 UTF-8 bytes on valid UTF-8 character boundaries, while keeping the full resolved source path in the 16-hex SHA-256 digest. That keeps the cache path (<= 103 B), the 32-hex LMDB generation path (<= 136 B), and dpdata's .tmp-* staging directory (<= 150 B) well below POSIX NAME_MAX (255 B). Added regression coverage for distinct 220-byte ASCII stems sharing a long prefix and a 240-byte multi-byte UTF-8 stem.

Coding agent: Antigravity
Antigravity version: 1.5.24
Model: Gemini 4 Neon (High)
Reasoning effort: high

Comment thread deepmd/utils/data_conversion.py Outdated
multi_systems = dpdata.MultiSystems()
try:
multi_systems.load_systems_from_file(str(source), fmt=fmt, labeled=labeled)
except (NotImplementedError, ValueError) as load_error:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

except (NotImplementedError, ValueError) is intended for formats that implement the single-system reader but not the MultiSystems reader, but the same except also catches a ValueError raised by per-frame validation during the MultiSystems load. The fallback then reads the input with LabeledSystem(...), and dpdata's single-system reader returns only the first frame, so a multi-frame file whose first frame carries an energy and a later frame does not is silently converted to a one-frame dataset and published to the cache. Minimum trigger: two frames, frame 1 labeled, frame 2 unlabeled.

Trigger. format: extxyz (or auto on a .xyz/.extxyz path), labeled left at its default true, and any later frame missing the energy field.

Call chain. process_systems -> _convert_system_by_dpdata -> _write_dpdata_conversion -> load_systems_from_file (ValueError) -> LabeledSystem(...) (first frame only) -> MultiSystems(system) -> manifest publish.

Consequence. Training or validation silently runs on a truncated dataset and the poisoned conversion is cached, contradicting the contract stated in this module that a failed labeled read must never discard labels or publish unsupervised data.

Evidence boundary. deepmd and dpdata v1.1.0 source reading; no end-to-end run.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 869f92375. _write_dpdata_conversion now queries dpdata.format.Format to check whether the format implements MultiSystems.from: formats without a MultiSystems reader load directly through LabeledSystem/System, while MultiSystems-capable formats never fall back to the single-system reader on ValueError or NotImplementedError. When the format registry is unavailable or fmt is unresolved (e.g. auto on extensionless OUTCAR), fallback only runs on NotImplementedError, never ValueError. Added end-to-end regression tests with partially labeled two-frame .extxyz and .xyz (auto) inputs verifying that ValueError is raised and no LMDB or manifest is cached.

Coding agent: Antigravity
Antigravity version: 1.5.24
Model: Gemini 4 Neon (High)
Reasoning effort: high

…back

Address review findings on the dpdata conversion path and harden LMDB
resource cleanup and validation:

- Bound the human-readable stem (48 UTF-8 bytes) and format label
  (32 UTF-8 bytes) in `_conversion_cache_path` on UTF-8 character
  boundaries while hashing the full resolved source path into the
  digest, keeping cache paths, 32-hex LMDB generations, and dpdata's
  `.tmp-*` staging directories well below POSIX NAME_MAX.
- Check dpdata's format registry before falling back from
  `MultiSystems.load_systems_from_file` to single-system loading, and
  never catch `ValueError` or retry a MultiSystems-capable format with
  the single-system reader, preventing silent single-frame truncation of
  partially labeled multi-frame inputs.
- Avoid passing `follow_symlinks=False` to `os.utime` in
  `_ConversionLock._heartbeat` when unsupported (Windows).
- Align `LmdbDataSystem._legacy_batch` `natoms_vec`/`numb_copy` dtypes
  with `DeepmdDataSystem` (`dtype=int`) for TF `DatasetLoader`, add
  `LmdbDataSystem.add_dict`, validate LMDB options/type_map in
  `get_neighbor_stat_data` before dpdata conversion, validate
  `valid_data.mixed_type` in `DPTrainer.train`, close LMDB handles on
  `dpmodel.LmdbDataSystem.close()`, constructor failures, and `dp test`,
  and reject malformed `prob_sys_size` prefixes and invalid weights on
  emptied blocks in `compute_block_targets`.

Coding-Agent: Antigravity
Antigravity-Version: 1.5.24
Model: Gemini 4 Neon (High)
Reasoning-Effort: high
@njzjz-bot

Copy link
Copy Markdown
Contributor

Pushed 869f92375 addressing both review findings from @wanghan-iapcm and additional issues found during a full audit of the PR diff:

  1. Cache basename length (_conversion_cache_path): Truncate the readable stem (48 UTF-8 bytes) and sanitized out_format (32 UTF-8 bytes) on character boundaries while hashing the full resolved source path into the digest, keeping cache names, 32-hex LMDB generations, and dpdata's .tmp-* staging directories well below POSIX NAME_MAX.
  2. No silent single-frame fallback (_write_dpdata_conversion): Inspect dpdata's format registry before falling back from MultiSystems.load_systems_from_file to LabeledSystem/System, never catch ValueError, and never fall back for MultiSystems-capable formats.
  3. Additional hardening fixes:
    • Guard follow_symlinks=False in _ConversionLock._heartbeat with os.utime in os.supports_follow_symlinks for Windows compatibility.
    • Match DeepmdDataSystem dtypes (dtype=int) for natoms_vec and numb_copy in LmdbDataSystem._legacy_batch (preventing TF DatasetLoader tf.py_func dtype mismatches when grouped with NPY) and add LmdbDataSystem.add_dict.
    • Validate LMDB type_map and sys_probs in get_neighbor_stat_data before dpdata conversion.
    • Close _test_data in dpmodel.utils.lmdb_data_system.LmdbDataSystem.close(), release LMDB handles on __init__ failures (LmdbDataSystem, dpmodel.LmdbDataSystem, LmdbDataset) and in dp test, validate valid_data.mixed_type in TF DPTrainer.train, and reject malformed prob_sys_size prefixes and invalid weights on emptied blocks in compute_block_targets.

Validation: ruff check ., ruff format --check ., pre-commit hooks (including pylint), test_data_system_conversion.py + test_data_conversion_lock.py + test_lmdb_data.py + test_train_cleanup.py (96 passed), test_path.py + test_data_config.py, test_dp_test.py::TestDPTestEner::test_1frame, and the dpmodel/PyTorch LMDB suites.

Coding agent: Antigravity
Antigravity version: 1.5.24
Model: Gemini 4 Neon (High)
Reasoning effort: high

@njzjz
njzjz requested a review from wanghan-iapcm December 4, 2026 08:19

@wanghan-iapcm wanghan-iapcm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review at 869f923. The two findings from the previous round are fixed at this head. Three further issues remain, all on the new conversion/caching path: (1) the shared-read HDF5 handle key can miss a same-size rewrite on coarse-timestamp filesystems and serve stale data; (2) release() joins the heartbeat thread without a timeout while the heartbeat may be blocked on an infinitely-waiting file lock, which can hang the converting process; (3) the source-signature content-hash arm and the 1 MiB boundary have no test that would fail if they regressed.

Comment thread deepmd/utils/path.py Outdated
return h5py.File(path, mode)
# Writable handles stay shared across their own in-place writes.
revision = (
(info.st_mtime_ns, info.st_ctime_ns, info.st_size)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shared read handle is keyed on (st_mtime_ns, st_ctime_ns, st_size). That tuple does not change on every content change: on filesystems with coarse timestamps (vfat: ctime is the creation time and mtime has 2 s granularity; ext3/fat: 1 s), a same-size in-place rewrite within one tick leaves all three fields identical, so _open_files.get(key) returns the pre-rewrite h5py.File and reads silently serve stale data until the process restarts.

Trigger. Same-size in-place rewrite of an HDF5 file with delta < G, where G is the filesystem timestamp granularity (2 s on vfat, 1 s on ext3).

Call chain. DPH5Path(path, "r") -> _load_h5py -> os.stat -> _open_files.get(key) -> cached handle -> load_numpy/attribute access.

Consequence. Training or validation reads the pre-rewrite content after an in-place update; there is no error and no way to notice except a restart.

Possible fix. Make the revision a content-derived value, or refuse to share handles across snapshots on filesystems whose timestamp granularity cannot distinguish rewrites.

Evidence boundary. Code reading plus POSIX/vfat timestamp semantics; not reproduced on vfat or ext3.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in bf3ccd1a7. DPH5Path._load_h5py now opens a fresh h5py.File(path, 'r') for read-only opens instead of caching them by stat metadata, so coarse-timestamp (vfat/ext3) or constant-inode filesystems cannot return a stale cached handle after a same-size rewrite or replacement. Descendant paths created via / or glob stay pinned to their parent handle via _with_name, libhdf5 refcounts the underlying OS file descriptor internally, and writable handles remain shared in _open_files. Added TestH5PathReadOnly.test_readonly_reopen_sees_same_size_rewrite_with_frozen_stat covering both atomic replacement and same-size in-place rewrites with frozen stat metadata.

Coding agent: Antigravity
Antigravity version: 1.5.24
Model: Gemini 4 Neon (High)
Reasoning effort: high

Comment thread deepmd/utils/data_conversion.py Outdated
def release(self) -> None:
"""Stop heartbeating and remove only the lock inode we own."""
self._stop.set()
self._thread.join()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

release() waits for the heartbeat thread without a timeout, and the heartbeat can be blocked inside with _conversion_lock_guard(self.path): filelock's default acquire timeout is infinite. If another process holds the guard when the heartbeat wakes, join() never returns and the converting process hangs silently.

Trigger. Two processes share the cache directory; process A is in release() while process B holds the guard (the waiter/scan/recovery path) long enough that the heartbeat cannot enter the guarded section.

Call chain. ConversionLock.__exit__ -> release() -> _stop.set() -> _thread.join() -> heartbeat blocked in _conversion_lock_guard's filelock.acquire.

Consequence. Conversion finishes its work but the process cannot proceed or exit; no timeout, no log. Shared/NFS cache directories are the multi-process scenario this lock exists for.

Possible fix. Acquire the guard in _heartbeat with a bounded timeout (treat failure as losing the lease) and give the join() in release() a timeout.

Evidence boundary. Code reading plus filelock default semantics; no concurrent reproducer run.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in bf3ccd1a7. _conversion_lock_guard now accepts a timeout, _heartbeat acquires the guard with _CONVERSION_LOCK_GUARD_TIMEOUT_SECONDS (logging a warning and stopping on filelock.Timeout, and re-checking _stop after acquisition), and release() joins the heartbeat thread and acquires the guard with _CONVERSION_LOCK_RELEASE_TIMEOUT_SECONDS (logging a warning instead of hanging if the guard or heartbeat is stalled). Added test_conversion_lock_heartbeat_and_release_do_not_hang_on_held_guard exercising both an externally held .guard lock and a stalled heartbeat thread.

Coding agent: Antigravity
Antigravity version: 1.5.24
Model: Gemini 4 Neon (High)
Reasoning effort: high

with path.open("rb") as fp:
# Bound the read even if a concurrent writer grows the input.
digest.update(
hashlib.sha256(fp.read(_DPDATA_SOURCE_HASH_LIMIT + 1)).digest()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The content hash is never the deciding factor in the tests. On POSIX, st_ctime_ns changes on every rewrite, so the metadata part of the signature always invalidates a cache entry first: the hash arm (regular files <= _DPDATA_SOURCE_HASH_LIMIT) and the 1 MiB boundary have no assertion, even though the hash is the mechanism this signature relies on where ctime is the creation time (Windows/vfat).

Trigger. A regression in the hash arm (e.g. < instead of <=, dropping the bounded read, a wrong limit) does not fail any test. The intended input — same size and preserved mtime, different bytes — is never constructed.

Suggested test. Unit-test _source_signature with Path.stat patched to return identical metadata for changed content, and assert the signature changes; add a case on both sides of _DPDATA_SOURCE_HASH_LIMIT so the boundary is exercised.

Evidence boundary. Test bodies and implementation read; no run.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in bf3ccd1a7. Added test_source_signature_content_hash_and_limit_boundary with Path.stat patched to frozen identical metadata so only the content-hash arm can distinguish edits. It asserts signature changes below the limit and at the exact 1 MiB _DPDATA_SOURCE_HASH_LIMIT boundary (modifying only the final byte), confirms hashing is skipped at limit + 1, and checks the limit + 1 read bound on concurrent growth.

Coding agent: Antigravity
Antigravity version: 1.5.24
Model: Gemini 4 Neon (High)
Reasoning effort: high

…aits

Address the three review findings on `869f92375`:

- Open a fresh `h5py.File(path, "r")` in `DPH5Path._load_h5py` instead of
  caching read-only handles by stat metadata, avoiding stale reads after
  same-size rewrites on coarse-timestamp (vfat/ext3) or constant-inode
  filesystems while keeping descendants pinned via `_with_name` and
  writable handles shared in `_open_files`.
- Give `_ConversionLock._heartbeat` and `_ConversionLock.release` bounded
  guard-lock timeouts (`filelock.Timeout`) and give `release()` a bounded
  `join()` timeout so a stalled peer holding the `.guard` lock cannot
  hang the converting process indefinitely.
- Add regression tests for frozen-stat HDF5 replacement and in-place
  rewrites, bounded heartbeat/release timeouts under a held guard or
  stalled heartbeat, and `_source_signature` content hashing across the
  1 MiB `_DPDATA_SOURCE_HASH_LIMIT` boundary with frozen stat metadata.

Coding-Agent: Antigravity
Antigravity-Version: 1.5.24
Model: Gemini 4 Neon (High)
Reasoning-Effort: high
@njzjz-bot

Copy link
Copy Markdown
Contributor

Pushed bf3ccd1a7 addressing all three findings from @wanghan-iapcm's re-review:

  1. Read-only HDF5 handle freshness (deepmd/utils/path.py): Opened a fresh h5py.File(path, 'r') instead of caching read-only handles by stat metadata, while keeping descendant pinning via _with_name and writable handle sharing in _open_files.
  2. Bounded lock heartbeat/release waits (deepmd/utils/data_conversion.py): Added bounded filelock.Timeout guard acquisition in _heartbeat (stopping on timeout) and bounded join() + guard timeouts in release().
  3. Content-hash & 1 MiB boundary tests (source/tests/common/test_data_system_conversion.py): Added frozen-stat tests exercising below-limit, exact 1 MiB boundary, limit + 1 skip, and bounded read on concurrent growth.

Validation: ruff check ., ruff format --check ., pre-commit hooks (including pylint), test_path.py + test_stat_file.py + test_data_conversion_lock.py (40 passed), and the full test_data_system_conversion.py suite (92 passed).

Coding agent: Antigravity
Antigravity version: 1.5.24
Model: Gemini 4 Neon (High)
Reasoning effort: high

@njzjz
njzjz requested a review from wanghan-iapcm December 4, 2026 15:32

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automatic Format Conversion in dp using dpdata

7 participants