Skip to content

feat: Support mxfp8#12907

Merged
comfyanonymous merged 8 commits intoComfy-Org:masterfrom
kijai:mxfp8
Mar 14, 2026
Merged

feat: Support mxfp8#12907
comfyanonymous merged 8 commits intoComfy-Org:masterfrom
kijai:mxfp8

Conversation

@kijai
Copy link
Copy Markdown
Contributor

@kijai kijai commented Mar 12, 2026

As this is already supported in comfy-kitchen. Blackwell only in practice.
Tested with

https://huggingface.co/Kijai/LTX2.3_comfy/blob/main/diffusion_models/experimental/ltx-2.3-22b-distilled_transformer_only_mxfp8_block32.safetensors

Example on 5090

BF16:
8/8 [02:09<00:00, 16.14s/it]

bf16_00001-audio.mp4

mxfp8:
8/8 [01:17<00:00, 9.68s/it]

ltx23_mxfp8_00001-audio.mp4

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 12, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds MXFP8 support across the codebase: MixedPrecisionOps._load_from_state_dict gains a mxfp8 branch that loads per-block block_scale (uint8 → cast to torch.float8_e8m0fnu) and attaches it to layout params; pick_operations disables mxfp8 when FP8 compute is unavailable. Introduces TensorCoreMXFP8Layout (with a private fallback) and registers it when available. Extends QUANT_ALGOS with a mxfp8 entry (storage_t torch.float8_e4m3fn, parameters weight_scale/input_scale, group_size 32). Adds stochastic_round_quantize_mxfp8_by_block for block-wise MXFP8 quantization.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and concisely summarizes the main change: adding support for MXFP8 format across multiple files.
Description check ✅ Passed The description is related to the changeset, providing context about MXFP8 support (already in comfy-kitchen), hardware specifics, tested model, and performance benchmarks.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@comfy/ops.py`:
- Around line 804-818: pick_operations() must treat "mxfp8" like the other FP8
formats when fp8_compute is False: add "mxfp8" to the disabled set so
unsupported backends will trigger the fallback that sets _full_precision_mm =
True instead of continuing the FP8 load path; update the logic that builds the
disabled set (the function pick_operations and any variable named disabled or
similar) to include "mxfp8" whenever not fp8_compute, and ensure downstream
selection uses that disabled set so the MXFP8 branch in the load path (the code
constructing layout_cls.Params with torch.float8_e8m0fnu) is bypassed for
non-FP8-capable backends.

In `@comfy/quant_ops.py`:
- Around line 11-12: The module currently references TensorCoreMXFP8Layout
without a local definition so add a fallback stub for TensorCoreMXFP8Layout in
the existing import-fallback block (same place other layout stubs live) so the
name always exists when comfy_kitchen is absent; then guard its use by wrapping
the register_layout_op(...) call that mentions TensorCoreMXFP8Layout (and any
other registrations using it) with a check that the real comfy_kitchen-provided
class is present (or use a boolean flag set during import fallback) and remove
or conditionally include TensorCoreMXFP8Layout from the module export list
(__all__) so it is only exported when the real implementation is available.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2fad1690-a310-4a61-a995-c7388ed86646

📥 Commits

Reviewing files that changed from the base of the PR and between 44f1246 and d59731c.

📒 Files selected for processing (2)
  • comfy/ops.py
  • comfy/quant_ops.py

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@comfy/ops.py`:
- Around line 804-818: The MXFP8 branch handling when self.quant_format ==
"mxfp8" uses torch.float8_e8m0fnu directly
(block_scale.view(torch.float8_e8m0fnu)), which will fail on PyTorch < 2.8 even
if supports_fp8_compute() returned true; add an explicit PyTorch version check
(e.g., compute torch_version_numeric >= (2,8) or similar) before using or
returning torch.float8_e8m0fnu in this code path and in any related places (see
get_supported_float8_types(), supports_fp8_compute()); if the PyTorch version is
too old, raise a clear error or fall back to a safe path rather than calling
block_scale.view with the missing dtype, and ensure layout_cls.Params is only
constructed with a valid dtype.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 40be2d6c-a9a7-4b46-93ec-e385006b5312

📥 Commits

Reviewing files that changed from the base of the PR and between d59731c and b322b57.

