Skip to content

refactor(api_cc): load backends as plugins#5531

Open
njzjz wants to merge 6 commits into
deepmodeling:masterfrom
njzjz:refactor/api-cc-backend-plugins-20260614
Open

refactor(api_cc): load backends as plugins#5531
njzjz wants to merge 6 commits into
deepmodeling:masterfrom
njzjz:refactor/api-cc-backend-plugins-20260614

Conversation

@njzjz

@njzjz njzjz commented Jun 13, 2026

Copy link
Copy Markdown
Member

Summary

  • split api_cc backend implementations into dynamically loaded backend plugins
  • route DeepPot, DeepSpin, DeepTensor, and DipoleChargeModifier creation through a C ABI plugin layer
  • keep libdeepmd_cc free of TensorFlow/PyTorch/Paddle runtime links; backend runtimes live in plugin libraries
  • package backend plugin targets with C API packaging

Validation

  • ruff check .
  • ruff format .
  • git diff --check
  • cmake -S source -B /tmp/deepmd-plugin-no-backend -DBUILD_CPP_IF=ON -DBUILD_PY_IF=ON -DBUILD_TESTING=OFF -DCMAKE_TESTING_ENABLED=OFF -DENABLE_TENSORFLOW=OFF -DENABLE_PYTORCH=OFF -DENABLE_JAX=OFF -DENABLE_PADDLE=OFF
  • cmake --build /tmp/deepmd-plugin-no-backend --target deepmd_cc deepmd_c -j2
  • cmake -S source -B /tmp/deepmd-plugin-tf -DBUILD_CPP_IF=ON -DBUILD_PY_IF=ON -DBUILD_TESTING=OFF -DCMAKE_TESTING_ENABLED=OFF -DENABLE_TENSORFLOW=ON -DENABLE_PYTORCH=OFF -DENABLE_PADDLE=OFF -DTENSORFLOW_ROOT=/home/jzzeng/miniconda3/lib/python3.13/site-packages/tensorflow
  • cmake --build /tmp/deepmd-plugin-tf --target deepmd_backend_tf deepmd_backend_jax -j2
  • ldd /tmp/deepmd-plugin-no-backend/api_cc/libdeepmd_cc.so
  • nm -D /tmp/deepmd-plugin-tf/api_cc/libdeepmd_backend_tf.so

PyTorch plugin build was not validated locally because the installed torch package is CUDA-enabled and this environment does not provide CUDA toolkit files required by TorchConfig.cmake.

Summary by CodeRabbit

  • New Features
    • Added plugin-based runtime backend selection (TensorFlow, PyTorch, JAX, Paddle) with search paths configurable via DP_BACKEND_PLUGIN_PATH.
    • Backend op libraries are now loaded per selected backend at runtime.
    • Enabled TensorFlow pbtxt → pb conversion via the backend plugin mechanism.
    • Improved C API packaging/install to better include resolved runtime dependencies.
    • Updated C++ inference documentation and examples for plugin-based backend loading.
  • Breaking/Behavior Changes
    • Backend op library loading now requires backend selection (backend-agnostic loading removed).
    • pbtxt → pb conversion no longer strictly depends on TensorFlow being built-in.

@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Review 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

Walkthrough

This PR introduces a dynamic plugin architecture for DeepMD backend implementations. Instead of compile-time conditional backend selection, backends (TensorFlow, PyTorch, JAX, Paddle) are now built as separate plugin libraries and loaded at runtime via platform-specific dynamic linking. The refactoring includes a new plugin ABI contract, cross-platform library loading infrastructure, templated factory helpers, backend-specific plugin wrappers, and updated integration in existing backend classes.

Changes

Backend Plugin Architecture Implementation

