-
Notifications
You must be signed in to change notification settings - Fork 606
[CI] add API evaluation test #3987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
autotest/utils/config_utils.py
Outdated
if len(model_list) > 0: | ||
|
||
if tp_num > 1: | ||
communicators = ['native', 'nccl'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change native
to cuda-ipc
, since we are going to deprecate native
, which is alias to cuda-ipc
@@ -0,0 +1,90 @@ | |||
import pytest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is a copy of test_api_evaluate_pytorch
.
Could you provide a unified test_api_evaluation.py
?
.github/workflows/api_eva.yml
Outdated
@@ -0,0 +1,137 @@ | |||
name: api_eva |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may use api_eva
and rename the filename api_eval.yml
autotest/utils/evaluate_utils.py
Outdated
if work_dir and os.path.exists(work_dir): | ||
try: | ||
summary_dirs = glob.glob(os.path.join(work_dir, '*', 'summary')) | ||
if summary_dirs: | ||
summary_dir = summary_dirs[0] | ||
csv_files = glob.glob(os.path.join(summary_dir, 'summary_*.csv')) | ||
if csv_files: | ||
csv_file = sorted(csv_files)[-1] | ||
if os.path.exists(csv_file): | ||
with open(csv_file, 'r') as f: | ||
reader = csv.reader(f) | ||
next(reader) | ||
for row in reader: | ||
if len(row) >= 5 and row[4]: | ||
dataset = row[0] | ||
metric_value = row[4] | ||
try: | ||
metrics[dataset] = f'{float(metric_value):.2f}' | ||
except ValueError: | ||
metrics[dataset] = metric_value | ||
except Exception as e: | ||
print(f'Error reading metrics: {str(e)}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we simplify this code snippet? The indent is too deep
autotest/utils/evaluate_utils.py
Outdated
write_header = False | ||
if not os.path.exists(summary_file) or os.path.getsize(summary_file) == 0: | ||
write_header = True | ||
else: | ||
with open(summary_file, 'r') as f: | ||
first_lines = f.read(200) | ||
if '| Model | Backend | TP | Status | mmlu | gsm8k |' not in first_lines: | ||
write_header = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change it to the following?
write_header = not os.path.exists(summary_file) or os.path.getsize(summary_file) == 0
May kindly let us know in what cases the first line are not the "| Model | Backend | TP | Status | mmlu | gsm8k |"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LTGM
Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily receiving feedbacks. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.
Motivation
Please describe the motivation of this PR and the goal you want to achieve through this PR.
Modification
Please briefly describe what modification is made in this PR.
BC-breaking (Optional)
Does the modification introduce changes that break the backward-compatibility of the downstream repositories?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.
Use cases (Optional)
If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.
Checklist