mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[PR #256] cuda: mark attn_mask .none() on sage_sdpa and sage_sdpa_prequantized for nanobind < 2.11 #263
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#263
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/256
Author: @fblissjr
Created: 10/18/2026
Status: 🔄 Open
Base:
main← Head:fix-sage-sdpa-attn-mask-none📝 Commits (1)
c2ea126cuda bindings: mark attn_mask .none() on sage_sdpa and sage_sdpa_prequantized for nanobind < 2.11📊 Changes
1 file changed (+2 additions, -2 deletions)
View changed files
📝
comfy_kitchen/backends/cuda/dlpack_bindings.cpp(+2 -2)📄 Description
When
comfy-kitchenis built from source withnanobind < 2.11.0(pyproject.tomlallowsnanobind>=2.0.0), callingint8_attentionorint8_attention_from_prequantizedwithattn_mask=None(the default) raises aTypeError:Why this happens
690f765), the CUDA bindings forsage_sdpaandsage_sdpa_prequantizedchangednb::arg("attn_mask") = nb::none()to a barenb::arg("attn_mask")(while the HIP backend kept= nb::none()).nanobind >= 2.11.0(used to build the PyPI0.2.38wheel) automatically treatsstd::optional<T>parameters as.none()(wjakob/nanobind#1262), soNoneis accepted even with a barenb::arg("attn_mask").nanobind 2.0.0–2.10.2requires an explicit.none()(or= nb::none()) onnb::arg(...), otherwiseNoneis rejected at runtime.Fix
Mark
nb::arg("attn_mask").none()on bothsage_sdpa_prequantizedandsage_sdpaincomfy_kitchen/backends/cuda/dlpack_bindings.cpp(matching the otherstd::optionalbindings in the file).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.