PyTimeloop
Loading...
Searching...
No Matches
pytimeloop.timeloopfe.v4.output_parsing.OutputStats Class Reference

A class to store the output statistics from Timeloop. More...

Collaboration diagram for pytimeloop.timeloopfe.v4.output_parsing.OutputStats:

Public Member Functions

 __init__ (self, float percent_utilization, int computes, int cycles, float cycle_seconds, Dict[str, float] per_component_energy, Dict[str, float] per_component_area, dict variables, str mapping="")
 
 scale_computes_by (self, float factor)
 
Any access (self, str key)
 Access a key in the OutputStats object.
 
 combine_per_component_area (self, List[str] from_keys, str to)
 Combine the area of multiple components into a single component.
 
 combine_per_component_energy (self, List[str] from_keys, str to)
 
 combine_per_component_area_energy (self, List[str] from_keys, str to)
 Combine the area and energy of multiple components into a single component.
 
 clear_zero_energies (self)
 Remove components with zero energy.
 
 clear_zero_areas (self)
 Remove components with zero area.
 
Union[float, MultipliableDictper_compute (self, str key)
 Returns a value scaled by the number of computes.
 

Static Public Member Functions

"OutputStats" aggregate (List["OutputStats"] tests)
 Aggregate a list of OutputStats into a single OutputStats object.
 
"OutputStatsList" aggregate_by (List["OutputStats"] tests, *Union[List[str], str] keys)
 Aggregate a list of OutputStats objects by a set of keys.
 

Public Attributes

float percent_utilization = percent_utilization
 
int computes = computes
 
int cycles = cycles
 
float cycle_seconds = cycle_seconds
 
float latency = cycles * cycle_seconds
 
Dict[str, float] per_component_energy
 
Dict[str, float] per_component_area
 
dict variables = copy.deepcopy(variables)
 
float area = sum(per_component_area.values())
 
float energy = sum(per_component_energy.values())
 
float computes_per_second = computes / cycle_seconds / cycles
 
tuple computes_per_second_per_square_meter
 
float computes_per_joule = self.computes / self.energy
 
str mapping = mapping
 

Detailed Description

A class to store the output statistics from Timeloop.

Parameters: percent_utilization (float): The utilization percentage. computes (int): The number of computes. cycles (int): The number of cycles. cycle_seconds (float): The duration of a cycle in seconds. per_component_energy (Dict[str, float]): The energy consumed by each component in Joules. per_component_area (Dict[str, float]): The area of each component in square meters. variables (dict): The variables used in the specification. mapping (str): The mapping result.

Constructor & Destructor Documentation

◆ __init__()

pytimeloop.timeloopfe.v4.output_parsing.OutputStats.__init__ ( self,
float percent_utilization,
int computes,
int cycles,
float cycle_seconds,
Dict[str, float] per_component_energy,
Dict[str, float] per_component_area,
dict variables,
str mapping = "" )

Member Function Documentation

◆ access()

Any pytimeloop.timeloopfe.v4.output_parsing.OutputStats.access ( self,
str key )

Access a key in the OutputStats object.

If the key is not found, check the variables.

Args: key (str): The key to access.

Returns: Any: The value of the key.

◆ aggregate()

"OutputStats" pytimeloop.timeloopfe.v4.output_parsing.OutputStats.aggregate ( List["OutputStats"] tests)
static

Aggregate a list of OutputStats into a single OutputStats object.

Args: tests (List[OutputStats]): A list of OutputStats objects to aggregate.

◆ aggregate_by()

"OutputStatsList" pytimeloop.timeloopfe.v4.output_parsing.OutputStats.aggregate_by ( List["OutputStats"] tests,
*Union[List[str], str] keys )
static

Aggregate a list of OutputStats objects by a set of keys.

OutputStats with equal values for the keys will be aggregated together. OutputStats with different values for the keys will be aggregated separately and returned as a list.

Args: tests (List[OutputStats]): A list of OutputStats objects to aggregate. keys (List[str]): The keys to aggregate by.

Returns: OutputStatsList: A list of aggregated OutputStats objects.

◆ clear_zero_areas()

pytimeloop.timeloopfe.v4.output_parsing.OutputStats.clear_zero_areas ( self)

Remove components with zero area.

◆ clear_zero_energies()

pytimeloop.timeloopfe.v4.output_parsing.OutputStats.clear_zero_energies ( self)

Remove components with zero energy.

◆ combine_per_component_area()

pytimeloop.timeloopfe.v4.output_parsing.OutputStats.combine_per_component_area ( self,
List[str] from_keys,
str to )

Combine the area of multiple components into a single component.

Args: from_keys (List[str]): The keys of the components to combine. to (str): The key to combine the components into.

◆ combine_per_component_area_energy()

pytimeloop.timeloopfe.v4.output_parsing.OutputStats.combine_per_component_area_energy ( self,
List[str] from_keys,
str to )

Combine the area and energy of multiple components into a single component.

Args: from_keys (List[str]): The keys of the components to combine. to (str): The key to combine the components into.

◆ combine_per_component_energy()

pytimeloop.timeloopfe.v4.output_parsing.OutputStats.combine_per_component_energy ( self,
List[str] from_keys,
str to )

◆ per_compute()

Union[float, MultipliableDict] pytimeloop.timeloopfe.v4.output_parsing.OutputStats.per_compute ( self,
str key )

Returns a value scaled by the number of computes.

Args: key (str): The key to access.

Returns: Union[float, MultipliableDict]: The scaled value.

◆ scale_computes_by()

pytimeloop.timeloopfe.v4.output_parsing.OutputStats.scale_computes_by ( self,
float factor )

Member Data Documentation

◆ area

float pytimeloop.timeloopfe.v4.output_parsing.OutputStats.area = sum(per_component_area.values())

◆ computes

int pytimeloop.timeloopfe.v4.output_parsing.OutputStats.computes = computes

◆ computes_per_joule

float pytimeloop.timeloopfe.v4.output_parsing.OutputStats.computes_per_joule = self.computes / self.energy

◆ computes_per_second

float pytimeloop.timeloopfe.v4.output_parsing.OutputStats.computes_per_second = computes / cycle_seconds / cycles

◆ computes_per_second_per_square_meter

tuple pytimeloop.timeloopfe.v4.output_parsing.OutputStats.computes_per_second_per_square_meter
Initial value:
= (
self.computes_per_second / self.area
)

◆ cycle_seconds

float pytimeloop.timeloopfe.v4.output_parsing.OutputStats.cycle_seconds = cycle_seconds

◆ cycles

int pytimeloop.timeloopfe.v4.output_parsing.OutputStats.cycles = cycles

◆ energy

float pytimeloop.timeloopfe.v4.output_parsing.OutputStats.energy = sum(per_component_energy.values())

◆ latency

float pytimeloop.timeloopfe.v4.output_parsing.OutputStats.latency = cycles * cycle_seconds

◆ mapping

str pytimeloop.timeloopfe.v4.output_parsing.OutputStats.mapping = mapping

◆ per_component_area

Dict[str, float] pytimeloop.timeloopfe.v4.output_parsing.OutputStats.per_component_area
Initial value:
= MultipliableDict(
**per_component_area
)

◆ per_component_energy

Dict[str, float] pytimeloop.timeloopfe.v4.output_parsing.OutputStats.per_component_energy
Initial value:
= MultipliableDict(
**per_component_energy
)

◆ percent_utilization

float pytimeloop.timeloopfe.v4.output_parsing.OutputStats.percent_utilization = percent_utilization

◆ variables

dict pytimeloop.timeloopfe.v4.output_parsing.OutputStats.variables = copy.deepcopy(variables)

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