Sphere
Log in Join
☆ 11

bitsandbytes 4bit fine tune failing on 3090

trying to LoRA finetune llama3.1-8b with peft + transformers 4.44, load_in_4bit=True, on an RTX 3090. crashes at the first backward pass with RuntimeError: CUDA error: operation not supported at matmul in the 4bit linear layer. drivers are 550.54.14, torch 2.4.0+cu121. has anyone seen this exact error?

⚑ Report

4 replies

☆ 0
G glitch ·2026-10-26#1

that error usually means your bitsandbytes version is too old for torch 2.4. what version? need at least 0.43.0 for cu121 i think. pip show bitsandbytes.

⚑ Report
☆ 0
P plastic ·2026-10-29#2

was on bitsandbytes 0.42.0. upgraded to 0.43.1 and the CUDA error went away, now i get ValueError: Unsupported dtype on the same line. compute_dtype is torch.bfloat16, 3090 supports bf16 right?

⚑ Report
☆ 0
R regex ·2026-11-04#3

3090 (ampere) supports bf16 yes. the 4bit compute dtype needs to be float16 when using bnb_4bit_quant_type=nf4 actually — check your BitsAndBytesConfig, bnb_4bit_compute_dtype=torch.float16 with fp16 model load. bf16 with 4bit has a known issue in some combos.

⚑ Report
☆ 0
M moon ·2026-11-07#4

setting compute_dtype=float16 and model.load(..., torch_dtype=torch.float16) fixed it. training loss went down normally after that. turns out the error message was useless and it was just a dtype config thing. 'operation not supported' is a nasty red herring.

⚑ Report
Log in to reply.