Skip to content

[Bug] Llama-3.1-8B Not Supported in Unsloth 2024.09.post2 #2503

Closed

Description

@stzoozz

When attempting to load meta-llama/Llama-3.1-8B with Unsloth version 2024.09.post2, I receive a NotImplementedError stating that the model is not supported and suggesting an upgrade to the latest Unsloth version. However, upgrading Unsloth is not feasible in my environment due to strict transformers version constraints..

Image

Is there a known workaround for this issue, or an official compatibility matrix for Unsloth and transformers versions? Since my training runs inside a managed SageMaker Docker container, I am unable to patch the package source code directly (as suggested in #1726).

Any advice for resolving this without upgrading Unsloth or transformers would be greatly appreciated. Thank you!

Activity

  1. shimmyshimmer commented on May 9, 2025

    @shimmyshimmer
    Member

    Is it possible to just comment it out and see if it works?

  2. rolandtannous commented on May 9, 2025

    @rolandtannous
    Contributor

    @stzoozz

    Unsloth requires a transformers version that your current environment doesn't allow. If the older transformers version that your container forces doesn't support the model you wish to train, then unsloth, which uses transformers can't equally support that same model. This then looks like an environment problem to me since it's easily solveable in an environment where you can update the packages to latest.

    Here for example. Works completely fine

    Image

    Your solution is to solve your environment problem:
    1- Either use an environment other than SageMaker
    2- Use a custom SageMaker docker container where you can specify your own packages at build time. This is how to do it https://docs.aws.amazon.com/sagemaker/latest/dg/docker-containers-adapt-your-own.html

  3. stzoozz commented on May 9, 2025

    @stzoozz
    Author

    @rolandtannous @shimmyshimmer Thanks for the suggestions! I’ll try them out and see how it goes.
    BTW, I ran into this issue while following the llm-twin-course.

    Will share any updates if I find a workaround!

  4. github-actions commented on Jul 1, 2025

    @github-actions
    Contributor

    Is this issue still important to you? Apologies in advance we might have missed this issue as well. For faster response times, please post on our Reddit server - https://www.reddit.com/r/unsloth or our Discord - https://discord.com/invite/unsloth

  5. mariotalavera commented on Jul 4, 2025

    @mariotalavera

    @rolandtannous @shimmyshimmer Thanks for the suggestions! I’ll try them out and see how it goes. BTW, I ran into this issue while following the llm-twin-course.

    Will share any updates if I find a workaround!

    Hallo, I hope you've found resolution for this?!? I am also doing the book and it led me here. Cheers,

  6. stzoozz commented on Jul 5, 2025

    @stzoozz
    Author

    @rolandtannous @shimmyshimmer Thanks for the suggestions! I’ll try them out and see how it goes. BTW, I ran into this issue while following the llm-twin-course.
    Will share any updates if I find a workaround!

    Hallo, I hope you've found resolution for this?!? I am also doing the book and it led me here. Cheers,

    Sorry, I haven't fully resolved it yet 🥹. The main issue seems to be that the Docker environment provided in the book is now outdated and not fully compatible with unsloth and the model. I think the proper way to fix it is to build a custom SageMaker Docker container to ensure everything matches up.

  7. mariotalavera commented on Jul 5, 2025

    @mariotalavera

    @rolandtannous @shimmyshimmer Thanks for the suggestions! I’ll try them out and see how it goes. BTW, I ran into this issue while following the llm-twin-course.
    Will share any updates if I find a workaround!

    Hallo, I hope you've found resolution for this?!? I am also doing the book and it led me here. Cheers,

    Sorry, I haven't fully resolved it yet 🥹. The main issue seems to be that the Docker environment provided in the book is now outdated and not fully compatible with unsloth and the model. I think the proper way to fix it is to build a custom SageMaker Docker container to ensure everything matches up.

    Thanks! I opened a bug on book's repo for visibility. PacktPublishing/LLM-Engineers-Handbook#57.

  8. danielhanchen commented on Sep 6, 2026

    @danielhanchen
    Member

    That message is an upgrade prompt from 2024.09.post2, Llama-3.1-8B resolves fine on current versions. The container's pinned transformers is what's holding you back.

    Please update Unsloth: uv pip install --upgrade unsloth unsloth_zoo --force-reinstall --no-cache-dir (if it's not in the current release yet it'll be in the next one). Reopen if it still happens!

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

    help wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions