|
PyTimeloop
|
A class to store the output statistics from Timeloop. More...
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, dict accesses, 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, MultipliableDict] | per_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 |
| accesses = accesses | |
| str | mapping = mapping |
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.
| 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, | ||
| dict | accesses, | ||
| str | mapping = "" ) |
| 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.
|
static |
Aggregate a list of OutputStats into a single OutputStats object.
Args: tests (List[OutputStats]): A list of OutputStats objects to aggregate.
|
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.
| pytimeloop.timeloopfe.v4.output_parsing.OutputStats.clear_zero_areas | ( | self | ) |
Remove components with zero area.
| pytimeloop.timeloopfe.v4.output_parsing.OutputStats.clear_zero_energies | ( | self | ) |
Remove components with zero energy.
| 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.
| 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.
| pytimeloop.timeloopfe.v4.output_parsing.OutputStats.combine_per_component_energy | ( | self, | |
| List[str] | from_keys, | ||
| str | to ) |
| 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.
| pytimeloop.timeloopfe.v4.output_parsing.OutputStats.scale_computes_by | ( | self, | |
| float | factor ) |
| pytimeloop.timeloopfe.v4.output_parsing.OutputStats.accesses = accesses |
| float pytimeloop.timeloopfe.v4.output_parsing.OutputStats.area = sum(per_component_area.values()) |
| int pytimeloop.timeloopfe.v4.output_parsing.OutputStats.computes = computes |
| float pytimeloop.timeloopfe.v4.output_parsing.OutputStats.computes_per_joule = self.computes / self.energy |
| float pytimeloop.timeloopfe.v4.output_parsing.OutputStats.computes_per_second = computes / cycle_seconds / cycles |
| tuple pytimeloop.timeloopfe.v4.output_parsing.OutputStats.computes_per_second_per_square_meter |
| float pytimeloop.timeloopfe.v4.output_parsing.OutputStats.cycle_seconds = cycle_seconds |
| int pytimeloop.timeloopfe.v4.output_parsing.OutputStats.cycles = cycles |
| float pytimeloop.timeloopfe.v4.output_parsing.OutputStats.energy = sum(per_component_energy.values()) |
| float pytimeloop.timeloopfe.v4.output_parsing.OutputStats.latency = cycles * cycle_seconds |
| str pytimeloop.timeloopfe.v4.output_parsing.OutputStats.mapping = mapping |
| Dict[str, float] pytimeloop.timeloopfe.v4.output_parsing.OutputStats.per_component_area |
| Dict[str, float] pytimeloop.timeloopfe.v4.output_parsing.OutputStats.per_component_energy |
| float pytimeloop.timeloopfe.v4.output_parsing.OutputStats.percent_utilization = percent_utilization |
| dict pytimeloop.timeloopfe.v4.output_parsing.OutputStats.variables = copy.deepcopy(variables) |