Layer / File(s) Summary
Plugin ABI Contract & Type Definitions
source/api_cc/include/BackendPlugin.h, source/api_cc/include/common.h, source/api_cc/include/commonTF.h
Plugin symbol constants (e.g., DEEPMD_DEEPPOT_PLUGIN_CREATE_SYMBOL), C-language function pointer typedefs for backend create/delete/error-freeing, and C++ factory function declarations are defined. The load_op_library() signature is updated to accept an optional DPBackend parameter for backend-specific loading. #pragma once guard is added to commonTF.h.
Backend Plugin Factory Templates & Helpers
source/api_cc/src/BackendPluginFactory.h
Templated factory functions and lifecycle helpers construct typed backend instances from C-ABI plugin calls. Error messages are allocated via malloc and freed by callers; exceptions are caught and converted to opaque error strings for all backend types (DeepPot, DeepSpin, DeepTensor, DipoleChargeModifier). Includes set_error_message and free_error_message utilities.
Plugin Loading Infrastructure & Symbol Resolution
source/api_cc/src/BackendPlugin.cc (utilities and loaders)
Cross-platform dynamic library loader (Windows LoadLibraryA/GetProcAddress, Unix dlopen/dlsym) handles path construction, symbol resolution, and per-backend plugin caching with mutex protection. Plugin load failures are aggregated into detailed exception messages listing all attempted candidates and their errors.
Backend Factory Functions & Plugin Invocation
source/api_cc/src/BackendPlugin.cc (factory implementations)
Factory functions for DeepPot, DeepSpin, DeepTensor, and DipoleChargeModifier load plugins, invoke creation symbols, validate handles, extract/free plugin error messages, and return std::shared_ptr with custom deleters for cleanup. backend_name() function provides consistent human-readable backend naming, and convert_pbtxt_to_pb_from_plugin() handles GraphDef conversion.
Backend-Specific Op Library Loading & Customized Plugins
source/api_cc/src/common.cc, source/api_cc/include/common.h
Op library loading is refactored: parameterless load_op_library() loads all compiled backends; new load_op_library(DPBackend backend) overload loads only the specified backend. Both paths load customized plugins from DP_PLUGIN_PATH via _load_customized_plugins() helper. Non-TensorFlow builds delegate convert_pbtxt_to_pb() to the plugin system instead of throwing an error.
TensorFlow Backend Plugin Wrapper
source/api_cc/src/DeepPotTFPlugin.cc
C-ABI entry points for TensorFlow backend, exposing deepmd_create_deeppot_backend_v1, deepmd_create_deepspin_backend_v1, deepmd_create_deeptensor_backend_v1, deepmd_create_dipole_charge_modifier_backend_v1 with matching delete/free functions. Includes deepmd_convert_pbtxt_to_pb_v1 for pbtxt-to-pb GraphDef conversion with file I/O and exception handling.
PyTorch Backend Plugin Wrappers
source/api_cc/src/DeepPotPTPlugin.cc, source/api_cc/src/DeepPotPTExptPlugin.cc
C-ABI wrappers for standard PyTorch and AOTI-exportable variants. PT-expt wrappers conditionally use BUILD_PT_EXPT* options or fail with error message if AOTInductor headers are unavailable.
JAX & Paddle Backend Plugin Wrappers
source/api_cc/src/DeepPotJAXPlugin.cc, source/api_cc/src/DeepPotPDPlugin.cc
Lightweight C-ABI wrappers forwarding calls to templated factory helpers for JAX and Paddle backend implementations, with conditional compilation guards (BUILD_JAX, BUILD_PADDLE).
C++ API Build System Refactoring
source/api_cc/CMakeLists.txt
Backend sources are separated into implementation and plugin source lists; the main libdeepmd_cc library is built from remaining sources only. A deepmd_configure_backend_plugin() helper standardizes plugin target setup (includes, C++ standard, RPATH, installation, registration in DEEPMD_BACKEND_PLUGIN_TARGETS). Conditional plugin targets for each backend (deepmd_backend_tf, deepmd_backend_pt, deepmd_backend_ptexpt, deepmd_backend_jax, deepmd_backend_pd) are created with backend-specific linkage and compile definitions.
C API Packaging Integration
source/api_c/CMakeLists.txt
When PACKAGE_C is enabled, backend plugin targets are included in the runtime-dependency audit list (via file(GET_RUNTIME_DEPENDENCIES ...)) and installed to ${CMAKE_BINARY_DIR}/libdeepmd_c/lib. Plugin list is dynamically constructed from DEEPMD_BACKEND_PLUGIN_TARGETS.
DeepPot Backend Migration to Plugin Loading
source/api_cc/src/DeepPot.cc, source/api_cc/src/DeepPotTF.cc, source/api_cc/src/DeepPotPT.cc, source/api_cc/src/DeepPotPTExpt.cc, source/api_cc/src/DeepPotPD.cc
DeepPot and framework-specific variants now initialize via create_deeppot_backend_from_plugin() instead of compile-time #ifdef branching; build-time availability checks are removed. Op library loading calls are updated with explicit DPBackend::TensorFlow, DPBackend::PyTorch, DPBackend::PyTorchExportable, and DPBackend::Paddle parameters respectively.
DeepSpin Backend Migration to Plugin Loading
source/api_cc/src/DeepSpin.cc, source/api_cc/src/DeepSpinTF.cc, source/api_cc/src/DeepSpinPT.cc, source/api_cc/src/DeepSpinPTExpt.cc
DeepSpin switches to plugin-based backend construction via create_deepspin_backend_from_plugin() for supported frameworks; compile-time guarded includes and availability checks are removed. Op library loading is updated with explicit backend identifiers.
DeepTensor Backend Migration to Plugin Loading
source/api_cc/src/DeepTensor.cc, source/api_cc/src/DeepTensorTF.cc, source/api_cc/src/DeepTensorPT.cc
DeepTensor uses plugin factories for TensorFlow and PyTorch via create_deeptensor_backend_from_plugin(); compile-time build checks are removed. Op library loading calls pass explicit DPBackend::TensorFlow and DPBackend::PyTorch parameters.
DipoleChargeModifier Backend Migration to Plugin Loading
source/api_cc/src/DataModifier.cc, source/api_cc/src/DataModifierTF.cc
DipoleChargeModifier initialization for TensorFlow shifts from compile-time conditional to plugin-based factory via create_dipole_charge_modifier_backend_from_plugin(). Op library loading is updated to pass explicit DPBackend::TensorFlow parameter.
Runtime & Build Documentation
doc/env.md, doc/inference/cxx.md
New environment variable DP_BACKEND_PLUGIN_PATH is documented for controlling backend plugin library search paths (separate from DP_PLUGIN_PATH for customized OP plugins). C/C++ inference documentation is updated to describe plugin-based backend loading, search order, platform-specific library names, and linking without direct backend framework dependencies (no -ltensorflow_cc or -lPyTorch).

