Skip to content

TypeError: unhashable type: 'set' when loading LoRA adapter on Llama-3.1-8B #10859

Description

@toliksht

Reminder

  • I have read the above rules and searched the existing issues.

System Info

Hi,
Environment:

  • Windows 11
  • RTX 5080
  • CUDA 12.8
  • torch 2.12.0.dev20260408+cu128
  • peft 0.18.1
  • accelerate 1.11.0

Training works successfully.

LoRA adapter is created successfully:

  • adapter_model.safetensors
  • adapter_config.json

Training finishes successfully.

When loading the adapter in Chat, the following error occurs:

Traceback:
File "...peft_model.py", line 1415, in load_adapter
max_memory = get_balanced_memory(

File "...accelerate\utils\modeling.py", line 1019
if set(no_split_children.keys()) == set(no_split_module_classes):

TypeError: unhashable type: 'set'

The same error occurs in:

  • LLaMA-Factory 0.9.6.dev0
  • LLaMA-Factory 0.9.5

Base model:
Llama-3.1-8B

Regards

Reproduction

Steps to reproduce

  1. Train a LoRA adapter on Llama-3.1-8B.

  2. Training completes successfully and the following files are created:

    adapter_model.safetensors
    adapter_config.json

  3. Open Chat in LLaMA-Factory.

  4. Load the base model:
    C:\Models\Llama-3.1-8B

  5. Select the trained LoRA adapter:
    C:\LLM\LLaMA-Factory\saves\Llama-3.1-8B\lora\train_2026-09-30-08-58-34

  6. Click "Load Model".

  7. The adapter loading fails with:

    TypeError: unhashable type: 'set'

Traceback:

File "...peft_model.py", line 1415, in load_adapter
max_memory = get_balanced_memory(

File "...accelerate\utils\modeling.py", line 1019, in get_balanced_memory
if set(no_split_children.keys()) == set(no_split_module_classes):
TypeError: unhashable type: 'set'

Others

Additional information

This issue is reproduced on a very recent NVIDIA RTX 5080 GPU
(Blackwell architecture, compute capability 12.0).

The following setup works correctly:

  • CUDA 12.8
  • torch 2.12.0.dev20260408+cu128
  • LoRA training completes successfully
  • adapter_model.safetensors is created successfully

The failure only occurs when loading the LoRA adapter in Chat.

What was tested

  • Training works successfully.
  • LoRA adapter is created successfully.
  • adapter_model.safetensors exists.
  • adapter_config.json exists.
  • The issue happens only when loading the adapter.
  • Reproduced with:
    • LLaMA-Factory 0.9.6.dev0
    • LLaMA-Factory 0.9.5

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpendingThis problem is yet to be addressed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions