Skip to content

chore: filter ck backend info#13995

Open
Apophis3158 wants to merge 1 commit into
Comfy-Org:masterfrom
Apophis3158:filter-ck-info
Open

chore: filter ck backend info#13995
Apophis3158 wants to merge 1 commit into
Comfy-Org:masterfrom
Apophis3158:filter-ck-info

Conversation

@Apophis3158
Copy link
Copy Markdown
Contributor

Current comfy_kitchen backend prints redundant information:

Found comfy_kitchen backend triton: {'available': False, 'disabled': True, 'unavailable_reason': "ImportError: No module named 'triton'", 'capabilities': []}
Found comfy_kitchen backend eager: {'available': True, 'disabled': False, 'unavailable_reason': None, 'capabilities': ['apply_rope', 'apply_rope1', 'dequantize_mxfp8', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'quantize_mxfp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8', 'scaled_mm_mxfp8', 'scaled_mm_nvfp4']}
Found comfy_kitchen backend cuda: {'available': True, 'disabled': True, 'unavailable_reason': None, 'capabilities': ['apply_rope', 'apply_rope1', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'quantize_mxfp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8']}

Filter to necessary info: when not available, indicate available status and unavailable_reason; when available, show if disabled and it's capabilities:

Found comfy_kitchen backend triton: {'available': False, 'unavailable_reason': "ImportError: No module named 'triton'"}
Found comfy_kitchen backend eager: {'disabled': False, 'capabilities': ['apply_rope', 'apply_rope1', 'dequantize_mxfp8', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'quantize_mxfp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8', 'scaled_mm_mxfp8', 'scaled_mm_nvfp4']}
Found comfy_kitchen backend cuda: {'disabled': True, 'capabilities': ['apply_rope', 'apply_rope1', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'quantize_mxfp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8']}

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adjusts backend discovery logging and coordinates a corresponding CI test adjustment. The comfy/quant_ops.py change filters backend metadata output to include only status-related fields (disabled/capabilities for available backends, available/unavailable_reason otherwise) instead of logging the entire backend info object. The .github/workflows/test-launch.yml change updates the test workflow's grep filter regex to exclude the new logging message format, narrowing which triton-availability messages are removed before scanning for unhandled errors.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: filter ck backend info' accurately describes the main change: filtering comfy_kitchen backend information in logging output.
Description check ✅ Passed The description is directly related to the changeset, providing clear before/after examples of the backend logging output and explaining the filtering rationale.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
comfy/quant_ops.py (1)

36-37: ⚡ Quick win

Consider improving readability of the filtering logic.

The nested ternary conditional inside the dict comprehension is dense and difficult to parse at a glance. While functionally correct, extracting this into a helper function or using a more explicit structure would improve maintainability.

♻️ Proposed refactor for improved readability
-    for k, v in ck.list_backends().items():
-        filtered = {kk: vv for kk, vv in v.items() if (kk in ('disabled', 'capabilities') if v['available'] else kk in ('available', 'unavailable_reason'))}
-        logging.info(f"Found comfy_kitchen backend {k}: {filtered}")
+    for k, v in ck.list_backends().items():
+        if v.get('available', False):
+            keys_to_show = ('disabled', 'capabilities')
+        else:
+            keys_to_show = ('available', 'unavailable_reason')
+        filtered = {kk: vv for kk, vv in v.items() if kk in keys_to_show}
+        logging.info(f"Found comfy_kitchen backend {k}: {filtered}")
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@comfy/quant_ops.py` around lines 36 - 37, The dict comprehension that builds
filtered is hard to read due to the nested ternary; refactor by extracting the
inclusion logic into a small helper (e.g., a function named should_include_key
or compute_allowed_keys) or by computing allowed_keys before constructing
filtered and then using {kk: vv for kk, vv in v.items() if kk in allowed_keys};
update the comprehension that assigns filtered and adjust the logging line to
use the clearer variable so behavior remains identical for keys when
v['available'] is True or False and for the same symbols k and v.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/test-launch.yml:
- Line 35: The current grep literal is too brittle; replace it with a
regex-based negative filter that looks for the semantic pieces instead of the
exact dict formatting: match lines containing "backend" and "triton" plus an
"available" false value and an ImportError mentioning "triton" (use a flexible
regex via grep -E -v or perl-compatible grep -Pv to allow varying spacing/quotes
and alternate ImportError text). Update the grep invocation that currently
contains the exact dict string so it filters using this regex pattern (target
the existing grep command string in the workflow).

---

Nitpick comments:
In `@comfy/quant_ops.py`:
- Around line 36-37: The dict comprehension that builds filtered is hard to read
due to the nested ternary; refactor by extracting the inclusion logic into a
small helper (e.g., a function named should_include_key or compute_allowed_keys)
or by computing allowed_keys before constructing filtered and then using {kk: vv
for kk, vv in v.items() if kk in allowed_keys}; update the comprehension that
assigns filtered and adjust the logging line to use the clearer variable so
behavior remains identical for keys when v['available'] is True or False and for
the same symbols k and v.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 38e220f7-7bd6-4601-bd16-4242227306ca

📥 Commits

Reviewing files that changed from the base of the PR and between cc4d711 and 521ec8f.

📒 Files selected for processing (2)
  • .github/workflows/test-launch.yml
  • comfy/quant_ops.py

Comment thread .github/workflows/test-launch.yml
@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedyarl@​1.24.2100100100100100

View full report

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