Sequence Diagrams

sequenceDiagram
  participant App as Application/Backend Class
  participant Factory as Backend Factory
  participant PluginLoader as Plugin Loader
  participant SymbolRes as Symbol Resolver
  participant Plugin as Backend Plugin<br/>(e.g., libdeepmd_backend_tf.so)
  participant Cache as Plugin Handle Cache
  
  App->>Factory: create_deeppot_backend_from_plugin<br/>(backend, model, gpu, file_content)
  Factory->>Cache: load_plugin(DPBackend::TensorFlow)
  Cache->>PluginLoader: Check cached handle for TensorFlow
  alt Plugin not cached
    PluginLoader->>PluginLoader: Build candidate paths:<br/>DP_BACKEND_PLUGIN_PATH, libdeepmd_cc dir
    loop For each candidate
      PluginLoader->>Plugin: dlopen(candidate_path)
      alt Success
        Plugin-->>PluginLoader: Valid handle
      else Failed
        PluginLoader->>PluginLoader: Log error, try next
      end
    end
    PluginLoader->>SymbolRes: Resolve create/delete/free symbols
    SymbolRes->>Plugin: dlsym(handle, symbol_name)
    Plugin-->>SymbolRes: Function pointer
    SymbolRes-->>PluginLoader: Symbol dict
  end
  PluginLoader-->>Cache: Store/return PluginHandle
  Cache-->>Factory: PluginHandle{create_fn, delete_fn, free_error_fn}
  Factory->>Plugin: create_fn(model, gpu, file_content, &error_msg)
  Plugin-->>Factory: void* backend_instance
  Factory-->>Factory: Wrap in std::shared_ptr<br/>with custom deleter
  Factory-->>App: std::shared_ptr<DeepPotBackend>
Loading
sequenceDiagram
  participant Init as Backend Class::init()
  participant OpLib as load_op_library(DPBackend)
  participant Loader as Library Loader
  participant BuiltIn as Built-in Op Library<br/>(TF/PT/Paddle)
  participant Custom as Custom Plugins
  
  Init->>OpLib: load_op_library(DPBackend::PyTorch)
  OpLib->>Loader: Determine which backend<br/>built-in lib to load
  Loader->>BuiltIn: dlopen PyTorch operator library
  BuiltIn-->>Loader: Loaded
  Loader-->>OpLib: Done with backend lib
  OpLib->>Custom: _load_customized_plugins()<br/>via DP_PLUGIN_PATH
  Custom->>Loader: For each plugin path entry
  Loader-->>Custom: Load plugin DSO
  Custom-->>OpLib: All custom plugins loaded
  OpLib-->>Init: Initialization complete
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested labels

build, Core

Suggested reviewers

  • iProzd
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 1.28% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'refactor(api_cc): load backends as plugins' clearly and concisely describes the main change: converting backend loading from compile-time linkage to runtime plugin loading in the api_cc module.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@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.

🧹 Nitpick comments (1)
source/api_cc/src/BackendPlugin.cc (1)

312-343: ⚡ Quick win

Inconsistent exception handling compared to create_deeppot_backend_from_plugin.

The DeepPot factory (lines 282-294) wraps the plugin creation call in a try-catch to re-wrap exceptions from the plugin. This factory and the DeepTensor/DipoleChargeModifier factories below call their respective create functions without this protection.

If a plugin's create function throws (instead of returning nullptr with an error message), those exceptions will propagate unwrapped with potentially confusing stack traces.

Suggested fix to add consistent exception handling
   char* error_message = nullptr;
-  void* backend_handle =
-      create_deepspin(model.c_str(), gpu_rank, file_content.data(),
-                      file_content.size(), &error_message);
+  void* backend_handle = nullptr;
+  try {
+    backend_handle =
+        create_deepspin(model.c_str(), gpu_rank, file_content.data(),
+                        file_content.size(), &error_message);
+  } catch (const deepmd::deepmd_exception& e) {
+    throw;
+  } catch (const std::exception& e) {
+    throw deepmd::deepmd_exception("Backend plugin " + plugin->path +
+                                   " threw an exception: " + e.what());
+  } catch (...) {
+    throw deepmd::deepmd_exception("Backend plugin " + plugin->path +
+                                   " threw an unknown exception");
+  }

Apply similar wrapping to create_deeptensor_backend_from_plugin and create_dipole_charge_modifier_backend_from_plugin.

🤖 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 `@source/api_cc/src/BackendPlugin.cc` around lines 312 - 343, The
create_deepspin_backend_from_plugin factory (and the related
create_deeptensor_backend_from_plugin and
create_dipole_charge_modifier_backend_from_plugin) must mirror the
exception-wrapping used in create_deeppot_backend_from_plugin: wrap the plugin
create_* call in a try-catch that catches std::exception (and a catch-all) and
rethrow as deepmd::deepmd_exception with the plugin path and any plugin error
message (use take_plugin_error(plugin, error_message) or plugin->free_error as
appropriate); specifically, enclose the call to create_deepspin(...) in a try
block and on catch build the same formatted message used when create_deepspin
returns nullptr, then throw deepmd_exception, and apply the same pattern to
create_deeptensor_backend_from_plugin and
create_dipole_charge_modifier_backend_from_plugin so plugin-thrown exceptions
are consistently wrapped.
🤖 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.

