Skip to content

Isolate AMS from PyTorch - #196

Open
lpottier wants to merge 9 commits into
developfrom
features/remove-torch
Open

Isolate AMS from PyTorch#196
lpottier wants to merge 9 commits into
developfrom
features/remove-torch

Conversation

@lpottier

@lpottier lpottier commented Jun 4, 2026

Copy link
Copy Markdown
Member

This PR aims at removing PyTorch from the critical path in AMS. The strict dependency on PyTorch prevents AMS from being used in some multi-physics codes and thus must be removed. This PR introduces the CMake flag -DWITH_TORCH=[On|Off].

This PR replaces Torch tensors with AMSTensor when possible. By default, -DWITH_TORCH=On, when AMS is compiled with Torch we can perform inference but when we do not compile AMS with Torch we can still store physics and it acts as a training only mode.

TODO:

  • Remove Torch dependency in evaluate()
  • Adapt tests to the no torch path
  • Test with RabbitMQ backend

…CH=On except integration tests)

Signed-off-by: Loic Pottier <pottier1@llnl.gov>
Signed-off-by: Loic Pottier <pottier1@llnl.gov>
Signed-off-by: Loic Pottier <pottier1@llnl.gov>
Signed-off-by: Loic Pottier <pottier1@llnl.gov>
Signed-off-by: Loic Pottier <pottier1@llnl.gov>
Signed-off-by: Loic Pottier <pottier1@llnl.gov>
Signed-off-by: Loic Pottier <pottier1@llnl.gov>
Signed-off-by: Loic Pottier <pottier1@llnl.gov>
@lpottier
lpottier force-pushed the features/remove-torch branch from 94df04e to 1820329 Compare August 21, 2026 21:41
@lpottier
lpottier deployed to github-pages August 21, 2026 21:41 — with GitHub Actions Active
Signed-off-by: Loic Pottier <pottier1@llnl.gov>
@lpottier
lpottier deployed to github-pages August 21, 2026 21:55 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown
Contributor

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-tidy (v18.1.8) reports: 1 concern(s)
  • src/AMSlib/wf/hdf5db.cpp:38:20: warning: [clang-diagnostic-unused-function]

    unused function 'tensorSizeToString'

       38 | static std::string tensorSizeToString(ArrayRef<AMSTensor::IntDimType> shape)
          |                    ^~~~~~~~~~~~~~~~~~

Have any feedback or feature suggestions? Share it here.

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