Skip to content

[bug] when set report_to = "clearml",will get error #2012

Closed

Description

@jaffe-fly
model, tokenizer = FastLanguageModel.from_pretrained(
    model_name = model_path,
    max_seq_length = MAX_SEQ_LENGTH,
    dtype = None,
    load_in_4bit = True
)

FastLanguageModel.for_training(model)

model = FastLanguageModel.get_peft_model(
    model,
    r = 16, # Choose any number > 0 ! Suggested 8, 16, 32, 64, 128
    target_modules = ["q_proj", "k_proj", "v_proj", "o_proj",
                      "gate_proj", "up_proj", "down_proj",],
    lora_alpha = 16,
    lora_dropout = 0, # Supports any, but = 0 is optimized
    bias = "none",    # Supports any, but = "none" is optimized
    # [NEW] "unsloth" uses 30% less VRAM, fits 2x larger batch sizes!
    use_gradient_checkpointing = "unsloth", # True or "unsloth" for very long context
    random_state = 3407,
    use_rslora = False,  # We support rank stabilized LoRA
    loftq_config = None, # And LoftQ
)


trainer = SFTTrainer(
    model = model,
    tokenizer = tokenizer,
    train_dataset = dataset,
    dataset_text_field = "text",
    max_seq_length = MAX_SEQ_LENGTH,
    dataset_num_proc = 2,
    packing = False, # Can make training 5x faster for short sequences.
    args = TrainingArguments(
        per_device_train_batch_size = 2,
        gradient_accumulation_steps = 4,
        warmup_steps = 5,
        max_steps = 75,
        # num_train_epochs = 1, # For longer training runs!
        learning_rate = 2e-4,
        fp16 = not is_bfloat16_supported(),
        bf16 = is_bfloat16_supported(),
        logging_steps = 1,
        optim = "adamw_8bit",
        weight_decay = 0.01,
        lr_scheduler_type = "linear",
        seed = 3407,
        output_dir = output_path,
        report_to = "clearml", # Use this for WandB etc
    ),
)

will get error,but if report_to = "none",will ok

 File "/root/anaconda3/envs/unsloth_env/lib/python3.11/site-packages/torch/_dynamo/variables/functions.py", line 727, in call_function
    unimplemented(msg)
  File "/root/anaconda3/envs/unsloth_env/lib/python3.11/site-packages/torch/_dynamo/exc.py", line 297, in unimplemented
    raise Unsupported(msg, case_name=case_name)
torch._dynamo.exc.Unsupported: Graph break due to unsupported builtin builtins.__import__. This function is either a Python builtin (e.g. _warnings.warn) or a third-party C/C++ Python extension (perhaps created with pybind). If it is a Python builtin, please file an issue on GitHub so the PyTorch team can add support for it and see the next case for a workaround. If it is a third-party C/C++ Python extension, please either wrap it into a PyTorch-understood custom operator (see https://pytorch.org/tutorials/advanced/custom_ops_landing_page.html for more details) or, if it is traceable, use torch.compiler.allow_in_graph.

from user code:
   File "/root/anaconda3/envs/unsloth_env/lib/python3.11/site-packages/clearml/binding/import_bind.py", line 54, in __patched_import3
    mod = builtins.__org_import__(

Set TORCH_LOGS="+dynamo" and TORCHDYNAMO_VERBOSE=1 for more information

Activity

  1. Erland366 commented on Mar 14, 2025

    @Erland366
    Collaborator

    Disabling CCE solves this issue.

    Do you want me to create a PR for this? @danielhanchen

  2. jaffe-fly commented on Mar 17, 2025

    @jaffe-fly
    Author

    Disabling CCE solves this issue.

    Do you want me to create a PR for this? @danielhanchen

    how to Disabling CCE ?which line need to fix,for my continue work?

  3. Erland366 commented on Mar 17, 2025

    @Erland366
    Collaborator

    Hmmmm, can you try to uninstall CCE in your code? by pip uninstall cut-cross-entropy ?

  4. jaffe-fly commented on Mar 18, 2025

    @jaffe-fly
    Author

    Hmmmm, can you try to uninstall CCE in your code? by pip uninstall cut-cross-entropy ?

    this is ok, great!

  5. jaffe-fly commented on Apr 2, 2025

    @jaffe-fly
    Author

    still can not train , will stuck for a very very long time

  6. danielhanchen commented on Sep 15, 2026

    @danielhanchen
    Member

    Fixed! report_to set to clearml trains without the dynamo import error now. If you see training hang rather than error out, that's a different symptom, so please open a new issue with the script and versions and we'll take a look.

    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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions