Skip to content

breakpoint in _inner_training_loop not works #1985

Closed

Description

@llzllx70

The code is as follow:

  1. the log "begin _inner_training_loop ...................................." can print in the terminal
  2. but I can't stop at the breakpoint in this fun. Somebody meet the same issue?
  3. ths

Image

~/anaconda3/envs/Unsloth/lib/python3.10/site-packages/transformers/trainer.py

class Trainer:

 def _inner_training_loop(
    self, batch_size=None, args=None, resume_from_checkpoint=None, trial=None, ignore_keys_for_eval=None
):

    print('begin _inner_training_loop ....................................')

    self.accelerator.free_memory()
    self._train_batch_size = batch_size
    if self.args.auto_find_batch_size:
        if self.state.train_batch_size != self._train_batch_size:
            from accelerate.utils import release_memory

            (self.model_wrapped,) = release_memory(self.model_wrapped)
            self.model_wrapped = self.model

Activity

  1. zfflxx commented on Mar 13, 2025

    @zfflxx

    unsloth use lots of eval(), you can use: import debugpy;debugpy.breakpoint() instead

  2. llzllx70 commented on Mar 14, 2025

    @llzllx70
    Author

    unsloth use lots of eval(), you can use: import debugpy;debugpy.breakpoint() instead

    I have test it, but ineffective。

  3. Lcy77 commented on May 14, 2025

    @Lcy77

    I met the same problem, do you solve it?

    unsloth use lots of eval(), you can use: import debugpy;debugpy.breakpoint() instead

    I have test it, but ineffective。

  4. rolandtannous commented on Jun 30, 2025

    @rolandtannous
    Contributor

    This is a common issue with debugging and GPU threads.

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