Skip to content

NameError: merge_quantization_configs in patch_merge_quantization_configs on Kaggle P100 #3130

Closed
unslothai/unsloth-zoo
#1230

Description

@JXPJXT

Description
When importing Unsloth on Kaggle (Tesla P100), the dynamic patch in unsloth_zoo/temporary_patches/misc.py fails with a SyntaxError or NameError because it generates an invalid from transformers.quantizers.auto import () statement.

Steps to Reproduce

pip install --upgrade unsloth[colab-new] unsloth_zoo

In a Kaggle notebook (Runtime GPU: Tesla P100), run:

python
import torch
from unsloth import FastLanguageModel
Observe the error:

text
File ".../unsloth_zoo/temporary_patches/misc.py", line 66, in patch_merge_quantization_configs
exec("from transformers.quantizers.auto import (" + ",".join(x for x in items if x in source) + ")", globals())
File "", line 1
from transformers.quantizers.auto import ()
^
SyntaxError: invalid syntax
Environment

Platform: Kaggle (GPU: Tesla P100)

Unsloth version: unsloth-2025.8.4

unsloth_zoo version: 2025.8.3

TRL version: 0.8.6

Transformers version: 4.55.0

PyTorch version: 2.6.0+cu124

python

Remove or redact any Hugging Face tokens before sharing

!pip install --upgrade unsloth[colab-new] unsloth_zoo
!pip install --no-deps xformers<0.0.27 trl<0.9.0 peft accelerate bitsandbytes

import torch
from unsloth import FastLanguageModel # Fails here
Expected Behavior
Unsloth should import normally; patch_merge_quantization_configs should be a no-op or guarded so an empty import isn’t executed.

Suggested Fix
Guard the dynamic import in misc.py:

text

  • exec("from transformers.quantizers.auto import (" + ",".join(items) + ")", globals())
  • if items:
  •    exec("from transformers.quantizers.auto import (" + ",".join(items) + ")", globals())
    

Activity

  1. Erland366 commented on Aug 13, 2025

    @Erland366
    Collaborator

    I am testing it using !pip install --upgrade unsloth[colab-new] unsloth_zoo and seems like after importing Unsloth, there is no error appear.

    Also I do not think Unsloth support P100 because Triton did not support Pascal generation (see this issue in Triton). You can use our notebook kaggle example here instead which uses the 2xT4 machines

  2. Armysniper46 commented on Mar 21, 2026

    @Armysniper46

    Modified two system files to resolve CUDA 12.2 + MSVC 14.44 incompatibility:

    1. Changed version check from 1940 to 1950
      for me it was on line 162 in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include\crt\host_config.h

    2. Changed CUDA version check from 12.4 to 12.2
      Commented out the error --> (//_EMIT_STL_ERROR(STL1002, "Unexpected compiler version, expected CUDA 12.4 or newer.");)
      for me it was on line 902 in C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.44.35207\include\yvals_core.h

    these fixed the issues when i ran "irm https://unsloth.ai/install.ps1 | iex"
    currently im running it on tesla p100 16gb that only supported up to cuda 6.0 with nvidia grid driver(538.15) DCH and the chat works without any issues but i never tried the training

    Image
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions