-
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.
Adding records for ISL/OSL and testing this in checkpoint creation
- Loading branch information
Showing
8 changed files
with
385 additions
and
22 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
103 changes: 103 additions & 0 deletions
103
genai-perf/genai_perf/record/types/input_sequence_length.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,103 @@ | ||
# Copyright 2024, 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.record import IncreasingRecord | ||
|
||
|
||
@total_ordering | ||
class InputSequenceLength(IncreasingRecord): | ||
""" | ||
A record for perf_analyzer | ||
metric 'Input Sequence Length' | ||
""" | ||
|
||
tag = "input_sequence_length" | ||
|
||
def __init__(self, value, timestamp=0): | ||
""" | ||
Parameters | ||
---------- | ||
value : float | ||
The throughput from the perf analyzer output | ||
timestamp : float | ||
Elapsed time from start of program | ||
""" | ||
|
||
super().__init__(value, timestamp) | ||
|
||
@staticmethod | ||
def value_function(): | ||
""" | ||
Returns the total value from a list | ||
Returns | ||
------- | ||
Total value of the list | ||
""" | ||
return sum | ||
|
||
@staticmethod | ||
def header(aggregation_tag=False): | ||
""" | ||
Parameters | ||
---------- | ||
aggregation_tag: bool | ||
An optional tag that may be displayed | ||
as part of the header indicating that | ||
this record has been aggregated using | ||
max, min or average etc. | ||
Returns | ||
------- | ||
str | ||
The full name of the | ||
metric. | ||
""" | ||
|
||
return "Input Sequence Length" | ||
|
||
def __eq__(self, other): | ||
""" | ||
Allows checking for | ||
equality between two records | ||
""" | ||
|
||
return self.value() == other.value() | ||
|
||
def __lt__(self, other): | ||
""" | ||
Allows checking if | ||
this record is less than | ||
the other | ||
""" | ||
|
||
return self.value() < other.value() | ||
|
||
def __add__(self, other): | ||
""" | ||
Allows adding two records together | ||
to produce a brand new record. | ||
""" | ||
|
||
return self.__class__(value=(self.value() + other.value())) | ||
|
||
def __sub__(self, other): | ||
""" | ||
Allows subtracting two records together | ||
to produce a brand new record. | ||
""" | ||
|
||
return self.__class__(value=(self.value() - other.value())) |
103 changes: 103 additions & 0 deletions
103
genai-perf/genai_perf/record/types/output_sequence_length.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,103 @@ | ||
# Copyright 2024, 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.record import IncreasingRecord | ||
|
||
|
||
@total_ordering | ||
class OutputSequenceLength(IncreasingRecord): | ||
""" | ||
A record for perf_analyzer | ||
metric 'Output Sequence Length' | ||
""" | ||
|
||
tag = "output_sequence_length" | ||
|
||
def __init__(self, value, timestamp=0): | ||
""" | ||
Parameters | ||
---------- | ||
value : float | ||
The throughput from the perf analyzer output | ||
timestamp : float | ||
Elapsed time from start of program | ||
""" | ||
|
||
super().__init__(value, timestamp) | ||
|
||
@staticmethod | ||
def value_function(): | ||
""" | ||
Returns the total value from a list | ||
Returns | ||
------- | ||
Total value of the list | ||
""" | ||
return sum | ||
|
||
@staticmethod | ||
def header(aggregation_tag=False): | ||
""" | ||
Parameters | ||
---------- | ||
aggregation_tag: bool | ||
An optional tag that may be displayed | ||
as part of the header indicating that | ||
this record has been aggregated using | ||
max, min or average etc. | ||
Returns | ||
------- | ||
str | ||
The full name of the | ||
metric. | ||
""" | ||
|
||
return "Output Sequence Length" | ||
|
||
def __eq__(self, other): | ||
""" | ||
Allows checking for | ||
equality between two records | ||
""" | ||
|
||
return self.value() == other.value() | ||
|
||
def __lt__(self, other): | ||
""" | ||
Allows checking if | ||
this record is less than | ||
the other | ||
""" | ||
|
||
return self.value() < other.value() | ||
|
||
def __add__(self, other): | ||
""" | ||
Allows adding two records together | ||
to produce a brand new record. | ||
""" | ||
|
||
return self.__class__(value=(self.value() + other.value())) | ||
|
||
def __sub__(self, other): | ||
""" | ||
Allows subtracting two records together | ||
to produce a brand new record. | ||
""" | ||
|
||
return self.__class__(value=(self.value() - other.value())) |
103 changes: 103 additions & 0 deletions
103
genai-perf/genai_perf/record/types/output_token_throughput_per_request.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,103 @@ | ||
# Copyright 2024, 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.record import IncreasingRecord | ||
|
||
|
||
@total_ordering | ||
class OutputTokenThroughputPerRequest(IncreasingRecord): | ||
""" | ||
A record for perf_analyzer | ||
metric 'Output Token Throughput Per Request' | ||
""" | ||
|
||
tag = "output_token_throughput_per_request" | ||
|
||
def __init__(self, value, timestamp=0): | ||
""" | ||
Parameters | ||
---------- | ||
value : float | ||
The throughput from the perf analyzer output | ||
timestamp : float | ||
Elapsed time from start of program | ||
""" | ||
|
||
super().__init__(value, timestamp) | ||
|
||
@staticmethod | ||
def value_function(): | ||
""" | ||
Returns the total value from a list | ||
Returns | ||
------- | ||
Total value of the list | ||
""" | ||
return sum | ||
|
||
@staticmethod | ||
def header(aggregation_tag=False): | ||
""" | ||
Parameters | ||
---------- | ||
aggregation_tag: bool | ||
An optional tag that may be displayed | ||
as part of the header indicating that | ||
this record has been aggregated using | ||
max, min or average etc. | ||
Returns | ||
------- | ||
str | ||
The full name of the | ||
metric. | ||
""" | ||
|
||
return "Output Token Throughput Per Request (infer/sec)" | ||
|
||
def __eq__(self, other): | ||
""" | ||
Allows checking for | ||
equality between two records | ||
""" | ||
|
||
return self.value() == other.value() | ||
|
||
def __lt__(self, other): | ||
""" | ||
Allows checking if | ||
this record is less than | ||
the other | ||
""" | ||
|
||
return self.value() < other.value() | ||
|
||
def __add__(self, other): | ||
""" | ||
Allows adding two records together | ||
to produce a brand new record. | ||
""" | ||
|
||
return self.__class__(value=(self.value() + other.value())) | ||
|
||
def __sub__(self, other): | ||
""" | ||
Allows subtracting two records together | ||
to produce a brand new record. | ||
""" | ||
|
||
return self.__class__(value=(self.value() - other.value())) |
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
Oops, something went wrong.