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

Fix config in maxengine #1339

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix config in maxengine #1339

wants to merge 1 commit into from

Conversation

tohaowu
Copy link
Collaborator

@tohaowu tohaowu commented Mar 4, 2025

Description

Fix the bug from pr/1285.

FIXES: b/396747968

Tests

Tested this code with MLPerf inference Llama2-70b

Checklist

Before submitting this PR, please make sure (put X in square brackets):

  • I have performed a self-review of my code.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have run end-to-end tests tests and provided workload links above if applicable.
  • I have made or will make corresponding changes to the doc if needed.

Copy link
Collaborator

@bvandermoon bvandermoon left a comment

Choose a reason for hiding this comment

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

Please check the pylint/code style test failure

Copy link
Collaborator

@bvandermoon bvandermoon left a comment

Choose a reason for hiding this comment

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

LGTM once the build test passes. Minor note - the link in the PR description points to this PR instead of PR 1285. Mind updating that?

@@ -1166,7 +1166,6 @@ def create_engine_from_config_flags(batch_size, max_prefill_predict_length, max_
option = f"{k}={v}"
updated_args.append(option)
print(f"Invoking maxengine with args:\n \t{updated_args}")
pyconfig.initialize(updated_args)
cfg = MaxEngineConfig(cp.deepcopy(pyconfig._config.keys)) # pylint: disable=protected-access
Copy link
Collaborator

@bvandermoon bvandermoon Mar 5, 2025

Choose a reason for hiding this comment

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

What error were you seeing without this change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here is the error

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/opt/maxtext/MaxText/inference_mlperf/offline_mode.py", line 535, in <module>
    app.run(main)
  File "/usr/local/lib/python3.12/dist-packages/absl/app.py", line 308, in run
    _run_main(main, args)
  File "/usr/local/lib/python3.12/dist-packages/absl/app.py", line 254, in _run_main
    sys.exit(main(argv))
             ^^^^^^^^^^
  File "/opt/maxtext/MaxText/inference_mlperf/offline_mode.py", line 467, in main
    engine = create_engine_from_config_flags(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/maxtext/MaxText/maxengine.py", line 1268, in create_engine_from_config_flags
    cfg = MaxEngineConfig(cp.deepcopy(pyconfig._config.keys))  # pylint: disable=protected-access
                                      ^^^^^^^^^^^^^^^^
AttributeError: module 'pyconfig' has no attribute '_config'

@vipannalla
Copy link
Collaborator

Did you test this on TPU (Trillium) or GPU? Also can you please paste the error you see. cc @singh-mitali, PTAL

Copy link
Collaborator

@vipannalla vipannalla left a comment

Choose a reason for hiding this comment

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

Looks good

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.

4 participants