Class ProfilingSnapshot
- Namespace
- DotCompute.Abstractions.Profiling
- Assembly
- DotCompute.Abstractions.dll
Represents a comprehensive profiling snapshot of accelerator performance at a point in time.
public sealed class ProfilingSnapshot
- Inheritance
-
ProfilingSnapshot
- Inherited Members
Remarks
This snapshot provides detailed performance metrics for kernel execution, memory operations, and overall device utilization. It is designed for performance analysis, optimization, and runtime decision-making.
Unlike health monitoring which focuses on device availability and hardware status, profiling focuses on execution performance and resource utilization patterns.
Use Cases: - Performance benchmarking and comparison - Identifying bottlenecks in kernel execution - Memory transfer optimization - Backend selection based on workload characteristics - Real-time performance monitoring dashboards
Properties
AverageLatencyMs
Gets the average operation latency in milliseconds.
public double AverageLatencyMs { get; init; }
Property Value
BackendType
Gets the backend type (e.g., "CUDA", "Metal", "OpenCL", "CPU").
public required string BackendType { get; init; }
Property Value
DeviceId
Gets the unique identifier for the device being profiled.
public required string DeviceId { get; init; }
Property Value
DeviceName
Gets the friendly name of the device being profiled.
public required string DeviceName { get; init; }
Property Value
DeviceUtilizationPercent
Gets the overall device utilization percentage (0-100).
public double DeviceUtilizationPercent { get; init; }
Property Value
Remarks
Represents the fraction of time the device was actively executing work. Values near 100% indicate high utilization, values near 0% indicate idle time.
IdentifiedBottlenecks
Gets bottlenecks identified in the profiling data.
public IReadOnlyList<string> IdentifiedBottlenecks { get; init; }
Property Value
IsAvailable
Gets whether profiling data is available for this device.
public bool IsAvailable { get; init; }
Property Value
KernelStats
Gets the current kernel execution statistics.
public KernelProfilingStats? KernelStats { get; init; }
Property Value
MemoryStats
Gets the current memory operation statistics.
public MemoryProfilingStats? MemoryStats { get; init; }
Property Value
Metrics
Gets the collection of profiling metrics for this snapshot.
public IReadOnlyList<ProfilingMetric> Metrics { get; init; }
Property Value
PerformanceTrends
Gets performance trends identified in recent profiling data.
public IReadOnlyList<string> PerformanceTrends { get; init; }
Property Value
Recommendations
Gets optimization recommendations based on profiling data.
public IReadOnlyList<string> Recommendations { get; init; }
Property Value
StatusMessage
Gets the profiling status message providing context about the current state.
public string StatusMessage { get; init; }
Property Value
ThroughputOpsPerSecond
Gets the throughput in operations per second.
public double ThroughputOpsPerSecond { get; init; }
Property Value
Timestamp
Gets the timestamp when this snapshot was captured.
public DateTimeOffset Timestamp { get; init; }
Property Value
TotalOperations
Gets the total number of operations profiled since last reset.
public long TotalOperations { get; init; }
Property Value
Methods
CreateUnavailable(string, string, string, string)
Creates an unavailable profiling snapshot when profiling is not supported or enabled.
public static ProfilingSnapshot CreateUnavailable(string deviceId, string deviceName, string backendType, string reason)
Parameters
deviceIdstringDevice identifier.
deviceNamestringDevice name.
backendTypestringBackend type.
reasonstringReason why profiling is unavailable.
Returns
- ProfilingSnapshot
A profiling snapshot indicating unavailability.