Nitpick comments:
In `@source/api_cc/src/BackendPlugin.cc`:
- Around line 312-343: The create_deepspin_backend_from_plugin factory (and the
related create_deeptensor_backend_from_plugin and
create_dipole_charge_modifier_backend_from_plugin) must mirror the
exception-wrapping used in create_deeppot_backend_from_plugin: wrap the plugin
create_* call in a try-catch that catches std::exception (and a catch-all) and
rethrow as deepmd::deepmd_exception with the plugin path and any plugin error
message (use take_plugin_error(plugin, error_message) or plugin->free_error as
appropriate); specifically, enclose the call to create_deepspin(...) in a try
block and on catch build the same formatted message used when create_deepspin
returns nullptr, then throw deepmd_exception, and apply the same pattern to
create_deeptensor_backend_from_plugin and
create_dipole_charge_modifier_backend_from_plugin so plugin-thrown exceptions
are consistently wrapped.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 512a9b00-506e-49d0-94ca-c4502a8a7684

📥 Commits

Reviewing files that changed from the base of the PR and between 5d94bd6 and 721c4a3.

📒 Files selected for processing (27)
  • source/api_c/CMakeLists.txt
  • source/api_cc/CMakeLists.txt
  • source/api_cc/include/BackendPlugin.h
  • source/api_cc/include/common.h
  • source/api_cc/include/commonTF.h
  • source/api_cc/src/BackendPlugin.cc
  • source/api_cc/src/BackendPluginFactory.h
  • source/api_cc/src/DataModifier.cc
  • source/api_cc/src/DataModifierTF.cc
  • source/api_cc/src/DeepPot.cc
  • source/api_cc/src/DeepPotJAXPlugin.cc
  • source/api_cc/src/DeepPotPD.cc
  • source/api_cc/src/DeepPotPDPlugin.cc
  • source/api_cc/src/DeepPotPT.cc
  • source/api_cc/src/DeepPotPTExpt.cc
  • source/api_cc/src/DeepPotPTExptPlugin.cc
  • source/api_cc/src/DeepPotPTPlugin.cc
  • source/api_cc/src/DeepPotTF.cc
  • source/api_cc/src/DeepPotTFPlugin.cc
  • source/api_cc/src/DeepSpin.cc
  • source/api_cc/src/DeepSpinPT.cc
  • source/api_cc/src/DeepSpinPTExpt.cc
  • source/api_cc/src/DeepSpinTF.cc
  • source/api_cc/src/DeepTensor.cc
  • source/api_cc/src/DeepTensorPT.cc
  • source/api_cc/src/DeepTensorTF.cc
  • source/api_cc/src/common.cc

@codecov

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.43026% with 142 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.11%. Comparing base (5d94bd6) to head (01c6c59).
⚠️ Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
source/api_cc/src/BackendPlugin.cc 66.95% 62 Missing and 14 partials ⚠️
source/api_cc/src/BackendPluginFactory.h 56.60% 21 Missing and 2 partials ⚠️
source/api_cc/src/DeepPotTFPlugin.cc 62.00% 14 Missing and 5 partials ⚠️
source/api_cc/src/DeepTensor.cc 25.00% 5 Missing and 1 partial ⚠️
source/api_cc/src/common.cc 53.84% 3 Missing and 3 partials ⚠️
source/api_cc/src/DataModifier.cc 28.57% 5 Missing ⚠️
source/api_cc/src/DeepPotJAXPlugin.cc 71.42% 2 Missing ⚠️
source/api_cc/src/DeepPotPDPlugin.cc 71.42% 2 Missing ⚠️
source/api_cc/src/DeepSpin.cc 66.66% 2 Missing ⚠️
source/api_cc/src/DeepPot.cc 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5531      +/-   ##
==========================================
- Coverage   82.19%   82.11%   -0.08%     
==========================================
  Files         891      898       +7     
  Lines      101599   101972     +373     
  Branches     4242     4274      +32     
