mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[PR #157] [CLOSED] Add stochastic FP8 rounding to Triton backend #183
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-kitchen#183
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/comfy-kitchen/pull/157
Author: @tangzzycc
Created: 9/5/2026
Status: ❌ Closed
Base:
main← Head:feat/triton-stochastic-fp8📝 Commits (2)
d2dd0cfAdd Triton stochastic FP8 rounding73ed759Skip Triton stochastic FP8 tests below SM89📊 Changes
5 files changed (+261 additions, -1 deletions)
View changed files
📝
README.md(+1 -1)📝
comfy_kitchen/backends/triton/__init__.py(+13 -0)📝
comfy_kitchen/backends/triton/quantization.py(+123 -0)📝
tests/test_constraints.py(+8 -0)📝
tests/test_qdq.py(+116 -0)📄 Description
Summary
Add a Triton implementation of
stochastic_rounding_fp8for NVIDIA GPUs with native FP8 support (compute capability 8.9+). This avoids the slow, memory-heavy eager fallback reported in Comfy-Org/ComfyUI#15311 when the native CUDA backend is unavailable.Changes
uint8RNG buffer as output, avoiding an additional output allocation.Correctness and compatibility
RTX 5090 performance
BF16 to E4M3FN, warmed kernels, median latency, rotating working set >= 256 MiB:
For 16,777,216 contiguous BF16 elements, both CUDA and Triton add 0 MiB of peak PyTorch-allocated memory because the output aliases the RNG buffer. Eager adds 240 MiB.
Validation
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.