Potential wrappers and the batched oracle interface. More...
Classes | |
| class | ActiveGP |
| struct | ActiveGPConfig |
| class | ActiveGPPotential |
| struct | AotiPackageTarget |
| The fields of an AOTInductor package that name the hardware it targets. More... | |
| struct | EngineAbiStamp |
| struct | EngineBinding |
| A name resolved to an engine library and the capnp params message it takes. More... | |
| struct | EngineCaps |
| struct | EngineDerivativeReport |
| class | EngineError |
| class | EnginePotential |
| struct | EngineReport |
| What a run needs to state about the engine that answered it. More... | |
| struct | EngineRequest |
| What a driver knows when it asks for a potential by name. More... | |
| class | GprMeanPotential |
| struct | HostIsa |
| class | NestedEngineOracle |
| struct | OracleBatchLayout |
| How a step's oracle points are shared out. More... | |
| struct | OracleBatchOutcome |
| struct | OracleEvaluationScope |
| struct | OraclePathChoice |
| Which route a run takes to its potential, and why. More... | |
| class | PotentialWrapper |
| Type-erased wrapper around any potential that provides a force() interface. More... | |
| struct | RgpotBackend |
| struct | RgpotRequest |
| Backend inputs shared by the path and single-ended drivers. More... | |
Typedefs | |
| using | OracleBatchComm = int |
Enumerations | |
| enum class | OracleBatchStatus : int { Ok = 0 , Failed = 1 , Restart = 2 , WallClockLimit = 3 } |
| What one rank reports about its groups before the value collectives. More... | |
Functions | |
| AotiPackageTarget | readAotiPackageTarget (const std::string &path) |
| std::vector< std::string > | missingIsa (const AotiPackageTarget &target, const HostIsa &host) |
| void | requireAotiPackageRunsOn (const std::string &path, const HostIsa &host) |
| requireAotiPackageRunsOnHost against an explicit host description. | |
| void | requireAotiPackageRunsOnHost (const std::string &path) |
| bool | engineIsGeneric (const std::string &potential) |
| bool | engineRequestIsPlugin (const EngineRequest &request) |
| OraclePathChoice | selectOraclePath (const std::string &requested, const std::string &potential, bool plugin) |
| OraclePathChoice | selectOraclePath (const std::string &requested, const std::string &potential) |
| std::string | formatOraclePath (const OraclePathChoice &choice, const std::string &potential) |
| bool | recordOraclePath (const OraclePathChoice &choice) |
| Record the choice on the active tracking run as oracle.path. | |
| std::vector< std::string > | engineSearchDirectories (const EngineRequest &request, const std::string &potential) |
| bool | engineRegistryKnows (const std::string &potential) |
True when the registry maps potential to an engine params arm. | |
| bool | resolveEngine (const EngineRequest &request, EngineBinding &binding, std::string &err) |
| std::unique_ptr< EnginePotential > | openEngine (const EngineRequest &request, std::string &err, EngineBinding *binding=nullptr, int oracle_threads=1) |
| resolveEngine followed by EnginePotential::open. | |
| EngineReport | reportEngine (const EnginePotential &engine, const EngineBinding &binding) |
| EngineReport | reportEngine (const EnginePotential &engine, const EngineBinding &binding, const std::string &model_sha256) |
| std::shared_future< std::string > | startModelDigest (const std::string &model_path) |
| std::string | formatEngineReport (const EngineReport &report) |
| bool | recordEngineProvenance (const EngineReport &report) |
| std::string | engineLibraryForSpecArm (const std::string &arm) |
| OracleBatchComm | oracleBatchWorld () noexcept |
| The communicator of the whole run, or the no-MPI placeholder. | |
| int | oracleBatchOwner (Eigen::Index point, Eigen::Index count, const OracleBatchLayout &layout) noexcept |
Owner rank of one point of a batch of count points. | |
| std::vector< std::vector< Eigen::Index > > | ownedOracleGroups (Eigen::Index count, const OracleBatchLayout &layout) |
| The groups this rank evaluates, each one batch call, in point order. | |
| OracleBatchOutcome | agreeOracleBatchStatus (OracleBatchStatus local_status, const std::string &local_message, const OracleBatchLayout &layout) |
| void | allreduceOwnedOracleValues (std::vector< double > &energies, Eigen::MatrixXd &gradients, const OracleBatchLayout &layout, double *communication_seconds) |
| void | allreduceOwnedOracleMask (std::vector< char > &accepted, const OracleBatchLayout &layout) |
| void | resetOracleEvaluations () noexcept |
| long | oracleEvaluations () noexcept |
| void | pushOracleEvaluations (long evaluations) noexcept |
| void | popOracleEvaluations () noexcept |
| bool | energyVarianceAccepted (const double variance) noexcept |
| double | energyVarianceToRms (const double variance) |
| std::vector< RgpotBackend > | rgpotBackends () |
| The same table drives construction, name validation and CLI discovery. | |
| bool | rgpotBackendAvailable (const std::string &name) |
| std::string | canonicalRgpotName (const std::string &name) |
| std::string | formatPotentialCatalog () |
| std::vector< unsigned char > | readPotentialConfig (const std::string &path) |
| std::vector< unsigned char > | potentialConfigArm (const std::vector< unsigned char > &config, const std::string &potential) |
| void | applyRgpotConfig (RgpotRequest &request) |
| Resolve shared model settings from the typed configuration for reporting. | |
| void | configureRgpotRuntime (const RgpotRequest &request) |
| std::unique_ptr< rgpot::PotentialBase > | makeRgpotPotential (const RgpotRequest &request) |
Variables | |
| constexpr double | kEnergyVarianceNegativeRtol = 1.0e-8 |
Potential wrappers and the batched oracle interface.
| using pot::OracleBatchComm = int |
Definition at line 39 of file OracleBatch.h.
|
strong |
What one rank reports about its groups before the value collectives.
Definition at line 78 of file OracleBatch.h.
| OracleBatchOutcome pot::agreeOracleBatchStatus | ( | OracleBatchStatus | local_status, |
| const std::string & | local_message, | ||
| const OracleBatchLayout & | layout ) |
Collective agreement on the batch's status: the highest status wins and the message of the lowest failing rank reaches every rank.
Definition at line 93 of file OracleBatch.cpp.
| void pot::allreduceOwnedOracleMask | ( | std::vector< char > & | accepted, |
| const OracleBatchLayout & | layout ) |
Union of the owners' acceptance mask. A zero entry contributes no bits, so a point stays accepted only when its owner accepted it. Every rank enters the collective. A caller that cannot keep a partial batch throws on the agreed failure and does not call this.
Definition at line 187 of file OracleBatch.cpp.
| void pot::allreduceOwnedOracleValues | ( | std::vector< double > & | energies, |
| Eigen::MatrixXd & | gradients, | ||
| const OracleBatchLayout & | layout, | ||
| double * | communication_seconds = nullptr ) |
Union of the owners' values. Entries a rank does not own must be zero positive zero on entry; the bitwise union preserves the owner's bits. The time spent in the collectives is added to communication_seconds when given.
Definition at line 138 of file OracleBatch.cpp.
| void pot::applyRgpotConfig | ( | RgpotRequest & | request | ) |
Resolve shared model settings from the typed configuration for reporting.
Definition at line 782 of file RgpotFactory.cpp.
| std::string pot::canonicalRgpotName | ( | const std::string & | name | ) |
Definition at line 732 of file RgpotFactory.cpp.
| void pot::configureRgpotRuntime | ( | const RgpotRequest & | request | ) |
Apply tensor-runtime settings before constructing a model. Repeated compatible requests share the process runtime; incompatible ones throw.
Definition at line 830 of file RgpotFactory.cpp.
|
inlinenoexcept |
True when a raw energy variance may be kept.
A non-finite value, or one below -kEnergyVarianceNegativeRtol, is rejected. A value in [-kEnergyVarianceNegativeRtol, 0) is cancellation and may stay negative on a raw-variance slot.
Definition at line 45 of file PotentialWrapper.h.
|
inline |
Convert rgpot's energy-variance slot to the wrapper's RMS contract.
A variance energyVarianceAccepted rejects is reported to the caller. A smaller negative value is clamped to zero before the square root.
Definition at line 54 of file PotentialWrapper.h.
| bool pot::engineIsGeneric | ( | const std::string & | potential | ) |
True when the registry has an engine that loads through the generic rgpot_engine_* table (UMA, CPMD, CP2K, LAMMPS).
Definition at line 309 of file EngineRegistry.cpp.
| std::string pot::engineLibraryForSpecArm | ( | const std::string & | arm_name | ) |
Library name for a PotentialSpec arm. Kept next to the loader so the mapping from a wire arm to a plugin is stated once.
Returns an empty string for an arm with no engine plugin, which the caller reports rather than guessing at a filename.
Definition at line 9 of file NestedEngineOracle.cpp.
| bool pot::engineRegistryKnows | ( | const std::string & | potential | ) |
True when the registry maps potential to an engine params arm.
Definition at line 404 of file EngineRegistry.cpp.
| bool pot::engineRequestIsPlugin | ( | const EngineRequest & | request | ) |
True when the request carries its engine's parameters message (a params path or payload), which makes it a plugin request.
Definition at line 315 of file EngineRegistry.cpp.
| std::vector< std::string > pot::engineSearchDirectories | ( | const EngineRequest & | request, |
| const std::string & | potential ) |
Directories searched for a table library when no –engine-dir is given, in order: –engine-dir (listed first when present), $RGPOT_ENGINE_PATH (colon separated), the install prefix's lib and lib64 next to the executable, the executable's own directory, then the build tree's rgpot subproject below it.
Definition at line 364 of file EngineRegistry.cpp.
| std::string pot::formatEngineReport | ( | const EngineReport & | report | ) |
One startup line (gpr/StartupReport.h): "[startup] engine library=... abi=1 arm=UmaParams model=... sha256=...".
Definition at line 672 of file EngineRegistry.cpp.
| std::string pot::formatOraclePath | ( | const OraclePathChoice & | choice, |
| const std::string & | potential ) |
One startup line (gpr/StartupReport.h): "[startup] oracle path=engine potential=uma reason=\"...\"".
Definition at line 346 of file EngineRegistry.cpp.
| std::string pot::formatPotentialCatalog | ( | ) |
Definition at line 738 of file RgpotFactory.cpp.
| std::unique_ptr< rgpot::PotentialBase > pot::makeRgpotPotential | ( | const RgpotRequest & | request | ) |
Creates one owned rgpot instance; unavailable names and mismatched configuration arms throw.
Definition at line 899 of file RgpotFactory.cpp.
| std::vector< std::string > pot::missingIsa | ( | const AotiPackageTarget & | target, |
| const HostIsa & | host ) |
The ISA tokens of target that host does not provide. A token this module does not know is returned prefixed with "unknown:" so the caller can tell it from a known missing extension.
Definition at line 238 of file AotiPackageIsa.cpp.
| std::unique_ptr< EnginePotential > pot::openEngine | ( | const EngineRequest & | request, |
| std::string & | err, | ||
| EngineBinding * | binding, | ||
| int | oracle_threads ) |
resolveEngine followed by EnginePotential::open.
Definition at line 614 of file EngineRegistry.cpp.
|
noexcept |
Owner rank of one point of a batch of count points.
Definition at line 57 of file OracleBatch.cpp.
|
noexcept |
The communicator of the whole run, or the no-MPI placeholder.
Definition at line 34 of file OracleBatch.cpp.
|
nodiscardnoexcept |
Definition at line 25 of file PotentialWrapper.cpp.
| std::vector< std::vector< Eigen::Index > > pot::ownedOracleGroups | ( | Eigen::Index | count, |
| const OracleBatchLayout & | layout ) |
The groups this rank evaluates, each one batch call, in point order.
Definition at line 67 of file OracleBatch.cpp.
|
noexcept |
Definition at line 37 of file PotentialWrapper.cpp.
| std::vector< unsigned char > pot::potentialConfigArm | ( | const std::vector< unsigned char > & | config, |
| const std::string & | potential ) |
Validate the selected arm and return its native params message for an engine.
Definition at line 769 of file RgpotFactory.cpp.
|
noexcept |
Definition at line 30 of file PotentialWrapper.cpp.
| AotiPackageTarget pot::readAotiPackageTarget | ( | const std::string & | path | ) |
Reads the target fields of the package at path. A file that is not a zip archive, or a package without metadata entries, gives metadata_found == false. Throws std::runtime_error when the file cannot be opened.
Definition at line 209 of file AotiPackageIsa.cpp.
| std::vector< unsigned char > pot::readPotentialConfig | ( | const std::string & | path | ) |
Definition at line 757 of file RgpotFactory.cpp.
| bool pot::recordEngineProvenance | ( | const EngineReport & | report | ) |
Write the report into the active tracking run as engine.* parameters, when one is active. Returns whether a run took it.
Definition at line 687 of file EngineRegistry.cpp.
| bool pot::recordOraclePath | ( | const OraclePathChoice & | choice | ) |
Record the choice on the active tracking run as oracle.path.
Definition at line 355 of file EngineRegistry.cpp.
| EngineReport pot::reportEngine | ( | const EnginePotential & | engine, |
| const EngineBinding & | binding ) |
Describe a loaded engine. Hashes the model file, so call it once at startup rather than per evaluation.
Definition at line 639 of file EngineRegistry.cpp.
| EngineReport pot::reportEngine | ( | const EnginePotential & | engine, |
| const EngineBinding & | binding, | ||
| const std::string & | model_sha256 ) |
The same report with the model digest supplied by the caller: the value of startModelDigest(binding.model_path), so no file is read here.
Definition at line 648 of file EngineRegistry.cpp.
| void pot::requireAotiPackageRunsOn | ( | const std::string & | path, |
| const HostIsa & | host ) |
requireAotiPackageRunsOnHost against an explicit host description.
Definition at line 270 of file AotiPackageIsa.cpp.
| void pot::requireAotiPackageRunsOnHost | ( | const std::string & | path | ) |
Throws std::runtime_error, before the package is loaded, when the package at path needs a known CPU extension the calling host lacks. A path that is not a readable file, a package without metadata, or one naming only unknown tokens passes (the loader reports a missing model); unknown tokens are reported on stderr.
Definition at line 316 of file AotiPackageIsa.cpp.
|
noexcept |
One count of oracle evaluations for the whole process. It is not a variable of any search loop: every potential evaluation, including stencils, refinement probes and escape-path stencils, adds to it. Nested wrappers count the outermost evaluation once.
Definition at line 20 of file PotentialWrapper.cpp.
| bool pot::resolveEngine | ( | const EngineRequest & | request, |
| EngineBinding & | binding, | ||
| std::string & | err ) |
Resolve a potential name to a library and a config message. The library is –potential-library when given, else the table's name under –engine-dir, else under $RGPOT_ENGINE_PATH, else the bare name for the loader's own search (rpath, LD_LIBRARY_PATH). A plugin request takes its config message from params_payload or params_path and needs no table entry; its library is –potential-library, or the table's name when the potential has one, and a bare library name is searched the same way.
Definition at line 409 of file EngineRegistry.cpp.
| bool pot::rgpotBackendAvailable | ( | const std::string & | name | ) |
Definition at line 726 of file RgpotFactory.cpp.
| std::vector< RgpotBackend > pot::rgpotBackends | ( | ) |
The same table drives construction, name validation and CLI discovery.
Definition at line 717 of file RgpotFactory.cpp.
| OraclePathChoice pot::selectOraclePath | ( | const std::string & | requested, |
| const std::string & | potential ) |
Pick the route. requested is "engine" or "direct" as given on the command line, or empty/"auto" for the default: the engine for a potential with a generic engine, the compiled-in backend for the rest, and for all of them when the binary has no Cap'n Proto. An explicit request is always honoured; a missing engine library is then an error, never a fall back.
Definition at line 330 of file EngineRegistry.cpp.
| OraclePathChoice pot::selectOraclePath | ( | const std::string & | requested, |
| const std::string & | potential, | ||
| bool | plugin ) |
As above; plugin (engineRequestIsPlugin) makes the engine the default for any name, since the request names the library and its parameters.
Definition at line 320 of file EngineRegistry.cpp.
| std::shared_future< std::string > pot::startModelDigest | ( | const std::string & | model_path | ) |
Hash a model file on a worker thread. The digest equals the one reportEngine computes, and an empty path yields an empty digest. A driver starts it on the reporting rank before it loads the engine, so the read of the file overlaps the load instead of following it.
Definition at line 662 of file EngineRegistry.cpp.
|
inlineconstexpr |
Negative energy variances at least this large, relative to 1 eV^2, are cancellation between the prior diagonal and the solved quadratic form. They are clamped to zero. A more negative value is an error.
Definition at line 38 of file PotentialWrapper.h.