You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/env.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,4 +89,33 @@ These environment variables also apply to third-party programs using the C++ int
89
89
90
90
List of customized OP plugin libraries to load, such as `/path/to/plugin1.so:/path/to/plugin2.so` on Linux and `/path/to/plugin1.dll;/path/to/plugin2.dll` on Windows.
91
91
92
+
:::{envvar} DP_PROFILER
93
+
94
+
Enable the built-in PyTorch Kineto profiler for the PyTorch C++ (inference) backend.
95
+
96
+
**Type**: string (output file stem)
97
+
**Default**: unset (disabled)
98
+
99
+
When set to a non-empty value, profiling is enabled for the lifetime of the loaded PyTorch model (e.g. during LAMMPS runs). A JSON trace file is written on finish. The final file name is constructed as:
100
+
101
+
-`<ENV_VALUE>_gpu<ID>.json` if running on GPU (multi-GPU safe: the CUDA device id is appended)
102
+
-`<ENV_VALUE>.json` if running on CPU
103
+
104
+
The trace is compatible with [Chrome trace viewer](https://ui.perfetto.dev/) (alternatively chrome://tracing) and PyTorch profiler tooling. It includes:
105
+
106
+
- CPU operator activities (always)
107
+
- CUDA activities (if GPU available)
108
+
109
+
Example:
110
+
111
+
```bash
112
+
export DP_PROFILER=result
113
+
mpirun -np 4 lmp -in in.lammps
114
+
# Produces result_gpuX.json, where X is the GPU id used by each MPI rank.
115
+
```
116
+
117
+
Tips:
118
+
119
+
- Large runs can generate sizable JSON files; consider limiting numbers of MD steps, like 20.
120
+
- Currently this feature only supports single process, or multi-process runs where each process uses a distinct GPU on the same node.
0 commit comments