Diffusion Single File
comfyui

Throws an error even on latest comfy kitchen 0.2.27 in ComfyUI

#5
by pizzaboy29 - opened

ComfyUI Error Report

Error Details

  • Node ID: 129
  • Node Type: UNETLoader
  • Exception Type: KeyError
  • Exception Message: KeyError: 'asym_w4a8_int8'

Stack Trace

  File "D:\SD\SM\Data\Packages\ComfyUI\execution.py", line 545, in execute
    output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)

  File "D:\SD\SM\Data\Packages\ComfyUI\execution.py", line 344, in get_output_data
    return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)

  File "D:\SD\SM\Data\Packages\ComfyUI\execution.py", line 318, in _async_map_node_over_list
    await process_inputs(input_dict, i)

  File "D:\SD\SM\Data\Packages\ComfyUI\execution.py", line 306, in process_inputs
    result = f(**inputs)

  File "D:\SD\SM\Data\Packages\ComfyUI\nodes.py", line 997, in load_unet
    model = comfy.sd.load_diffusion_model(unet_path, model_options=model_options)

  File "D:\SD\SM\Data\Packages\ComfyUI\comfy\sd.py", line 2215, in load_diffusion_model
    model = load_diffusion_model_state_dict(sd, model_options=model_options, metadata=metadata, disable_dynamic=disable_dynamic)

  File "D:\SD\SM\Data\Packages\ComfyUI\comfy\sd.py", line 2207, in load_diffusion_model_state_dict
    model.load_model_weights(new_sd, "", assign=model_patcher.is_dynamic())

  File "D:\SD\SM\Data\Packages\ComfyUI\comfy\model_base.py", line 364, in load_model_weights
    m, u = self.diffusion_model.load_state_dict(to_load, strict=False, assign=assign)

  File "D:\SD\SM\Data\Packages\ComfyUI\venv\lib\site-packages\torch\nn\modules\module.py", line 2618, in load_state_dict
    load(self, state_dict)

  File "D:\SD\SM\Data\Packages\ComfyUI\venv\lib\site-packages\torch\nn\modules\module.py", line 2605, in load
    load(child, child_state_dict, child_prefix)  # noqa: F821

  File "D:\SD\SM\Data\Packages\ComfyUI\venv\lib\site-packages\torch\nn\modules\module.py", line 2605, in load
    load(child, child_state_dict, child_prefix)  # noqa: F821

  File "D:\SD\SM\Data\Packages\ComfyUI\venv\lib\site-packages\torch\nn\modules\module.py", line 2605, in load
    load(child, child_state_dict, child_prefix)  # noqa: F821

  [Previous line repeated 1 more time]

  File "D:\SD\SM\Data\Packages\ComfyUI\venv\lib\site-packages\torch\nn\modules\module.py", line 2588, in load
    module._load_from_state_dict(

  File "D:\SD\SM\Data\Packages\ComfyUI\comfy\ops.py", line 1308, in _load_from_state_dict
    _load_quantized_module(self, super()._load_from_state_dict, *args, load_extra_params=True)

  File "D:\SD\SM\Data\Packages\ComfyUI\comfy\ops.py", line 1168, in _load_quantized_module
    qconfig = QUANT_ALGOS[module.quant_format]
pizzaboy29 changed discussion title from Throws an error even on latest comfy kitchen in ComfyUI to Throws an error even on latest comfy kitchen 0.2.27 in ComfyUI

I mistakenly deleted the necessary information. I've updated the readme, so please check it.

Just saw kijai's new W4A8 commit on the main comfy repo and now i get this new error msg after updating

[INFO] Found quantization metadata version 1
[INFO] Detected mixed precision quantization
[INFO] Using mixed precision operations
[INFO] Native ops: int8_tensorwise, float8_e4m3fn, float8_e5m2, convrot_w4a4, asym_w4a8_int8 , emulated ops: mxfp8, nvfp4
[INFO] model weight dtype torch.bfloat16, manual cast: torch.bfloat16
[INFO] model_type FLOW_AV
[ERROR] !!! Exception during processing !!! Missing W4A8 group scale (weight_s_rel) for layer blocks.0.attn.qkv_proj
[ERROR] Traceback (most recent call last):
File "D:\SD\SM\Data\Packages\ComfyUI\execution.py", line 545, in execute
output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
File "D:\SD\SM\Data\Packages\ComfyUI\execution.py", line 344, in get_output_data
return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
File "D:\SD\SM\Data\Packages\ComfyUI\execution.py", line 318, in _async_map_node_over_list
await process_inputs(input_dict, i)
File "D:\SD\SM\Data\Packages\ComfyUI\execution.py", line 306, in process_inputs
result = f(**inputs)
File "D:\SD\SM\Data\Packages\ComfyUI\nodes.py", line 997, in load_unet
model = comfy.sd.load_diffusion_model(unet_path, model_options=model_options)
File "D:\SD\SM\Data\Packages\ComfyUI\comfy\sd.py", line 2215, in load_diffusion_model
model = load_diffusion_model_state_dict(sd, model_options=model_options, metadata=metadata, disable_dynamic=disable_dynamic)
File "D:\SD\SM\Data\Packages\ComfyUI\comfy\sd.py", line 2207, in load_diffusion_model_state_dict
model.load_model_weights(new_sd, "", assign=model_patcher.is_dynamic())
File "D:\SD\SM\Data\Packages\ComfyUI\comfy\model_base.py", line 364, in load_model_weights
m, u = self.diffusion_model.load_state_dict(to_load, strict=False, assign=assign)
File "D:\SD\SM\Data\Packages\ComfyUI\venv\lib\site-packages\torch\nn\modules\module.py", line 2618, in load_state_dict
load(self, state_dict)
File "D:\SD\SM\Data\Packages\ComfyUI\venv\lib\site-packages\torch\nn\modules\module.py", line 2605, in load
load(child, child_state_dict, child_prefix) # noqa: F821
File "D:\SD\SM\Data\Packages\ComfyUI\venv\lib\site-packages\torch\nn\modules\module.py", line 2605, in load
load(child, child_state_dict, child_prefix) # noqa: F821
File "D:\SD\SM\Data\Packages\ComfyUI\venv\lib\site-packages\torch\nn\modules\module.py", line 2605, in load
load(child, child_state_dict, child_prefix) # noqa: F821
[Previous line repeated 1 more time]
File "D:\SD\SM\Data\Packages\ComfyUI\venv\lib\site-packages\torch\nn\modules\module.py", line 2588, in load
module._load_from_state_dict(
File "D:\SD\SM\Data\Packages\ComfyUI\comfy\ops.py", line 1331, in _load_from_state_dict
_load_quantized_module(self, super()._load_from_state_dict, *args, load_extra_params=True)
File "D:\SD\SM\Data\Packages\ComfyUI\comfy\ops.py", line 1219, in _load_quantized_module
raise ValueError(f"Missing W4A8 group scale (weight_s_rel) for layer {layer_name}")
ValueError: Missing W4A8 group scale (weight_s_rel) for layer blocks.0.attn.qkv_proj

Just saw kijai's new W4A8 commit on the main comfy repo and now i get this new error msg after updating

[INFO] Found quantization metadata version 1
[INFO] Detected mixed precision quantization
[INFO] Using mixed precision operations
[INFO] Native ops: int8_tensorwise, float8_e4m3fn, float8_e5m2, convrot_w4a4, asym_w4a8_int8 , emulated ops: mxfp8, nvfp4
[INFO] model weight dtype torch.bfloat16, manual cast: torch.bfloat16
[INFO] model_type FLOW_AV
[ERROR] !!! Exception during processing !!! Missing W4A8 group scale (weight_s_rel) for layer blocks.0.attn.qkv_proj
[ERROR] Traceback (most recent call last):
File "D:\SD\SM\Data\Packages\ComfyUI\execution.py", line 545, in execute
output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
File "D:\SD\SM\Data\Packages\ComfyUI\execution.py", line 344, in get_output_data
return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
File "D:\SD\SM\Data\Packages\ComfyUI\execution.py", line 318, in _async_map_node_over_list
await process_inputs(input_dict, i)
File "D:\SD\SM\Data\Packages\ComfyUI\execution.py", line 306, in process_inputs
result = f(**inputs)
File "D:\SD\SM\Data\Packages\ComfyUI\nodes.py", line 997, in load_unet
model = comfy.sd.load_diffusion_model(unet_path, model_options=model_options)
File "D:\SD\SM\Data\Packages\ComfyUI\comfy\sd.py", line 2215, in load_diffusion_model
model = load_diffusion_model_state_dict(sd, model_options=model_options, metadata=metadata, disable_dynamic=disable_dynamic)
File "D:\SD\SM\Data\Packages\ComfyUI\comfy\sd.py", line 2207, in load_diffusion_model_state_dict
model.load_model_weights(new_sd, "", assign=model_patcher.is_dynamic())
File "D:\SD\SM\Data\Packages\ComfyUI\comfy\model_base.py", line 364, in load_model_weights
m, u = self.diffusion_model.load_state_dict(to_load, strict=False, assign=assign)
File "D:\SD\SM\Data\Packages\ComfyUI\venv\lib\site-packages\torch\nn\modules\module.py", line 2618, in load_state_dict
load(self, state_dict)
File "D:\SD\SM\Data\Packages\ComfyUI\venv\lib\site-packages\torch\nn\modules\module.py", line 2605, in load
load(child, child_state_dict, child_prefix) # noqa: F821
File "D:\SD\SM\Data\Packages\ComfyUI\venv\lib\site-packages\torch\nn\modules\module.py", line 2605, in load
load(child, child_state_dict, child_prefix) # noqa: F821
File "D:\SD\SM\Data\Packages\ComfyUI\venv\lib\site-packages\torch\nn\modules\module.py", line 2605, in load
load(child, child_state_dict, child_prefix) # noqa: F821
[Previous line repeated 1 more time]
File "D:\SD\SM\Data\Packages\ComfyUI\venv\lib\site-packages\torch\nn\modules\module.py", line 2588, in load
module._load_from_state_dict(
File "D:\SD\SM\Data\Packages\ComfyUI\comfy\ops.py", line 1331, in _load_from_state_dict
_load_quantized_module(self, super()._load_from_state_dict, *args, load_extra_params=True)
File "D:\SD\SM\Data\Packages\ComfyUI\comfy\ops.py", line 1219, in _load_quantized_module
raise ValueError(f"Missing W4A8 group scale (weight_s_rel) for layer {layer_name}")
ValueError: Missing W4A8 group scale (weight_s_rel) for layer blocks.0.attn.qkv_proj

Yeah, same. And even though Kijai his version works, it is painfully slow on my card, whereas the normal int8 conv model is much faster. And this repo version was fast but a bit slower than int8 conv using the provided wheel but that is problematic if you want to stay updated with the latest comfy kitchen. It almost looks like the Kijai version doesn't have the th convrotational speedup this one provides.

ComfyUI and comfy-kitchen have officially added support for w4a8.
You can download the model from here.
https://huggingface.co/Kijai/MiniMax-H3-experimental/tree/main

Just in case, I'll distribute the model here as well.
At least on my machine, it's faster than int8convrot.

pizzaboy29 changed discussion status to closed

Sign up or log in to comment