6 #ifndef GPUACTIVITYAGENT_HPP_INCLUDE
7 #define GPUACTIVITYAGENT_HPP_INCLUDE
26 std::shared_ptr<Waiter> waiter);
28 void init(
int level,
const std::vector<int> &fan_in,
bool is_level_root)
override;
31 std::vector<std::vector<double> > &out_policy)
override;
34 std::vector<double> &out_sample)
override;
39 void wait(
void)
override;
40 std::vector<std::pair<std::string, std::string> >
report_header(
void)
const override;
41 std::vector<std::pair<std::string, std::string> >
report_host(
void)
const override;
42 std::map<uint64_t, std::vector<std::pair<std::string, std::string> > >
report_region(
void)
const override;
43 std::vector<std::string>
trace_names(
void)
const override;
45 void enforce_policy(
const std::vector<double> &policy)
const override;
46 std::vector<std::function<std::string(
double)> >
trace_formats(
void)
const override;
53 PlatformIO &m_platform_io;
54 const PlatformTopo &m_platform_topo;
55 static constexpr
double M_WAIT_SEC = 0.020;
56 const double M_POLICY_PHI_DEFAULT;
58 const int M_NUM_GPU_CHIP;
59 const int M_NUM_CHIP_PER_GPU;
60 bool m_do_write_batch;
61 bool m_do_send_policy;
63 int m_agent_domain_count;
89 std::map<std::string, double> m_policy_available;
91 double m_gpu_frequency_requests;
92 double m_gpu_frequency_clipped;
93 double m_freq_gpu_min;
94 double m_freq_gpu_max;
95 double m_freq_gpu_efficient;
96 double m_resolved_f_gpu_max;
97 double m_resolved_f_gpu_efficient;
100 std::vector<m_signal> m_gpu_core_activity;
101 std::vector<m_signal> m_gpu_utilization;
102 std::vector<m_signal> m_gpu_energy;
105 std::vector<m_control> m_gpu_freq_min_control;
106 std::vector<m_control> m_gpu_freq_max_control;
107 std::shared_ptr<Waiter> m_waiter;
109 void init_platform_io(
void);
Agent.
Definition: GPUActivityAgent.hpp:22
void adjust_platform(const std::vector< double > &in_policy) override
Adjust the platform settings based the policy from above.
Definition: GPUActivityAgent.cpp:220
static std::string plugin_name(void)
Definition: GPUActivityAgent.cpp:431
void split_policy(const std::vector< double > &in_policy, std::vector< std::vector< double > > &out_policy) override
Called by Controller to split policy for children at next level down the tree.
Definition: GPUActivityAgent.cpp:192
std::map< uint64_t, std::vector< std::pair< std::string, std::string > > > report_region(void) const override
Custom fields for each region in the report.
Definition: GPUActivityAgent.cpp:405
bool do_send_sample(void) const override
Definition: GPUActivityAgent.cpp:215
void validate_policy(std::vector< double > &in_policy) const override
Called by Controller to validate incoming policy values and configure defaults requested in incoming ...
Definition: GPUActivityAgent.cpp:172
bool do_send_policy(void) const override
Called by Controller to determine if new policy values should be sent down the tree to the Agent's ch...
Definition: GPUActivityAgent.cpp:203
std::vector< std::pair< std::string, std::string > > report_header(void) const override
Custom fields that will be added to the report header when this agent is used.
Definition: GPUActivityAgent.cpp:384
static std::unique_ptr< Agent > make_plugin(void)
Definition: GPUActivityAgent.cpp:437
static std::vector< std::string > sample_names(void)
Definition: GPUActivityAgent.cpp:449
static std::vector< std::string > policy_names(void)
Definition: GPUActivityAgent.cpp:443
virtual ~GPUActivityAgent()=default
void wait(void) override
Called by Controller to wait for sample period to elapse. This controls the cadence of the Controller...
Definition: GPUActivityAgent.cpp:378
void trace_values(std::vector< double > &values) override
Called by Controller to get latest values to be added to the trace.
Definition: GPUActivityAgent.cpp:417
std::vector< std::pair< std::string, std::string > > report_host(void) const override
Custom fields for the host section of the report.
Definition: GPUActivityAgent.cpp:390
void sample_platform(std::vector< double > &out_sample) override
Read signals from the platform and interpret/aggregate these signals to create a sample which can be ...
Definition: GPUActivityAgent.cpp:356
GPUActivityAgent()
Definition: GPUActivityAgent.cpp:28
std::vector< std::function< std::string(double)> > trace_formats(void) const override
Returns format string for each column added to the trace.
Definition: GPUActivityAgent.cpp:425
void aggregate_sample(const std::vector< std::vector< double > > &in_sample, std::vector< double > &out_sample) override
Aggregate samples from children for the next level up the tree.
Definition: GPUActivityAgent.cpp:208
void init(int level, const std::vector< int > &fan_in, bool is_level_root) override
Set the level where this Agent is active and push signals/controls for that level.
Definition: GPUActivityAgent.cpp:63
bool do_write_batch(void) const override
Called by the Controller to decide whether to call write_batch() to update platform controls.
Definition: GPUActivityAgent.cpp:350
std::vector< std::string > trace_names(void) const override
Column headers to be added to the trace.
Definition: GPUActivityAgent.cpp:411
void enforce_policy(const std::vector< double > &policy) const override
Enforce the policy one time with PlatformIO::write_control(). Called to enforce static policies in th...
Definition: GPUActivityAgent.cpp:421
Definition: Accumulator.cpp:12