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

Error Loading Model, TypeError: fixup_fp8_extra_states #84

Open
akk-135 opened this issue Mar 18, 2025 · 0 comments
Open

Error Loading Model, TypeError: fixup_fp8_extra_states #84

akk-135 opened this issue Mar 18, 2025 · 0 comments

Comments

@akk-135
Copy link

akk-135 commented Mar 18, 2025

Hi!

I had the following issue when running test_evo2.py :

python test/test_evo2.py --model_name evo2_1b_base
Fetching 4 files: 100% 4/4 [00:00<00:00, 6681.49it/s]
Found complete file in repo: evo2_1b_base.pt
100% 25/25
Extra keys in state_dict: {'blocks.10.mixer.dense._extra_state', 'blocks.24.mixer.dense._extra_state', 'blocks.3.mixer.dense._extra_state', 'blocks.17.mixer.dense._extra_state', 'unembed.weight'}
custom_miniforge/envs/evo2/lib/python3.11/site-packages/transformer_engine/pytorch/module/base.py:661: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
  state = torch.load(state, map_location="cuda")
Traceback (most recent call last):
  File "EVO2_DIR/evo2/test/test_evo2.py", line 118, in <module>
    main()
  File "EVO2_DIR/evo2/test/test_evo2.py", line 84, in main
    model = Evo2(args.model_name)
            ^^^^^^^^^^^^^^^^^^^^^
  File "custom_miniforge/envs/evo2/lib/python3.11/site-packages/evo2/models.py", line 48, in __init__
    self.model = self.load_evo2_model(model_name, config_path)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "custom_miniforge/envs/evo2/lib/python3.11/site-packages/evo2/models.py", line 256, in load_evo2_model
    load_checkpoint(model, weights_path)
  File "EVO2_DIR/evo2/vortex/vortex/model/utils.py", line 120, in load_checkpoint
    model.custom_load_state_dict(state)
  File "EVO2_DIR/evo2/vortex/vortex/model/model.py", line 878, in custom_load_state_dict
    fixup_fp8_extra_states(self)
  File "EVO2_DIR/evo2/vortex/vortex/model/utils.py", line 144, in fixup_fp8_extra_states
    fixup_fp8_extra_states(child)
  File "EVO2_DIR/evo2/vortex/vortex/model/utils.py", line 144, in fixup_fp8_extra_states
    fixup_fp8_extra_states(child)
  File "EVO2_DIR/evo2/vortex/vortex/model/utils.py", line 144, in fixup_fp8_extra_states
    fixup_fp8_extra_states(child)
  File "EVO2_DIR/evo2/vortex/vortex/model/utils.py", line 160, in fixup_fp8_extra_states
    module.set_extra_state(module.get_extra_state())
  File "custom_miniforge/envs/evo2/lib/python3.11/site-packages/transformer_engine/pytorch/module/base.py", line 657, in set_extra_state
    state = pickle.loads(state.detach().cpu().numpy().tobytes())
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "custom_miniforge/envs/evo2/lib/python3.11/site-packages/torch/storage.py", line 520, in _load_from_bytes
    return torch.load(io.BytesIO(b), weights_only=False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: fixup_fp8_extra_states.<locals>.overriden_load() got an unexpected keyword argument 'weights_only'

I'm using a L40S GPU with the following configuration:

CUDA Version : 12.4
Driver Version : 550.54.15
cuDNN Version : linux-x86_64-9.7.0.66_cuda12
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

No branches or pull requests

1 participant