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

quick fix for transformer_flops.py error #27

Merged
merged 9 commits into from
Feb 16, 2024
Merged

Conversation

jahatef
Copy link
Contributor

@jahatef jahatef commented Feb 16, 2024

Fixes this error when running transformer_flops.py. the train_batch_size wasn't being set, causing a weird error.

[2024-02-16 02:42:42,879] [INFO] [real_accelerator.py:161:get_accelerator] Setting ds_accelerator to cuda (auto detect)
Traceback (most recent call last):
  File "/weka/home-jacob/cookbook/sizing/benchmarks/transformer_flops.py", line 276, in <module>
    megatron_wrapper.initialize_megatron(configurations[0])
  File "/weka/home-jacob/cookbook/sizing/benchmarks/megatron_wrapper.py", line 92, in initialize_megatron
    args = get_megatron_args(configuration, override_tensor_mp_size=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/weka/home-jacob/cookbook/sizing/benchmarks/megatron_wrapper.py", line 114, in get_megatron_args
    neox_args = megatron.NeoXArgs.from_dict(asdict(args))
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/weka/home-jacob/cookbook/sizing/benchmarks/megatron/neox_arguments/arguments.py", line 234, in from_dict
    return cls(**args_dict)
           ^^^^^^^^^^^^^^^^
  File "<string>", line 228, in __init__
  File "/weka/home-jacob/cookbook/sizing/benchmarks/megatron/neox_arguments/arguments.py", line 134, in __post_init__
    if not self.validate_types():
           ^^^^^^^^^^^^^^^^^^^^^
  File "/weka/home-jacob/cookbook/sizing/benchmarks/megatron/neox_arguments/arguments.py", line 1238, in validate_types
    elif field_def.type.__origin__ == Literal:
         ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'int' has no attribute '__origin__'

@jahatef jahatef marked this pull request as ready for review February 16, 2024 23:06
@Quentin-Anthony Quentin-Anthony merged commit f52e7f3 into main Feb 16, 2024
1 check passed
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