-
Notifications
You must be signed in to change notification settings - Fork 11.4k
[MPS][Apple Silicon] video_wan2_2_14B_fun_inpaint: convert Float8_e4m3fn to the MPS backend but it does not have support for that dtype #11740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
macpaul
wants to merge
8
commits into
Comfy-Org:master
Choose a base branch
from
macpaul:macpaul/mps2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+244
−9
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add a new MPS-specific operations module to handle Float8 tensor support on Apple Silicon. Since MPS does not natively support Float8 dtypes, this implementation uses a uint8 storage strategy combined with a GPU-accelerated Lookup Table (LUT) for efficient dequantization, keeping data on the GPU. - Add comfy/mps_ops.py: Implement cached LUT generation and index-based dequantization for MPS. - Modify comfy/quant_ops.py: Add logic to view Float8 tensors as uint8 when moving to MPS, and route dequantization to mps_ops. - Modify comfy/float.py: Add CPU staging for stochastic rounding to prevent MPS casting errors during quantization. - Modify comfy/quant_ops.py: Add fallback for fp8_linear. Signed-off-by: Macpaul Lin <macpaul@gmail.com>
…ng errors Signed-off-by: Macpaul Lin <macpaul@gmail.com>
…edTensor Signed-off-by: Macpaul Lin <macpaul@gmail.com>
…Tensor Signed-off-by: Macpaul Lin <macpaul@gmail.com>
…edTensor Signed-off-by: Macpaul Lin <macpaul@gmail.com>
…pe to prevent precision mismatch RuntimeErrors Signed-off-by: Macpaul Lin <macpaul@gmail.com>
…ike for mock QuantizedTensor Signed-off-by: Macpaul Lin <macpaul@gmail.com>
…r QuantizedTensor Signed-off-by: Macpaul Lin <macpaul@gmail.com>
|
This is leading to a crash when running video_wan2_2_5B_ti2v @macpaul |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue: #11626
Main solution is feat(mps): implement native-like Float8 support via LUT dequantization.
However, it encountered some merge conflicts when master branch was updated to 0.8.0 and later.
Hence, I've added a bunch of fixes to the errors I've encountered. Please check if they are adapteable to master branch.
Signed-off-by: Macpaul Lin macpaul@gmail.com