Skip to content

Question about benchmark #13

Closed
Closed

Description

@lugimzzz

Hi,i'm highly interested in this position.
I am curious to know if the Hugging Face baseline incorporates Flash Attention2. Could you please offer a reproducible Hugging Face baseline example?

Activity

  1. danielhanchen commented on Dec 4, 2023

    @danielhanchen
    Member

    @lugimzzz The baseline as we mentioned is the reference Huggingface implementation from the QLoRA repo - https://colab.research.google.com/drive/1VoYNfYDKcKRQRor98Zbf2-9VQTtGJ24k?usp=sharing, so no, not using FA2. Our benchmark is from the reference implementation as specified from the repo.

    I'll edit the readme to include 2 Kaggle benchmarking notebooks for Unsloth Open vs HF original - it's currently on the dev branch: https://github.com/unslothai/unsloth/tree/dev.2023.12.

    1. https://www.kaggle.com/code/danielhanchen/huggingface-original-laion-oig Reference implementation 60 steps on DDP Kaggle 2 Tesla T4 GPUs takes 40 minutes and 46 seconds
    2. https://www.kaggle.com/code/danielhanchen/unsloth-laion-chip2-kaggle Unsloth implementation 60 steps on DDP Kaggle 2 Tesla T4 GPUs - Unsloth only uses 1 GPU whilst Pro plans use more. Ours take 4 minutes and 34 seconds (8.64x faster). The Pro / Max is 30x faster.

    If you use 1 GPU, the speedup is as we described in the 1 GPU table on the readme - around 1.8x ish.

    The error losses are nearly identical for the first 60 steps, albeit some differences due to FA2, and Triton kernel's internal upcasting to f32:
    image

    A bit blurry since I copied it from Google Sheets - you can compare the losses yourself in the 2 notebooks.

    All benchmarking uses max_seq_len = 2048, bsz = 2, ga = 4, max_grad_norm = 0.3, num_train_epochs = 1, seed = 3047, lr = 2e-4, wd = 0.01, optim = "adamw_8bit", schedule = "linear", schedule_steps = 10 except the Slim Orca benchmark on DDP, where it OOMed. We had to reduce the bsz=1 for ALL comparisons on Slim Orca, so the Slim Orca column for all methods is bsz=1. We could have tested Unsloth for Slim Orca on bsz=2, since we reduce memory usage by 50%, but for consistency, it is still bsz=1.

    You are more than free to fork the Kaggle notebooks, and change the datasets or play around with them. Hope they're useful!

    Thanks for your interest in Unsloth!

  2. danielhanchen commented on Dec 14, 2023

    @danielhanchen
    Member

    @lugimzzz Just wrote up a full blog post on benchmarking + shared 59 notebooks on all our benchmarks if you're interested: https://unsloth.ai/blog/mistral-benchmark

  3. added a commit that references this issue on Jun 8, 2025
  4. added a commit that references this issue on Jun 25, 2025
  5. added a commit that references this issue on Jul 7, 2025
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions