mirror of
https://github.com/deepseek-ai/DeepEP.git
synced 2026-11-05 00:47:32 +00:00
[PR #684] Fix JIT cache crash for rename-race losers on shared filesystems #704
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/DeepEP#704
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/DeepEP/pull/684
Author: @Oseltamivir
Created: 7/11/2026
Status: 🔄 Open
Base:
main← Head:fix-jit-cache-nfs-rename-race📝 Commits (2)
1ed3fbbFix JIT cache crash for rename-race losers on shared filesystemsef2ae56Address review: share validity diagnostics in put(), document winner-path invariant, debug-log the fallback branch📊 Changes
2 files changed (+27 additions, -1 deletions)
View changed files
📝
csrc/jit/cache.hpp(+12 -0)📝
csrc/jit/compiler.hpp(+15 -1)📄 Description
Fixes #683.
Problem
On a shared filesystem (the default
$HOME/.deep_epis typically NFS on multi-node clusters), the losing side of the compile/rename race inCompiler::build()crashes atEP_HOST_ASSERT(runtime != nullptr): its rename fails authoritatively at the server, but the winner's directory may not be visible to its NFS client yet, the initial cache miss primed a negative lookup cache entry that can outlive the failed rename. Full mechanism in #683.Change
Make the losing path self-sufficient instead of requiring cross-client visibility:
csrc/jit/compiler.hpp: on rename failure, load the runtime from this process's own just-compiled temp directory (equivalent artifacts. The cache key hashes kernel name, source, flags, and compiler signature), cache it under the canonicaldir_pathkey, then delete the temp directory.csrc/jit/cache.hpp: addKernelRuntimeCache::put(key_path, load_path)to construct from one path and cache under another.This is safe because the
KernelRuntimeconstructor consumes the files eagerly (cuobjdump -symbols, thencudaLibraryLoadFromFile/cuModuleLoad) and keeps only GPU handles. Warm starts still read the shared cache exactly as before; other rename failures (e.g. permissions) now degrade gracefully instead of asserting (scope: the rename failure itself — a subsequent failure to load the loser's own artifacts remains fatal, with the samecheck_validitydiagnostics as any other cache entry).Testing
Two 8-GPU H200 nodes (16 ranks), JIT cache on shared NFS, cold start,
ElasticBufferconstruction plus a dispatch/combine round trip per rank (EP_JIT_DEBUG=1):compiler.hpp:158while JIT-building the dispatch/combine kernels; the other node hangs in the next collective.Loading CUBIN: <cache>/tmp/<uuid>/kernel.cubin), and the sharedtmp/is empty afterwards.ef2ae56re-validated on the same setup: the newEP_JIT_DEBUGfallback log fired 75/75 times, each paired 1:1 with a tmp-dir CUBIN load, 16/16 ranks green.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.