Skip to content

qwen2.5 support? #1043

Closed
Closed

Description

@milsun
No description provided.

Activity

  1. danielhanchen commented on Sep 21, 2024

    @danielhanchen
    Member

    I'm uploading Qwen 2.5 models to Unsloth - there was also some tokenizer changes, so I'll have to reupload all the tokenizers

  2. Excidos commented on Sep 22, 2024

    @Excidos

    Can't wait for this, currently using Swift with success but Unsloth support will be amazing :)

  3. danielhanchen commented on Oct 1, 2024

    @danielhanchen
    Member

    Oh apologies @Excidos @milsun Forgot to tell you both it works now!!
    I also made some Qwen 2.5 notebooks as well

  4. added
    fixed - pending confirmation
    and removed
    currently fixing
    on Oct 1, 2024
  5. Excidos commented on Oct 1, 2024

    @Excidos

    Yes thank you I've already used it extensively and adapted it. Got Linux going with my 4090. Blown away by the speed of it. Thank you so much

  6. milsun commented on Oct 1, 2024

    @milsun
    Author

    great, thanks!

  7. DifferentialityDevelopment commented on Nov 3, 2024

    @DifferentialityDevelopment

    Sorry if this seems silly but when unsloth patches qwen2.5 model, it outputs
    "Unsloth 2024.10.7 patched 28 layers with 0 QKV layers, 28 O layers and 28 MLP layers."
    Why does the QKV layers not get patched?
    In the case of llama-3.2
    "Unsloth 2024.10.7 patched 16 layers with 16 QKV layers, 16 O layers and 16 MLP layers."
    The QKV layers do get patched.

    model, tokenizer = FastLanguageModel.from_pretrained(
        model_name = "unsloth/Qwen2.5-1.5B-Instruct-bnb-4bit",
        max_seq_length = max_seq_length,
        dtype = dtype,
        load_in_4bit = load_in_4bit,
    )
    model = FastLanguageModel.get_peft_model(
        model,
        r = 128, # Choose any number > 0 ! Suggested 8, 16, 32, 64, 128
        target_modules = ["q_proj", "k_proj", "v_proj", "o_proj",
                          "gate_proj", "up_proj", "down_proj",],
        lora_alpha = 32,
        lora_dropout = 0, # Supports any, but = 0 is optimized
        bias = "none",    # Supports any, but = "none" is optimized
        # [NEW] "unsloth" uses 30% less VRAM, fits 2x larger batch sizes!
        use_gradient_checkpointing = "unsloth", # True or "unsloth" for very long context
        random_state = 3407,
        use_rslora = True,  # We support rank stabilized LoRA
        loftq_config = None, # And LoftQ
    )
    
    model, tokenizer = FastLanguageModel.from_pretrained(
        model_name = "unsloth/Llama-3.2-1B-Instruct-bnb-4bit",
        max_seq_length = max_seq_length,
        dtype = dtype,
        load_in_4bit = load_in_4bit,
    )
    model = FastLanguageModel.get_peft_model(
        model,
        r = 128, # Choose any number > 0 ! Suggested 8, 16, 32, 64, 128
        target_modules = ["q_proj", "k_proj", "v_proj", "o_proj",
                          "gate_proj", "up_proj", "down_proj",],
        lora_alpha = 32,
        lora_dropout = 0, # Supports any, but = 0 is optimized
        bias = "none",    # Supports any, but = "none" is optimized
        # [NEW] "unsloth" uses 30% less VRAM, fits 2x larger batch sizes!
        use_gradient_checkpointing = "unsloth", # True or "unsloth" for very long context
        random_state = 3407,
        use_rslora = True,  # We support rank stabilized LoRA
        loftq_config = None, # And LoftQ
    )
    
  8. MinghaoYan commented on Nov 8, 2024

    @MinghaoYan

    I am running into the same issue of QKV not getting patched. Any updates on this? Is this due to the bias term in Qwen QKV matrices?

  9. danielhanchen commented on Nov 11, 2024

    @danielhanchen
    Member

    @DifferentialityDevelopment @MinghaoYan Just a warning - no need to worry - I'll silence them in the near future once all model comes out

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

    fixed - pending confirmation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions