Documentation ¶
Index ¶
- type AllWeights
- type CategoricalFeature
- type ComponentFeatures
- type ComponentModelWeights
- type LinearRegressor
- func (r *LinearRegressor) AddDesiredOutValue(y float64)
- func (r *LinearRegressor) AddNodeFeatureValues(x []float64)
- func (r *LinearRegressor) AddProcessFeatureValues(x []float64)
- func (r *LinearRegressor) GetComponentsPower(isIdlePower bool) ([]source.NodeComponentsEnergy, error)
- func (r *LinearRegressor) GetGPUPower(isIdlePower bool) ([]float64, error)
- func (r *LinearRegressor) GetModelType() types.ModelType
- func (r *LinearRegressor) GetNodeFeatureNamesList() []string
- func (r *LinearRegressor) GetPlatformPower(isIdlePower bool) ([]float64, error)
- func (r *LinearRegressor) GetProcessFeatureNamesList() []string
- func (r *LinearRegressor) IsEnabled() bool
- func (r *LinearRegressor) ResetSampleIdx()
- func (r *LinearRegressor) Start() error
- func (r *LinearRegressor) Train() error
- type ModelRequest
- type ModelWeights
- type NormalizedNumericalFeature
- type PlaformFeatures
- type RatioPowerModel
- func (r *RatioPowerModel) AddDesiredOutValue(y float64)
- func (r *RatioPowerModel) AddNodeFeatureValues(x []float64)
- func (r *RatioPowerModel) AddProcessFeatureValues(x []float64)
- func (r *RatioPowerModel) GetComponentsPower(isIdlePower bool) ([]source.NodeComponentsEnergy, error)
- func (r *RatioPowerModel) GetGPUPower(isIdlePower bool) ([]float64, error)
- func (r *RatioPowerModel) GetModelType() types.ModelType
- func (r *RatioPowerModel) GetNodeFeatureNamesList() []string
- func (r *RatioPowerModel) GetPlatformPower(isIdlePower bool) ([]float64, error)
- func (r *RatioPowerModel) GetProcessFeatureNamesList() []string
- func (r *RatioPowerModel) IsEnabled() bool
- func (r *RatioPowerModel) ResetSampleIdx()
- func (r *RatioPowerModel) Train() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllWeights ¶
type AllWeights struct { BiasWeight float64 `json:"Bias_Weight"` CategoricalVariables map[string]map[string]CategoricalFeature `json:"Categorical_Variables"` NumericalVariables map[string]NormalizedNumericalFeature `json:"Numerical_Variables"` }
type CategoricalFeature ¶
type CategoricalFeature struct {
Weight float64 `json:"weight"`
}
type ComponentFeatures ¶ added in v0.5.4
type ComponentFeatures int
The ratio features list follows this order
const ( PkgUsageMetric ComponentFeatures = iota CoreUsageMetric DramUsageMetric UncoreUsageMetric OtherUsageMetric GpuUsageMetric PkgDynPower CoreDynPower DramDynPower UncoreDynPower OtherDynPower GpuDynPower PkgIdlePower CoreIdlePower DramIdlePower UncoreIdlePower OtherIdlePower GpuIdlePower )
The ratio power model can be used for both node Component and Platform power estimation. The models for Component and Platform power estimation have different number of features.
type ComponentModelWeights ¶
type ComponentModelWeights map[string]ModelWeights
ComponentModelWeights defines structure for multiple (power component's) weights { "core":
{"All_Weights": { "Bias_Weight": 1.0, "Categorical_Variables": {"cpu_architecture": {"Sky Lake": {"weight": 1.0}}}, "Numerical_Variables": {"cpu_cycles": {"mean": 0, "variance": 1.0, "weight": 1.0}} } },
"dram": {"All_Weights":
{ "Bias_Weight": 1.0, "Categorical_Variables": {"cpu_architecture": {"Sky Lake": {"weight": 1.0}}}, "Numerical_Variables": {"cache_miss": {"mean": 0, "variance": 1.0, "weight": 1.0}} } }
type LinearRegressor ¶
type LinearRegressor struct { ModelServerEndpoint string OutputType types.ModelOutputType EnergySource string TrainerName string SelectFilter string ModelWeightsURL string ModelWeightsFilepath string FloatFeatureNames []string SystemMetaDataFeatureNames []string SystemMetaDataFeatureValues []string // contains filtered or unexported fields }
LinearRegressor defines power estimator with linear regression approach
func (*LinearRegressor) AddDesiredOutValue ¶ added in v0.5.4
func (r *LinearRegressor) AddDesiredOutValue(y float64)
AddDesiredOutValue adds the the y, which is the response variable (or the dependent variable) of regression. LinearRegressor is trained off-line then we do not add Y for trainning. We might implement it in the future.
func (*LinearRegressor) AddNodeFeatureValues ¶ added in v0.5.4
func (r *LinearRegressor) AddNodeFeatureValues(x []float64)
AddNodeFeatureValues adds the the x for prediction, which is the variable used to calculate the ratio. LinearRegressor is not trained, then we cannot Add training samples, only samples for prediction. The LinearRegressor does not differentiate node or process power estimation, the difference will only be the amount of resource utilization
func (*LinearRegressor) AddProcessFeatureValues ¶ added in v0.7.3
func (r *LinearRegressor) AddProcessFeatureValues(x []float64)
AddProcessFeatureValues adds the the x for prediction, which are the explanatory variables (or the independent variable) of regression. LinearRegressor is trained off-line then we cannot Add training samples. We might implement it in the future. The LinearRegressor does not differentiate node or process power estimation, the difference will only be the amount of resource utilization
func (*LinearRegressor) GetComponentsPower ¶ added in v0.5.4
func (r *LinearRegressor) GetComponentsPower(isIdlePower bool) ([]source.NodeComponentsEnergy, error)
GetComponentsPower applies each component's ModelWeight prediction and return a map of component power associated to each process/process/pod
func (*LinearRegressor) GetGPUPower ¶ added in v0.5.4
func (r *LinearRegressor) GetGPUPower(isIdlePower bool) ([]float64, error)
GetComponentsPower returns GPU Power in Watts associated to each each process
func (*LinearRegressor) GetModelType ¶ added in v0.5.4
func (r *LinearRegressor) GetModelType() types.ModelType
GetModelType returns the model type
func (*LinearRegressor) GetNodeFeatureNamesList ¶ added in v0.5.4
func (r *LinearRegressor) GetNodeFeatureNamesList() []string
GetNodeFeatureNamesList returns the list of float features that the model was configured to use The LinearRegressor does not differentiate node or process power estimation, the difference will only be the amount of resource utilization
func (*LinearRegressor) GetPlatformPower ¶ added in v0.5.4
func (r *LinearRegressor) GetPlatformPower(isIdlePower bool) ([]float64, error)
GetPlatformPower applies ModelWeight prediction and return a list of power associated to each process/process/pod
func (*LinearRegressor) GetProcessFeatureNamesList ¶ added in v0.7.3
func (r *LinearRegressor) GetProcessFeatureNamesList() []string
GetProcessFeatureNamesList returns the list of float features that the model was configured to use The LinearRegressor does not differentiate node or process power estimation, the difference will only be the amount of resource utilization
func (*LinearRegressor) IsEnabled ¶ added in v0.5.4
func (r *LinearRegressor) IsEnabled() bool
IsEnabled returns true if the power model was trained and is active
func (*LinearRegressor) ResetSampleIdx ¶ added in v0.5.4
func (r *LinearRegressor) ResetSampleIdx()
ResetSampleIdx set the sample vector index to 0 to overwrite the old samples with new ones for trainning or prediction.
func (*LinearRegressor) Start ¶ added in v0.5.4
func (r *LinearRegressor) Start() error
Start returns nil if model weight is obtainable
func (*LinearRegressor) Train ¶ added in v0.5.4
func (r *LinearRegressor) Train() error
Train triggers the regressiong fit after adding data points to create a new power model. LinearRegressor is trained off-line then we cannot trigger the trainning. We might implement it in the future.
type ModelRequest ¶
type ModelRequest struct { MetricNames []string `json:"metrics"` OutputType string `json:"output_type"` EnergySource string `json:"source"` NodeType int `json:"node_type"` Weight bool `json:"weight"` TrainerName string `json:"trainer_name"` SelectFilter string `json:"filter"` }
ModelRequest defines a request to Kepler Model Server to get model weights
type ModelWeights ¶
type ModelWeights struct {
AllWeights `json:"All_Weights"`
}
ModelWeights, AllWeight, CategoricalFeature, NormalizedNumericalFeature define structure of model weight { "All_Weights":
{ "Bias_Weight": 1.0, "Categorical_Variables": {"cpu_architecture": {"Sky Lake": {"weight": 1.0}}}, "Numerical_Variables": {"cpu_cycles": {"mean": 0, "variance": 1.0, "weight": 1.0}} } }
type PlaformFeatures ¶ added in v0.5.4
type PlaformFeatures int
const ( // Node features are at the end of the feature list PlatformUsageMetric PlaformFeatures = iota PlatformDynPower PlatformIdlePower )
type RatioPowerModel ¶ added in v0.5.4
type RatioPowerModel struct { NodeFeatureNames []string ProcessFeatureNames []string // contains filtered or unexported fields }
RatioPowerModel stores the feature samples of each process for prediction The feature will added ordered from cycles, instructions and cache-misses
func (*RatioPowerModel) AddDesiredOutValue ¶ added in v0.5.4
func (r *RatioPowerModel) AddDesiredOutValue(y float64)
AddDesiredOutValue adds the the y, which is the response variable (or the dependent variable) of regression. RatioPowerModel is not trained, then we cannot Add training samples.
func (*RatioPowerModel) AddNodeFeatureValues ¶ added in v0.5.4
func (r *RatioPowerModel) AddNodeFeatureValues(x []float64)
AddNodeFeatureValues adds the the x for prediction, which is the variable used to calculate the ratio. RatioPowerModel is not trained, then we cannot Add training samples, only samples for prediction.
func (*RatioPowerModel) AddProcessFeatureValues ¶ added in v0.7.3
func (r *RatioPowerModel) AddProcessFeatureValues(x []float64)
AddProcessFeatureValues adds the the x for prediction, which is the variable used to calculate the ratio. RatioPowerModel is not trained, then we cannot Add training samples, only samples for prediction.
func (*RatioPowerModel) GetComponentsPower ¶ added in v0.5.4
func (r *RatioPowerModel) GetComponentsPower(isIdlePower bool) ([]source.NodeComponentsEnergy, error)
GetComponentsPower applies each component's ModelWeight prediction and return a map of component powers
func (*RatioPowerModel) GetGPUPower ¶ added in v0.5.4
func (r *RatioPowerModel) GetGPUPower(isIdlePower bool) ([]float64, error)
GetComponentsPower returns GPU Power in Watts associated to each each process/process/pod
func (*RatioPowerModel) GetModelType ¶ added in v0.5.4
func (r *RatioPowerModel) GetModelType() types.ModelType
GetModelType returns the model type
func (*RatioPowerModel) GetNodeFeatureNamesList ¶ added in v0.5.4
func (r *RatioPowerModel) GetNodeFeatureNamesList() []string
GetNodeFeatureNamesList returns the list of process features that the model was configured to use
func (*RatioPowerModel) GetPlatformPower ¶ added in v0.5.4
func (r *RatioPowerModel) GetPlatformPower(isIdlePower bool) ([]float64, error)
GetPlatformPower applies ModelWeight prediction and return a list of total powers
func (*RatioPowerModel) GetProcessFeatureNamesList ¶ added in v0.7.3
func (r *RatioPowerModel) GetProcessFeatureNamesList() []string
GetProcessFeatureNamesList returns the list of process features that the model was configured to use
func (*RatioPowerModel) IsEnabled ¶ added in v0.5.4
func (r *RatioPowerModel) IsEnabled() bool
IsEnabled returns true as Ratio Power model is always active
func (*RatioPowerModel) ResetSampleIdx ¶ added in v0.5.4
func (r *RatioPowerModel) ResetSampleIdx()
ResetSampleIdx set the sample vector index to 0 to overwrite the old samples with new ones for trainning or prediction.
func (*RatioPowerModel) Train ¶ added in v0.5.4
func (r *RatioPowerModel) Train() error
RatioPowerModel is not trained, then this function does nothing.