Skip to content
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

refactor benchmark backend code #540

Merged
merged 2 commits into from
Dec 5, 2022
Merged

Conversation

qjiang002
Copy link
Collaborator

This PR aims to fix issue #533

Previously, benchmark_db_utils needs to load SystemInfo which depends on SDK versioning. However, since current benchmark only needs System properties such as overall results for the benchmark plots or tables, we can refactor the code to avoid computing and storing additional SystemInfo in cache which will expire due to SDK upgrading.

Copy link
Contributor

@neubig neubig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

Could you please check if this page works after this fix has been applied? https://dev.explainaboard.inspiredco.ai/benchmark?id=globalbench_ner

@qjiang002
Copy link
Collaborator Author

qjiang002 commented Dec 2, 2022

Hi @neubig , I got this error when loading this benchmark:

[0]   File "/Users/jiangqi/Desktop/Capstone/explainaboard_web/backend/src/gen/explainaboard_web/impl/db_utils/benchmark_db_utils.py", line 187, in <setcomp>
[0]     (x.dataset.dataset_name, x.dataset.sub_dataset, x.dataset.split)
[0] AttributeError: 'NoneType' object has no attribute 'dataset_name'

This is because this benchmark try to find all ner systems with 'system_query': {'task_name': 'named-entity-recognition'}, but there are systems with undefined/custom dataset, so their dataset is None.

One way to deal with undefined datasets is to ignore undefined datasets in benchmark. I think we cannot merge systems with undefined datasets because they may be for different tasks and have different metrics. WDYT?

Copy link
Member

@lyuyangh lyuyangh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I am not familiar with this code but the changes look good! I just noticed one small thing regarding the type annotation.

):
sys_info = unwrap(sys_info_tmp)
sys = unwrap(system_tmp)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the type annotation, it seems that this unwrap is not necessary.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@qjiang002
Copy link
Collaborator Author

Hi @neubig , I got this error when loading this benchmark:

[0]   File "/Users/jiangqi/Desktop/Capstone/explainaboard_web/backend/src/gen/explainaboard_web/impl/db_utils/benchmark_db_utils.py", line 187, in <setcomp>
[0]     (x.dataset.dataset_name, x.dataset.sub_dataset, x.dataset.split)
[0] AttributeError: 'NoneType' object has no attribute 'dataset_name'

This is because this benchmark try to find all ner systems with 'system_query': {'task_name': 'named-entity-recognition'}, but there are systems with undefined/custom dataset, so their dataset is None.

One way to deal with undefined datasets is to ignore undefined datasets in benchmark. I think we cannot merge systems with undefined datasets because they may be for different tasks and have different metrics. WDYT?

This is another issue not related to this refactor PR. I'll merge this PR and record this problem in another issue.

@qjiang002 qjiang002 merged commit 73a4a89 into main Dec 5, 2022
@qjiang002 qjiang002 deleted the refactor-benchmark-backend branch December 5, 2022 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants