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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions MaxText/maxengine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'

cfg = pyconfig.initialize(updated_args)
engine = MaxEngine(cfg)
return engine
Loading