unsloth/unsloth
Daniel Han d6e40df8fa
Fix llm_int8_skip_modules for VLM dynamic quants on transformers 5.x (#4249)
Fix `llm_int8_skip_modules` not being respected for VLMs with dynamic quantization on transformers 5.x.

Dynamic quant checkpoints (e.g. `gemma-3-4b-it-unsloth-bnb-4bit`) encode skip paths as `language_model.model.layers.*`, but the live module tree on 5.x surfaces them as `model.language_model.layers.*`. This prefix mismatch causes `should_convert_module` to miss the skip list, so 22 modules meant to stay in 16-bit get wrapped in `Linear4bit` without a `quant_state`, producing "Skipping ... no quant_state found" warnings.

Patches `should_convert_module` to expand both the module name and the skip patterns into all equivalent alias forms before matching. Guarded by `hasattr` so it is a no-op on transformers 4.x where the bug does not exist.

Closes #4208
2026-03-13 00:17:00 -07:00
..
dataprep Guard optional vLLM imports when extension is broken (#4068) 2026-02-15 22:09:29 -08:00
kernels fix(ROCm): restrict is_rdna() to ROCm-officially-supported RDNA GPUs (#4136) 2026-03-03 03:05:38 -08:00
models Fix llm_int8_skip_modules for VLM dynamic quants on transformers 5.x (#4249) 2026-03-13 00:17:00 -07:00
registry Revert "[pre-commit.ci] auto fixes from pre-commit.com hooks" 2025-12-01 07:24:58 -08:00
utils Cache packed sequence metadata to reduce D2H syncs across layers (#4243) 2026-03-12 03:37:49 -07:00
__init__.py Bug fixed version 2026-03-08 06:39:19 -07:00
_auto_install.py Add PyTorch 2.10 and xformers 0.0.34 support (#3985) 2026-02-05 05:56:26 -08:00
chat_templates.py Fix regressions from security PRs #4042, #4044, and #4045 (#4062) 2026-02-15 23:16:17 -08:00
device_type.py Conditionally enable 4bit on CDNA for bitsandbytes>=v0.49.2 (#4161) 2026-03-07 01:33:40 -08:00
import_fixes.py Also patch accelerate's is_wandb_available for trl callbacks path (#4148) 2026-03-03 08:28:55 -08:00
ollama_template_mappers.py Refactor Ollama template wiring and harden packing helpers (#3890) 2026-02-09 04:04:48 -08:00
save.py fix: update GGUF save paths to use ~/.unsloth/llama.cpp with Windows support (#4138) 2026-03-03 06:34:09 -08:00
tokenizer_utils.py Add resilience to TRL internal API reclassification (#4111) 2026-02-25 06:34:21 -08:00
trainer.py Fix auto padding free logic to respect user passed False (#4128) 2026-03-01 19:30:47 -08:00