📒 Files selected for processing (2)
  • comfy/ops.py
  • comfy/quant_ops.py

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@comfy/quant_ops.py`:
- Around line 144-145: QUANT_ALGOS is adding the "mxfp8" entry unconditionally
while TensorCoreMXFP8Layout is only registered when _CK_AVAILABLE is true,
causing get_layout_class() to return None and later dereference
layout_cls.Params; update the code so that the "mxfp8" entry is only appended to
QUANT_ALGOS when _CK_AVAILABLE is true (same conditional that calls
register_layout_class("TensorCoreMXFP8Layout", TensorCoreMXFP8Layout)), ensuring
the availability check (_CK_AVAILABLE), the registration call
(register_layout_class/TensorCoreMXFP8Layout), and the QUANT_ALGOS update are
guarded together to prevent layout_cls from being None in comfy/ops.py where
layout_cls.Params is used.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b5649e78-76c7-450b-9961-add3116d725d

📥 Commits

Reviewing files that changed from the base of the PR and between b322b57 and 9eceec6.

📒 Files selected for processing (1)
  • comfy/quant_ops.py

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@comfy/float.py`:
- Line 247: The return uses the dtype symbol torch.float8_e8m0fnu directly which
breaks on older PyTorch versions; update the code around the return in
comfy/float.py (the to_blocked(...).view(...) call that uses block_scales_e8m0,
flatten=False and returns output_fp8) to safely resolve the dtype via a
try/except or getattr fallback (e.g., attempt to use torch.float8_e8m0fnu and
fall back to a compatible dtype or raise a clear error) so it matches the
defensive pattern used elsewhere (like comfy/model_management.py).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 54d0b618-c271-4eb1-9f92-d20bead18547

📥 Commits

Reviewing files that changed from the base of the PR and between 9eceec6 and 7220240.

📒 Files selected for processing (2)
  • comfy/float.py
  • comfy/quant_ops.py

comfy/ops.py Outdated
if not fp8_compute:
disabled.add("float8_e4m3fn")
disabled.add("float8_e5m2")
disabled.add("mxfp8")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you check if this works on ada?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, no it doesn't work... comfy-kitchen does handle it so outputs work with error spam, so better to disable for non-blackwell, adding that.

@xueqing0622
Copy link
Copy Markdown

xueqing0622 commented Mar 13, 2026

Successfully installed comfy-kitchen-0.2.8
update the comfyui lastest
use this branch: https://github.com/kijai/ComfyUI/tree/mxfp8
still not work:
and this is my computer info:
Total VRAM 32607 MB, total RAM 196370 MB
pytorch version: 2.9.1+cu130
Set vram state to: NORMAL_VRAM
Disabling smart memory management
Device: cuda:0 NVIDIA GeForce RTX 5090 : native
Using async weight offloading with 2 streams
Enabled pinned memory 88366.0
working around nvidia conv3d memory bug.
Using pytorch attention
aimdo: src-win/cuda-detour.c:77:INFO:aimdo_setup_hooks: found driver at 00007FFDA7FB0000, installing 4 hooks
aimdo: src-win/cuda-detour.c:61:DEBUG:install_hook_entrys: hooks successfully installed
aimdo: src/control.c:66:INFO:comfy-aimdo inited for GPU: NVIDIA GeForce RTX 5090 (VRAM: 32606 MB)
DynamicVRAM support detected and enabled
Python version: 3.11.9 | packaged by Anaconda, Inc. | (main, Apr 19 2024, 16:40:41) [MSC v.1916 64 bit (AMD64)]
ComfyUI version: 0.17.0
comfy-aimdo version: 0.2.8
comfy-kitchen version: 0.2.8

