Skip to content

[docs] Fix QuantizedTensor.from_float examples to use layout name strings#43

Open
BhagyeshKothalkar wants to merge 1 commit into
Comfy-Org:mainfrom
BhagyeshKothalkar:fix-readme-keyerror
Open

[docs] Fix QuantizedTensor.from_float examples to use layout name strings#43
BhagyeshKothalkar wants to merge 1 commit into
Comfy-Org:mainfrom
BhagyeshKothalkar:fix-readme-keyerror

Conversation

@BhagyeshKothalkar
Copy link
Copy Markdown

Summary

This PR updates the QuantizedTensor.from_float(...) examples to match the current API.

What changed

  • Fixed the README example to pass the registered layout name string
  • Fixed the TensorCoreFP8Layout docstring example to do the same

Why

QuantizedTensor.from_float(...) currently expects layout_cls to be the registered layout name string, not the layout class object itself. Internally, the implementation resolves that string through the LAYOUTS registry in comfy_kitchen.tensor.base. While the codebase and test suite correctly pass this string, the README examples and docstrings pass the layout class object.

As a result, passing TensorCoreFP8Layout directly raises a lookup error, while passing "TensorCoreFP8Layout" works as intended. This PR updates the examples to reflect the behavior implemented by the current API.

Scope

Documentation only; no implementation changes.

@BhagyeshKothalkar BhagyeshKothalkar changed the title Fix QuantizedTensor.from_float examples to use layout name strings [docs] Fix QuantizedTensor.from_float examples to use layout name strings May 24, 2026
@BhagyeshKothalkar
Copy link
Copy Markdown
Author

@maxious @guill @yoland68 @robinjhuang It is a documentation-only fix to ensure the QuantizedTensor.from_float examples match the current API behavior and avoid lookup errors.

The PR is ready, but it appears to be waiting on a workflow approval from a maintainer. Could someone please take a look when you have a moment? Also, please let me know if there is anything else you need from my side to get this merged. Thanks!

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.

1 participant