-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Turn statistics into GAP Records (#166)
* Changing record names to match GAP and adding some missing type checking * Fixing other unit tests * Updating time to first token records * Updating inter token latency records * Updaing output token throughput record * Adding output token throughput per request records * Adding output sequence length (OSL) records * Adding Input sequence length (ISL) records * Removing non-GAP records * Adding telemetry records * Fixing unit testing * Adding request goodput record * Adding method to create records from statistics * Added very basic unit testing * Remove demo file (accidental commit) * Fix codeql error
- Loading branch information
Showing
104 changed files
with
2,128 additions
and
2,541 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
genai-perf/genai_perf/record/types/gpu_energy_consumption.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Copyright 2021-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from functools import total_ordering | ||
|
||
from genai_perf.record.gpu_record import DecreasingGPURecord | ||
|
||
|
||
@total_ordering | ||
class GPUEnergyConsumption(DecreasingGPURecord): | ||
""" | ||
GPU's energy consumption metric | ||
""" | ||
|
||
tag = "energy_consumption" | ||
|
||
def __init__(self, value, device_uuid=None, timestamp=0): | ||
super().__init__(value, device_uuid, timestamp) | ||
|
||
@staticmethod | ||
def aggregation_function(): | ||
def average(seq): | ||
return sum(seq[1:], start=seq[0]) / len(seq) | ||
|
||
return average | ||
|
||
@staticmethod | ||
def header(aggregation_tag=False): | ||
return ("Average " if aggregation_tag else "") + "GPU Energy Consumption (MJ)" | ||
|
||
def __eq__(self, other: "GPUEnegryConsumption") -> bool: # type: ignore | ||
return self.value() == other.value() | ||
|
||
def __lt__(self, other: "GPUEnergyConsumption") -> bool: | ||
return other.value() < self.value() | ||
|
||
def __add__(self, other: "GPUEnergyConsumption") -> "GPUEnergyConsumption": | ||
return GPUEnergyConsumption( | ||
device_uuid=None, value=(self.value() + other.value()) | ||
) | ||
|
||
def __sub__(self, other: "GPUEnergyConsumption") -> "GPUEnergyConsumption": | ||
return GPUEnergyConsumption( | ||
device_uuid=None, value=(other.value() - self.value()) | ||
) |
Oops, something went wrong.