==========================================
+ Hits        83507    83737     +230     
- Misses      16789    16908     +119     
- Partials     1303     1327      +24     

☔ 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.

@njzjz-bot

Copy link
Copy Markdown
Contributor

Thanks for the refactor — splitting the API C/C++ backend implementation into dynamically loaded plugins looks like the right direction. I think a few follow-ups are worth addressing before merge:

  1. Please wrap all plugin create callbacks consistently. create_deeppot_backend_from_plugin and convert_pbtxt_to_pb_from_plugin already catch plugin-thrown exceptions and rethrow deepmd_exception, but the DeepSpin / DeepTensor / DipoleChargeModifier creation paths still call the plugin function directly. Since these calls cross the plugin boundary, an uncaught C++ exception escaping the callback is fragile; it would be safer to apply the same try/catch (std::exception)/catch (...) pattern there too.

  2. Please double-check the TensorFlow plugin linkage. deepmd_backend_tf currently compiles src/common.cc into the plugin while also linking against libdeepmd_cc. If that is intentional, a short comment would help; otherwise this looks like a possible future source of duplicate symbols / ODR or symbol-interposition surprises. Moving shared code to a dedicated object/static target with controlled linkage may be cleaner.

  3. This probably needs documentation. At minimum, please document the new backend-plugin model for users/developers: installed plugin library names/locations, DP_BACKEND_PLUGIN_PATH search order, expected wheel/native install layout, what happens when a backend plugin is missing, and how to build/use a no-backend libdeepmd_cc.

A small install/runtime test for plugin discovery would also be helpful if feasible, especially for the no-backend C/C++ API case.

— OpenClaw 2026.5.28 (e932160) (model: custom-chat-jinzhezeng-group/gpt-5.5)

@github-actions github-actions Bot added the Docs label Jun 14, 2026
@njzjz

njzjz commented Jun 14, 2026

Copy link
Copy Markdown
Member Author

Addressed the review follow-ups in d6795db.

  • Wrapped all backend plugin create calls with consistent exception-to-deepmd_exception handling, including plugin path and plugin error cleanup.
  • Documented why the TensorFlow backend plugin compiles common.cc with BUILD_TENSORFLOW while libdeepmd_cc stays backend-neutral.
  • Added C/C++ backend plugin documentation: plugin names, install locations, DP_BACKEND_PLUGIN_PATH search order, missing-plugin behavior, no-backend library usage, and the distinction from DP_PLUGIN_PATH. The C/C++ link examples no longer link TensorFlow directly.

Local validation: rebuilt deepmd_cc and deepmd_backend_tf, ran the C API DeepPot smoke test through the TensorFlow plugin, and ran ruff/pre-commit checks for the changed files.

@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: 1

🤖 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 `@doc/inference/cxx.md`:
- Around line 40-68: The Backend plugins section documents how to use no-backend
libdeepmd_cc builds but lacks instructions on how to build them. Add
documentation describing the build-time configuration steps (such as the
specific CMake options or flags) required to disable backends when building
libdeepmd_cc. This information should be placed near the existing mention of
no-backend builds to provide complete guidance for users who want to create a
no-backend library build.
🪄 Autofix (Beta)

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: 11f1e1df-1711-4015-927d-7a70efcf7f2f

📥 Commits

Reviewing files that changed from the base of the PR and between 060f043 and d6795db.

📒 Files selected for processing (4)
  • doc/env.md
  • doc/inference/cxx.md
  • source/api_cc/CMakeLists.txt
  • source/api_cc/src/BackendPlugin.cc
🚧 Files skipped from review as they are similar to previous changes (2)
  • source/api_cc/src/BackendPlugin.cc
  • source/api_cc/CMakeLists.txt

Comment thread doc/inference/cxx.md
@wanghan-iapcm

Copy link
Copy Markdown
Collaborator

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

@njzjz njzjz added the Test CUDA Trigger test CUDA workflow label Jun 16, 2026
@github-actions github-actions Bot removed the Test CUDA Trigger test CUDA workflow label Jun 16, 2026
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.

3 participants