Reference only

Float, Half and BFloat16 mismatch: trace the failing operation

A dtype failure differs from a shape or device failure. Start with the traceback and incompatible operand types; a KSampler error alone does not identify the component that caused them.

Symptoms and scope

A dtype failure differs from a shape or device failure. Start with the traceback and incompatible operand types; a KSampler error alone does not identify the component that caused them.

Error fragments for search; IDs, values and filenames may vary:

mat1 and mat2 must have the same dtype
Float and Half
BFloat16

Source-supported context

Issue #6907 records a Float/Half failure after a Mac Desktop update. Its traceback reaches an attention torch.baddbmm call through several third-party extension frames; the report does not prove which component introduced the mismatch. BFloat16 is a general search term here, not an error reported in that case. PyTorch AMP guidance treats a type mismatch as a reason to inspect the operation, not to insert blanket casts. Source 1 Source 2 Source 3

Cases to distinguish

1. A loader or custom node casts only part of the computation path.

2. Quantization, attention or device fallback changes the compute dtype.

3. Partially updated core/extensions retain incompatible precision assumptions or startup options.

Diagnostic sequence

The sequence below is an editorial procedure based on the cited context, not a diagnosis already confirmed for your environment.

Step 1. Keep the exact dtype message, backend and full traceback. Find the failing operation and any third-party frames; do not assign blame from the KSampler node label alone. Separate stored weight precision from runtime tensor dtype.

Step 2. In a copy, compare the model or workflow author's documented backend and precision settings when available. Temporarily remove only optional quantization or acceleration, one change at a time, and monitor memory.

Step 3. Compare a same-family minimal native workflow, then reintroduce LoRA, controls and extensions one at a time.

Step 4. Report a stable minimal reproduction with versions. Source-level forced casting belongs to someone who understands the implementation, not a generic one-click patch.

Completion check

The operation completes with compatible types and valid output without a new memory or numerical failure. A resulting OOM is a separate problem.

Limitations and cautions

Converting everything to float32 can substantially increase memory; converting everything to half can introduce unsupported operations or numerical instability.

Original sources

English source review: 2026-09-26. No site-run workflow, GPU test, minimum-memory measurement or repair outcome is claimed.

Didn't solve it?

Check the next possible cause

The same symptom can come from a different cause. Work through these related entries in order.

  1. Expected all tensors to be on the same device: inspect branch boundariesExpected all tensors to be on the same deviceOne operation may receive an image on CUDA and a mask on CPU, or branches on different GPUs. This does not mean the whole application failed to recognize the GPU.
  2. Float8 is unsupported on MPS: distinguish stored weights from compute dtypeFloat8_e4m3fnLocate whether the failure happens during weight loading, dequantization or an operation. A file's FP8 label alone does not describe every possible quantized execution path.
  3. mat1 and mat2 shapes cannot be multiplied: inspect the model component chainmat1 and mat2 shapes cannot be multipliedMatrix dimensions help locate a failure during sampling, encoding or adapter use, but one numeric pair does not identify a unique missing model.
Paste your full log into the error finder

Was this page helpful?

Anonymous. Only a yes/no counter is stored; no account, IP address or device details.

Sources & references

Reviewed ComfyUI issue #6907, PyTorch AMP guidance and ComfyUI custom-node troubleshooting on 2026-09-26. The issue shows an attention baddbmm failure and third-party frames, not a proven root cause. No site-run workflow, GPU test or confirmed repair is claimed.

01Float and Half mismatch on Mac DesktopSource checked: 2026-09-2602PyTorch AMP recipeSource checked: 2026-09-2603ComfyUI custom node troubleshootingSource checked: 2026-09-26

Report an issue · 3533b265-1ef3-5626-b807-8cff84e94e0c