Skip to content

Synthetic diffusion MGN example.#198

Open
YohannDudouit wants to merge 10 commits into
developfrom
yohann/diffusion-MGN
Open

Synthetic diffusion MGN example.#198
YohannDudouit wants to merge 10 commits into
developfrom
yohann/diffusion-MGN

Conversation

@YohannDudouit

@YohannDudouit YohannDudouit commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary
This PR adds a pure-Torch MGN-like graph diffusion validation workflow for AMS homogeneous graph surrogates. It trains a small synthetic diffusion model, exports an AMS-compatible TorchScript model, writes runtime fixtures, and validates C++ AMS inference against Python TorchScript reference output.

What Changed

  • Added generate_mgn_graph_diffusion.py with separate modes:
    • feasibility: eager/script/reload checks on dynamic graph sizes
    • train: trains the synthetic graph diffusion surrogate and saves checkpoint/metrics
    • fixtures: exports TorchScript and writes runtime fixture binaries plus fixtures.json
  • Added test_graph_mgn_surrogate.cpp to load runtime fixtures and compare AMS node:delta_u output against Python TorchScript references for N=24 and N=73.
  • Added MGN_DIFFUSION_* CTest workflow entries with dependency ordering:
    • feasibility → train → fixtures → AMS parity

Testing

python3 -m py_compile tests/AMSlib/models/generate_mgn_graph_diffusion.py
git diff --check
ctest --test-dir build -R MGN_DIFFUSION -j 8 --output-on-failure

Normal CTest can skip this training workflow with:

ctest --test-dir build -LE MGN_DIFFUSION --output-on-failure

Note: This PR is built on top of #194 and therefore include the graph construction and unit tests, until #194 is merged.

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.

1 participant