and the error:
Requested to load LTXAV
Model LTXAV prepared for dynamic VRAM loading. 22917MB Staged. 1660 patches attached.
Patching torch settings: torch.backends.cuda.matmul.allow_fp16_accumulation = True
0%| | 0/8 [00:00<?, ?it/s, Model Initializing ... ]
Patching torch settings: torch.backends.cuda.matmul.allow_fp16_accumulation = False
!!! Exception during processing !!! float8 types are not supported by dlpack
Traceback (most recent call last):
File "F:\ComfyUI\ComfyUI\execution.py", line 524, 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 "F:\ComfyUI\ComfyUI\execution.py", line 333, 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 "F:\ComfyUI\ComfyUI\execution.py", line 307, in async_map_node_over_list
await process_inputs(input_dict, i)
File "F:\ComfyUI\ComfyUI\execution.py", line 295, in process_inputs
result = f(**inputs)
^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy_api\internal_init
.py", line 149, in wrapped_func
return method(locked_class, **inputs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy_api\latest_io.py", line 1764, in EXECUTE_NORMALIZED
to_return = cls.execute(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy_extras\nodes_custom_sampler.py", line 769, in execute
samples = comfy.sample.sample_custom(model, noise, cfg, sampler, sigmas, positive, negative, latent_image, noise_mask=noise_mask, callback=callback, disable_pbar=disable_pbar, seed=noise_seed)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\sample.py", line 71, in sample_custom
samples = comfy.samplers.sample(model, noise, positive, negative, cfg, model.load_device, sampler, sigmas, model_options=model.model_options, latent_image=latent_image, denoise_mask=noise_mask, callback=callback, disable_pbar=disable_pbar, seed=seed)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\samplers.py", line 1069, in sample
return cfg_guider.sample(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\samplers.py", line 1051, in sample
output = executor.execute(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed, latent_shapes=latent_shapes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\patcher_extension.py", line 113, in execute
return self.wrappers[self.idx](self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-KJNodes\nodes\ltxv_nodes.py", line 878, in call
out = executor(noise, latent_image, sampler, sigmas, denoise_mask, combined_callback, disable_pbar, seed, latent_shapes=latent_shapes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\patcher_extension.py", line 105, in call
return new_executor.execute(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\patcher_extension.py", line 112, in execute
return self.original(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\samplers.py", line 995, in outer_sample
output = self.inner_sample(noise, latent_image, device, sampler, sigmas, denoise_mask, callback, disable_pbar, seed, latent_shapes=latent_shapes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\samplers.py", line 981, in inner_sample
samples = executor.execute(self, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\patcher_extension.py", line 112, in execute
return self.original(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\samplers.py", line 751, in sample
samples = self.sampler_function(model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar, **self.extra_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\env\python311b\Lib\site-packages\torch\utils_contextlib.py", line 120, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\k_diffusion\sampling.py", line 1015, in sample_lcm
denoised = model(x, sigmas[i] * s_in, **extra_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\samplers.py", line 400, in call
out = self.inner_model(x, sigma, model_options=model_options, seed=seed)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\samplers.py", line 954, in call
return self.outer_predict_noise(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\samplers.py", line 961, in outer_predict_noise
).execute(x, timestep, model_options, seed)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\patcher_extension.py", line 112, in execute
return self.original(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\samplers.py", line 964, in predict_noise
return sampling_function(self.inner_model, x, timestep, self.conds.get("negative", None), self.conds.get("positive", None), self.cfg, model_options=model_options, seed=seed)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\samplers.py", line 380, in sampling_function
out = calc_cond_batch(model, conds, x, timestep, model_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\samplers.py", line 205, in calc_cond_batch
return _calc_cond_batch_outer(model, conds, x_in, timestep, model_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\samplers.py", line 213, in _calc_cond_batch_outer
return executor.execute(model, conds, x_in, timestep, model_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\patcher_extension.py", line 112, in execute
return self.original(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\samplers.py", line 325, in calc_cond_batch
output = model.apply_model(input_x, timestep
, **c).chunk(batch_chunks)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\model_base.py", line 170, in apply_model
return comfy.patcher_extension.WrapperExecutor.new_class_executor(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\patcher_extension.py", line 112, in execute
return self.original(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\model_base.py", line 209, in _apply_model
model_output = self.diffusion_model(xc, t, context=context, control=control, transformer_options=transformer_options, **extra_conds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\env\python311b\Lib\site-packages\torch\nn\modules\module.py", line 1775, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\env\python311b\Lib\site-packages\torch\nn\modules\module.py", line 1786, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\ldm\lightricks\av_model.py", line 1020, in forward
return super().forward(
^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\ldm\lightricks\model.py", line 879, in forward
return comfy.patcher_extension.WrapperExecutor.new_class_executor(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\patcher_extension.py", line 112, in execute
return self.original(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\ldm\lightricks\model.py", line 932, in _forward
x = self._process_transformer_blocks(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\ldm\lightricks\av_model.py", line 929, in _process_transformer_blocks
vx, ax = block(
^^^^^^
File "F:\env\python311b\Lib\site-packages\torch\nn\modules\module.py", line 1775, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\env\python311b\Lib\site-packages\torch\nn\modules\module.py", line 1786, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\ldm\lightricks\av_model.py", line 276, in forward
attn1_out = self.attn1(norm_vx, pe=v_pe, mask=self_attention_mask, transformer_options=transformer_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\env\python311b\Lib\site-packages\torch\nn\modules\module.py", line 1775, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\env\python311b\Lib\site-packages\torch\nn\modules\module.py", line 1786, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\ldm\lightricks\model.py", line 401, in forward
q = self.to_q(x)
^^^^^^^^^^^^
File "F:\env\python311b\Lib\site-packages\torch\nn\modules\module.py", line 1775, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\env\python311b\Lib\site-packages\torch\nn\modules\module.py", line 1786, in call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\ops.py", line 922, in forward
input = QuantizedTensor.from_float(input_reshaped, self.layout_type, scale=scale)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\env\python311b\Lib\site-packages\comfy_kitchen\tensor\base.py", line 234, in from_float
qdata, params = get_layout_class(layout_cls).quantize(tensor, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\ComfyUI\ComfyUI\comfy\quant_ops.py", line 114, in quantize
qdata, block_scale = ck.quantize_mxfp8(tensor, pad_32x=needs_padding)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\env\python311b\Lib\site-packages\comfy_kitchen_init
.py", line 186, in quantize_mxfp8
return torch.ops.comfy_kitchen.quantize_mxfp8(x, pad_32x)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\env\python311b\Lib\site-packages\torch_ops.py", line 1255, in call
return self._op(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\env\python311b\Lib\site-packages\torch_library\custom_ops.py", line 343, in backend_impl
result = self._backend_fns[device_type](*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\env\python311b\Lib\site-packages\torch_compile.py", line 53, in inner
return disable_fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\env\python311b\Lib\site-packages\torch_dynamo\eval_frame.py", line 1044, in _fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "F:\env\python311b\Lib\site-packages\torch_library\custom_ops.py", line 376, in wrapped_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "F:\env\python311b\Lib\site-packages\comfy_kitchen\backends\eager\quantization.py", line 570, in op_quantize_mxfp8
return impl(**kwargs)
^^^^^^^^^^^^^^
File "F:\env\python311b\Lib\site-packages\comfy_kitchen\backends\cuda_init
.py", line 298, in quantize_mxfp8
wrap_for_dlpack(qx),
^^^^^^^^^^^^^^^^^^^^
File "F:\env\python311b\Lib\site-packages\comfy_kitchen\backends\cuda_init
.py", line 136, in _wrap_for_dlpack
return tensor.dlpack(stream=-1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\env\python311b\Lib\site-packages\torch_tensor.py", line 1782, in dlpack
return _C._to_dlpack(self, dl_device=dl_device, copy=copy)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
BufferError: float8 types are not supported by dlpack

@kijai
Copy link
Copy Markdown
Contributor Author

kijai commented Mar 13, 2026

BufferError: float8 types are not supported by dlpack

Are you using a LoRA? If so, which one? Is it maybe saved in fp8?

@xueqing0622
Copy link
Copy Markdown

xueqing0622 commented Mar 13, 2026

BufferError: float8 types are not supported by dlpack

Are you using a LoRA? If so, which one? Is it maybe saved in fp8?

no any lora, even without distilled-lora, same error

this is workflow
mxfp8.json

@kijai
Copy link
Copy Markdown
Contributor Author

kijai commented Mar 13, 2026

BufferError: float8 types are not supported by dlpack

Are you using a LoRA? If so, which one? Is it maybe saved in fp8?

no any lora, even without distilled-lora, same error

this is workflow mxfp8.json

Okay, it's the pytorch version, confirmed same error in 2.9.1 while in 2.10.0 it works.

@xueqing0622
Copy link
Copy Markdown

BufferError: float8 types are not supported by dlpack

Are you using a LoRA? If so, which one? Is it maybe saved in fp8?

no any lora, even without distilled-lora, same error
this is workflow mxfp8.json

Okay, it's the pytorch version, confirmed same error in 2.9.1 while in 2.10.0 it works.

yes, it work now. thx kijai. Have a nice day!

@comfyanonymous comfyanonymous merged commit 1c5db73 into Comfy-Org:master Mar 14, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants