mirror of
https://github.com/deepseek-ai/DeepGEMM.git
synced 2026-11-05 00:47:26 +00:00
[PR #398] Make the JIT cache key independent of the install include path #417
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
deepseek-ai/DeepGEMM#417
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/deepseek-ai/DeepGEMM/pull/398
Author: @matteso1
Created: 8/5/2026
Status: 🔄 Open
Base:
main← Head:jit-cache-key-relocatable📝 Commits (3)
865b0ceMake the JIT cache key independent of the install include path06a6ae2Include bundled headers in the JIT cache key4f85910Fix header hashing through directory symlinks📊 Changes
5 files changed (+142 additions, -2 deletions)
View changed files
📝
csrc/jit/compiler.hpp(+24 -1)📝
csrc/jit/include_parser.hpp(+26 -0)📝
csrc/utils/system.hpp(+1 -1)➕
tests/test_include_parser.cpp(+58 -0)➕
tests/test_include_parser.py(+33 -0)📄 Description
This resubmits #388 so the repository's current automated review runs.
The bug
The kernel cache key embeds the absolute
-I{library_include_path}token throughflags. Byte-identical kernels therefore re-JIT and create duplicate cache entries when the install prefix changes, such as a renamed virtual environment or a container build path that differs from the runtime path. That prevents a sharedDG_JIT_CACHE_DIRfrom being portable across those layouts.This follows simon-mo's request on vllm-project/vllm#48190 to propose the relocation fix upstream rather than carry it as a vendored patch. Related but distinct work includes #301/#302 for JIT cache concurrency and #333 for wheel portability.
The fix
Strip only the exact
-I{library_include_path}token when computing the cache key. The actual compile command andDG_JIT_DEBUGoutput are unchanged.To keep reuse safe across different installed bundles, the full installed include tree is hashed once per process by relative path and file content. That tree hash covers the packaged DeepGEMM, CUTE, and CUTLASS headers without depending on the install prefix. The compiler-version
signature, every behavioral flag, and every other include path also remain keyed. Existing entries re-JIT once under the new key.Measured
The broader vendored variant in vllm-project/vllm#48190 also drops the compiler-version field. On one H100 NVL with Qwen3-30B-A3B-FP8, TP1, and DeepGEMM
a6b593d, relocating a planted cache caused the stock key to recompile 41/41 kernels and start in 170.6 seconds. The tested portable key reused 41/41 and started in 76.9 seconds, a 93.7-second difference, n=1 per arm.This PR is intentionally narrower because it retains compiler-version identity. Its exact diff has not been independently timed on GPU hardware.
Test plan
git diff --checkmainat559d79fb6994a58b8a15b4b93bf13ccc16edf247🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.