-
Notifications
You must be signed in to change notification settings - Fork 742
[Fix] Fix eval stage is extremely slow #2409
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -216,6 +216,7 @@ def _launch(self, task, gpu_ids, index): | |
| param_file = f'{pwd}/tmp/{uuid_str}_params.py' | ||
|
|
||
| try: | ||
| object.__setattr__(task.cfg, "_format_python_code", False) | ||
| task.cfg.dump(param_file) | ||
|
Comment on lines
+219
to
220
|
||
| tmpl = get_command_template(gpu_ids) | ||
| get_cmd = partial(task.get_command, | ||
|
|
||
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.
Using
object.__setattr__()to set_format_python_codeon the mmengineConfigobject is a fragile approach that bypasses the class's__setattr__mechanism and relies on the internal implementation of mmengine'sConfig. If mmengine changes its internal attribute names or layout, this will silently fail to have any effect (without raising an error), causing the performance issue to reappear undetected.The rest of the codebase (e.g.,
opencompass/cli/main.py:301andopencompass/utils/run.py:98) passesformat_python_code=Falsedirectly toConfig.fromfile(). Since the task config is already aConfigobject at this point, a more robust alternative is to reload it with the correct flag, or to check if mmengine'sConfigexposes a public setter forformat_python_codeand use that instead.