Loading...
Searching...
No Matches
gpr::DeviceResidency Struct Reference

#include <gpr/ml/PhaseTimers.h>

Public Types

enum  Reason {
  NoPairKernel , NoConstantKernel , NonGaussianLikelihood , EnvironmentModel ,
  StableBasis , ResidualCorrection , ManifoldChart , GeodesicHeatKernel ,
  ObjectiveNotNlml , LengthScalesNotPerPairType , ReasonCount
}

Static Public Member Functions

static std::string report (const char *execution)
 One line for the drivers' closing report.
static std::string fallbackReasons ()
 The properties behind the fallbacks, or nothing when there were none.

Static Public Attributes

static std::atomic_size_t conditions = 0
static std::atomic_size_t host_fallbacks = 0
static std::atomic_size_t factorizations = 0
static std::atomic_size_t appends = 0
static std::atomic_size_t reuses = 0
static std::atomic_size_t gradients = 0
static std::atomic_size_t predictions = 0
static std::atomic_size_t input_bytes = 0
static std::atomic_size_t output_bytes = 0
static std::atomic_size_t factor_downloads = 0
static std::atomic_size_t factor_download_bytes = 0
static std::atomic_size_t coefficient_downloads = 0
static std::atomic_size_t coefficient_download_bytes = 0
static std::atomic_size_t fallback_reasons [ReasonCount] = {}
static constexpr const char * reason_names [ReasonCount]

Detailed Description

Process-wide account of where the GP posterior lived during a run of a Kokkos build. A fit either conditions the device posterior or, when the model is outside what that posterior supports, falls back to the host factor; host_fallbacks counts the latter, so a run whose GP never reached the device shows it. Bytes are what crossed the host boundary: coordinates, targets and noise in; predictions, scalar derivatives and any downloaded factor or coefficient vector out. A factor or coefficient download means a consumer read host storage, which ends residency for that fit. Static, like PhaseTimers, so model copies cannot lose a count.

Definition at line 194 of file PhaseTimers.h.

Member Enumeration Documentation

◆ Reason

Why a fit fell back: the model properties the device posterior does not support. A fit counts once under each property it has.

Enumerator
NoPairKernel 
NoConstantKernel 
NonGaussianLikelihood 
EnvironmentModel 
StableBasis 
ResidualCorrection 
ManifoldChart 
GeodesicHeatKernel 
ObjectiveNotNlml 
LengthScalesNotPerPairType 
ReasonCount 

Definition at line 211 of file PhaseTimers.h.

Member Function Documentation

◆ fallbackReasons()

std::string gpr::DeviceResidency::fallbackReasons ( )
inlinestatic

The properties behind the fallbacks, or nothing when there were none.

Definition at line 260 of file PhaseTimers.h.

261 {
262 std::string text;
263 for (int r = 0; r < ReasonCount; ++r) {
264 const std::size_t count = fallback_reasons[r].load();
265 if (count == 0) continue;
266 text += text.empty() ? "; fallback reasons: " : ", ";
267 text += std::string(reason_names[r]) + " " + std::to_string(count);
268 }
269 return text;
270 }
static constexpr const char * reason_names[ReasonCount]
static std::atomic_size_t fallback_reasons[ReasonCount]

◆ report()

std::string gpr::DeviceResidency::report ( const char * execution)
inlinestatic

One line for the drivers' closing report.

Definition at line 239 of file PhaseTimers.h.

240 {
241 return std::string("Device posterior: execution ") + execution +
242 ", device fits " + std::to_string(conditions.load()) +
243 " (factorizations " + std::to_string(factorizations.load()) +
244 ", appends " + std::to_string(appends.load()) + ", reuses " +
245 std::to_string(reuses.load()) + "), host fallbacks " +
246 std::to_string(host_fallbacks.load()) + ", gradients " +
247 std::to_string(gradients.load()) + ", predictions " +
248 std::to_string(predictions.load()) + ", bytes to device " +
249 std::to_string(input_bytes.load()) + ", bytes to host " +
250 std::to_string(output_bytes.load()) + ", factor downloads " +
251 std::to_string(factor_downloads.load()) + " (" +
252 std::to_string(factor_download_bytes.load()) +
253 " bytes), coefficient downloads " +
254 std::to_string(coefficient_downloads.load()) + " (" +
255 std::to_string(coefficient_download_bytes.load()) + " bytes)" +
257 }
static std::atomic_size_t coefficient_downloads
static std::atomic_size_t input_bytes
static std::atomic_size_t factor_downloads
static std::atomic_size_t coefficient_download_bytes
static std::atomic_size_t factor_download_bytes
static std::atomic_size_t conditions
static std::atomic_size_t appends
static std::atomic_size_t reuses
static std::atomic_size_t host_fallbacks
static std::atomic_size_t output_bytes
static std::atomic_size_t gradients
static std::atomic_size_t predictions
static std::atomic_size_t factorizations
static std::string fallbackReasons()
The properties behind the fallbacks, or nothing when there were none.

Member Data Documentation

◆ appends

std::atomic_size_t gpr::DeviceResidency::appends = 0
inlinestatic

Definition at line 198 of file PhaseTimers.h.

◆ coefficient_download_bytes

std::atomic_size_t gpr::DeviceResidency::coefficient_download_bytes = 0
inlinestatic

Definition at line 207 of file PhaseTimers.h.

◆ coefficient_downloads

std::atomic_size_t gpr::DeviceResidency::coefficient_downloads = 0
inlinestatic

Definition at line 206 of file PhaseTimers.h.

◆ conditions

std::atomic_size_t gpr::DeviceResidency::conditions = 0
inlinestatic

Definition at line 195 of file PhaseTimers.h.

◆ factor_download_bytes

std::atomic_size_t gpr::DeviceResidency::factor_download_bytes = 0
inlinestatic

Definition at line 205 of file PhaseTimers.h.

◆ factor_downloads

std::atomic_size_t gpr::DeviceResidency::factor_downloads = 0
inlinestatic

Definition at line 204 of file PhaseTimers.h.

◆ factorizations

std::atomic_size_t gpr::DeviceResidency::factorizations = 0
inlinestatic

Definition at line 197 of file PhaseTimers.h.

◆ fallback_reasons

std::atomic_size_t gpr::DeviceResidency::fallback_reasons[ReasonCount] = {}
inlinestatic

Definition at line 224 of file PhaseTimers.h.

224{};

◆ gradients

std::atomic_size_t gpr::DeviceResidency::gradients = 0
inlinestatic

Definition at line 200 of file PhaseTimers.h.

◆ host_fallbacks

std::atomic_size_t gpr::DeviceResidency::host_fallbacks = 0
inlinestatic

Definition at line 196 of file PhaseTimers.h.

◆ input_bytes

std::atomic_size_t gpr::DeviceResidency::input_bytes = 0
inlinestatic

Definition at line 202 of file PhaseTimers.h.

◆ output_bytes

std::atomic_size_t gpr::DeviceResidency::output_bytes = 0
inlinestatic

Definition at line 203 of file PhaseTimers.h.

◆ predictions

std::atomic_size_t gpr::DeviceResidency::predictions = 0
inlinestatic

Definition at line 201 of file PhaseTimers.h.

◆ reason_names

const char* gpr::DeviceResidency::reason_names[ReasonCount]
staticconstexpr
Initial value:
= {
"no pair kernel",
"no constant kernel",
"non-Gaussian likelihood",
"environment model",
"stable-basis (HS-SVD) backend",
"residual correction",
"manifold chart",
"geodesic heat kernel",
"objective other than NLML",
"length scales not one per pair type",
}

Definition at line 225 of file PhaseTimers.h.

225 {
226 "no pair kernel",
227 "no constant kernel",
228 "non-Gaussian likelihood",
229 "environment model",
230 "stable-basis (HS-SVD) backend",
231 "residual correction",
232 "manifold chart",
233 "geodesic heat kernel",
234 "objective other than NLML",
235 "length scales not one per pair type",
236 };

◆ reuses

std::atomic_size_t gpr::DeviceResidency::reuses = 0
inlinestatic

Definition at line 199 of file PhaseTimers.h.


The documentation for this struct was generated from the following file: