lllyasviel / lllyasviel/stable-diffusion-webui-forge

Q6_K gguf quant not working

Open
#1,270 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Under Construction
Dominant language
Python
Stars
13k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

Get the following error when starting inference:

`Traceback (most recent call last):
File "H:\forge\webui\modules_forge\main_thread.py", line 30, in work
self.result = self.func(*self.args, **self.kwargs)
File "H:\forge\webui\modules\txt2img.py", line 110, in txt2img_function
processed = processing.process_images(p)
File "H:\forge\webui\modules\processing.py", line 813, in process_images
res = process_images_inner(p)
File "H:\forge\webui\modules\processing.py", line 956, in process_images_inner
samples_ddim = p.sample(conditioning=p.c, unconditional_conditioning=p.uc, seeds=p.seeds, subseeds=p.subseeds, subseed_strength=p.subseed_strength, prompts=p.prompts)
File "H:\forge\webui\modules\processing.py", line 1327, in sample
samples = self.sampler.sample(self, x, conditioning, unconditional_conditioning, image_conditioning=self.txt2img_image_conditioning(x))
File "H:\forge\webui\modules\sd_samplers_kdiffusion.py", line 234, in sample
samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args=self.sampler_extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
File "H:\forge\webui\modules\sd_samplers_common.py", line 272, in launch_sampling
return func()
File "H:\forge\webui\modules\sd_samplers_kdiffusion.py", line 234, in
samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args=self.sampler_extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
File "H:\forge\system\python\lib\site-packages\torch\utils\_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
File "H:\forge\webui\k_diffusion\sampling.py", line 128, in sample_euler
denoised = model(x, sigma_hat * s_in, **extra_args)
File "H:\forge\system\python\lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "H:\forge\system\python\lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
File "H:\forge\webui\modules\sd_samplers_cfg_denoiser.py", line 186, in forward
denoised, cond_pred, uncond_pred = sampling_function(self, denoiser_params=denoiser_params, cond_scale=cond_scale, cond_composition=cond_composition)
File "H:\forge\webui\backend\sampling\sampling_function.py", line 339, in sampling_function
denoised, cond_pred, uncond_pred = sampling_function_inner(model, x, timestep, uncond, cond, cond_scale, model_options, seed, return_full=True)
File "H:\forge\webui\backend\sampling\sampling_function.py", line 284, in sampling_function_inner
cond_pred, uncond_pred = calc_cond_uncond_batch(model, cond, uncond_, x, timestep, model_options)
File "H:\forge\webui\backend\sampling\sampling_function.py", line 254, in calc_cond_uncond_batch
output = model.apply_model(input_x, timestep_, **c).chunk(batch_chunks)
File "H:\forge\webui\backend\modules\k_model.py", line 45, in apply_model
model_output = self.diffusion_model(xc, t, context=context, control=control, transformer_options=transformer_options, **extra_conds).float()
File "H:\forge\system\python\lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "H:\forge\system\python\lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
File "H:\forge\webui\backend\nn\flux.py", line 402, in forward
out = self.inner_forward(img, img_ids, context, txt_ids, timestep, y, guidance)
File "H:\forge\webui\backend\nn\flux.py", line 373, in inner_forward
img, txt = block(img=img, txt=txt, vec=vec, pe=pe)
File "H:\forge\system\python\lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "H:\forge\system\python\lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
File "H:\forge\webui\backend\nn\flux.py", line 191, in forward
img_mod1_shift, img_mod1_scale, img_mod1_gate, img_mod2_shift, img_mod2_scale, img_mod2_gate = self.img_mod(vec)
File "H:\forge\system\python\lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "H:\forge\system\python\lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
File "H:\forge\webui\backend\nn\flux.py", line 161, in forward
out = self.lin(nn.functional.silu(vec))[:, None, :].chunk(self.multiplier, dim=-1)
File "H:\forge\system\python\lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "H:\forge\system\python\lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
File "H:\forge\webui\backend\operations.py", line 369, in forward
return functional_linear_gguf(x, self.weight, self.bias)
File "H:\forge\webui\backend\operations_gguf.py", line 60, in functional_linear_gguf
return torch.nn.functional.linear(x, weight, bias)
RuntimeError: mat1 and mat2 shapes cannot be multiplied (1x3072 and 2520x18432)
mat1 and mat2 shapes cannot be multiplied (1x3072 and 2520x18432)`

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the traceback entry points in backend/nn/flux.py, backend/operations.py, and backend/operations_gguf.py, then reproduce the Q6_K inference failure. Trace the tensor dimensions reaching functional_linear_gguf and identify the relevant model or quantization mismatch; done means Q6_K inference completes without the reported shape error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.