Skip to content

[Bug] "Unsloth: Failed to create dynamic compiled modules!" error triggered and fixed by updating "create_new_function" in unsloth_zoo/compiler.py #1928

Closed

Description

@yhsong-nxt

I found install unsloth and run below code ends with this error "if trials == 1000: raise RuntimeError("Unsloth: Failed to create dynamic compiled modules!")"

from unsloth import FastLanguageModel, PatchFastRL

So I fixed create_new_function in unsloth_zoo/compiler.py and bug fixed.

Image

Activity

  1. satpalsr commented on Mar 6, 2025

    @satpalsr

    +1, just experienced same bug.

  2. LucaBoscia commented on Mar 6, 2025

    @LucaBoscia

    Hi also experiencing this!

  3. Namron2000 commented on Mar 6, 2025

    @Namron2000

    Hey, is there another workaround? Maybe in the installation process? I don't want to change the file whenever I create a container. Sadly, Unsloth Zoo doesn't have tags, so you can not reinstall the older Version.

  4. satpalsr commented on Mar 6, 2025

    @satpalsr

    Hey, is there another workaround? Maybe in the installation process? I don't want to change the file whenever I create a container. Sadly, Unsloth Zoo doesn't have tags, so you can not reinstall the older Version.

    pip install unsloth==2025.3.6 unsloth_zoo==2025.3.4

    from #1925

  5. LucaBoscia commented on Mar 6, 2025

    @LucaBoscia

    You're a legend, it worked thanks!!

  6. added a commit that references this issue on Mar 6, 2025
  7. danielhanchen commented on Mar 6, 2025

    @danielhanchen
    Member

    @satpalsr @Namron2000 @LucaBoscia @yhsong-nxt Extreme apologies - I rechecked everything and pushed some fixes - so sorry on the issue!

    For local machines, please do:

    pip install --upgrade --force-reinstall --no-deps unsloth unsloth_zoo
    

    For Colab / Kaggle machines, please disconnect and restart the runtime!

    You can also force the versions:

    pip install --no-deps "unsloth>=2025.3.8" "unsloth_zoo>=2025.3.7" --upgrade --force-reinstall
    

    You should see Unsloth's version at least is 2025.3.8:
    Image

  8. added a commit that references this issue on May 14, 2026
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