[PR #76] [MERGED] Speed up native builds with portable compiler caching #124

Closed
opened 2026-10-26 22:20:36 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/comfy-kitchen/pull/76
Author: @contentis
Created: 7/14/2026
Status: ✅ Merged
Merged: 7/15/2026
Merged by: @comfyanonymous

Base: main ← Head: build-cache-version


📝 Commits (6)

📊 Changes

5 files changed (+206 additions, -138 deletions)

View changed files

📝 .github/workflows/build-wheels.yml (+116 -88)
📝 comfy_kitchen/__init__.py (+0 -2)
📝 comfy_kitchen/backends/cuda/CMakeLists.txt (+44 -21)
📝 comfy_kitchen/backends/cuda/dlpack_bindings.cpp (+0 -2)
📝 setup.py (+46 -25)

📄 Description

This reduces CUDA wheel build time by using Ninja and ccache in Linux and Windows CI.

CUDA kernels now build as a separate object target. This keeps the expensive CUTLASS translation units independent of the Python/nanobind extension target, allowing ccache to reuse kernel fatbins across wheel builds when Python-specific build inputs change.

Also removes forced CMake-cache deletion so CMake can reuse its generated build graph.
Measured locally on Linux with the default fatbin architecture set:

  • Build from scratch: 447.30 s (7m 27s)
  • Rebuild after touching only ops/apply_rope.cu: 6.44 s

The RoPE-only rebuild compiled apply_rope.cu and relinked _C; all other CUDA translation units were unchanged.

CI cache-hit rates will be reported through ccache --show-stats.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/comfy-kitchen/pull/76 **Author:** [@contentis](https://github.com/contentis) **Created:** 7/14/2026 **Status:** ✅ Merged **Merged:** 7/15/2026 **Merged by:** [@comfyanonymous](https://github.com/comfyanonymous) **Base:** `main` ← **Head:** `build-cache-version` --- ### 📝 Commits (6) - [`7045bc1`](https://github.com/Comfy-Org/comfy-kitchen/commit/7045bc18520dc06cdeaaec8c21a9a841092777d6) Speed up native builds with portable compiler caching - [`bf9bf66`](https://github.com/Comfy-Org/comfy-kitchen/commit/bf9bf6646bdaafbdea511811f23064bcfab09602) single version truth - [`07c0bfb`](https://github.com/Comfy-Org/comfy-kitchen/commit/07c0bfb6e973a5355bdcba9ab4e84b91ab415240) Fix windows and add stats - [`59aaa41`](https://github.com/Comfy-Org/comfy-kitchen/commit/59aaa411743711b1e509207bc9cb469018e98ae9) pls - [`938cbb6`](https://github.com/Comfy-Org/comfy-kitchen/commit/938cbb6baf2ce4738977e739e9ff6705047a63fa) this should hit now - [`fc8b1fb`](https://github.com/Comfy-Org/comfy-kitchen/commit/fc8b1fbe6c1f89a6eef80ab2bb70614c91f92442) harden cuda discovery ### 📊 Changes **5 files changed** (+206 additions, -138 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/build-wheels.yml` (+116 -88) 📝 `comfy_kitchen/__init__.py` (+0 -2) 📝 `comfy_kitchen/backends/cuda/CMakeLists.txt` (+44 -21) 📝 `comfy_kitchen/backends/cuda/dlpack_bindings.cpp` (+0 -2) 📝 `setup.py` (+46 -25) </details> ### 📄 Description This reduces CUDA wheel build time by using Ninja and ccache in Linux and Windows CI. CUDA kernels now build as a separate object target. This keeps the expensive CUTLASS translation units independent of the Python/nanobind extension target, allowing ccache to reuse kernel fatbins across wheel builds when Python-specific build inputs change. Also removes forced CMake-cache deletion so CMake can reuse its generated build graph. Measured locally on Linux with the default fatbin architecture set: - Build from scratch: 447.30 s (7m 27s) - Rebuild after touching only ops/apply_rope.cu: 6.44 s The RoPE-only rebuild compiled apply_rope.cu and relinked _C; all other CUDA translation units were unchanged. CI cache-hit rates will be reported through ccache --show-stats. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 22:20:36 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/comfy-kitchen#124
No description provided.