Skip to content

[FIXED] compiled_autograd.enable() Gemma #1250

Closed

Description

@InderjeetVishnoi

I am simply running the gemma-2-2b example notebook of unsloth [https://colab.research.google.com/drive/1weTpKOjBZxZJ5PQ-Ql8i6ptAY2x-FWVA?usp=sharing] and getting the cited error.

Stacktrace of the error looks like below :

RuntimeError Traceback (most recent call last)
in <cell line: 1>()
----> 1 trainer_stats = trainer.train()

39 frames
/usr/local/lib/python3.10/dist-packages/torch/_dynamo/compiled_autograd.py in enable(compiler_fn)
497 @contextlib.contextmanager
498 def enable(compiler_fn):
--> 499 prior = torch._C._dynamo.compiled_autograd.set_autograd_compiler(
500 functools.partial(AutogradCompilerInstance, compiler_fn)
501 )

RuntimeError: compiled_autograd.enable() requires no threads in backwards()

I have started facing this error lately only, can you suggest what might be wrong.

pytorch version:2.5.0+cu121

Activity

  1. changed the title [-]Getting "compiled_autograd.enable() requires no threads in backwards()" on running SFTTrainer[/-] [+]Getting "compiled_autograd.enable() requires no threads in backwards()" on running SFTTrainer on unsloth/gemma-2 models[/+] on Nov 6, 2024
  2. sudha-kannan commented on Nov 7, 2024

    @sudha-kannan

    Yes, I too face similar issue

  3. changed the title [-]Getting "compiled_autograd.enable() requires no threads in backwards()" on running SFTTrainer on unsloth/gemma-2 models[/-] [+][FIXED] `compiled_autograd.enable()` Gemma[/+] on Nov 7, 2024
  4. added
    fixed - pending confirmation
    on Nov 7, 2024
  5. danielhanchen commented on Nov 7, 2024

    @danielhanchen
    Member

    Apologies just fixed it! @sudha-kannan @InderjeetVishnoi also cc @Erland366

    Please update Unsloth without changing dependencies if on local machines - Colab / Kaggle just delete the runtime and start again

    pip uninstall unsloth unsloth-zoo -y && pip install --upgrade --no-cache-dir --no-deps unsloth unsloth-zoo

  6. pinned this issue on Nov 7, 2024
  7. InderjeetVishnoi commented on Nov 7, 2024

    @InderjeetVishnoi
    Author

    Hi @danielhanchen
    Thank you for the quick fix, it is working now :)

  8. sudha-kannan commented on Nov 7, 2024

    @sudha-kannan

    Thank you @danielhanchen for the fix, appreciate it!

  9. unpinned this issue on Nov 14, 2024
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