Repository navigation
Studio diffusion probe cache: key persisted verdicts on the installed GPU driver - #18574
Merged
Merged
Conversation
… GPU driver torch has no _cuda_getDriverVersion, so the fingerprint always recorded driver=None and a driver update never invalidated a persisted quant or INT8 attention verdict. Read the driver without a CUDA context (NVIDIA kernel module version, else the loaded driver library identity, plus cuDriverGetVersion; on ROCm the HIP and amdgpu driver versions), once per process. When no driver identity can be read, nothing is persisted or adopted and the probes run fresh.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Member
Author
|
@codex review |
1 similar comment
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#18156 made INT8 attention verdicts persist across processes, keyed by the shared probe-cache fingerprint (torch, CUDA, driver, card). The quant probe verdicts use that same fingerprint. The driver part comes from
torch._C._cuda_getDriverVersion, and no current torch build has that function (2.12.1+cu130, 2.13.0, 2.14.1+cu130 checked). So the fingerprint always recordsdriver=None. After a driver update, a passing persisted INT8 attention verdict is still adopted with only a launch warm-up, a negative one skips even that, and the quant verdicts are reused the same way.Change
fingerprint()now reads the driver itself, once per process and without creating a CUDA context:/proc/driver/nvidia/version, or if that file is missing (WSL, some containers, Windows) the name, size and mtime of the driver library this process loaded (libcuda.so*from/proc/self/maps, orSystem32\nvcuda.dll).cuDriverGetVersionis added when it answers._rocm_driver_version()fromdiffusion_attention(HIP driver version, plus the amdgpu module version or kernel release).If no driver identity can be read,
fingerprint()returns None. Then nothing is stored or adopted and the probes run fresh, as they did before persistence. Every namespace built onfingerprint()gets this fix. Existing cache entries were keyed withdriver=None, so each one misses once and is probed again on the first start after the update.Tests
tests/test_diffusion_probe_cache_driver.py(CPU only; the card, the proc file and the driver library are faked):Namespaceandload/storeOn main, 4 of the 5 fail. The same-driver reuse case passes on both, as it should. With this change, all 5 pass. The existing probe-cache users (
test_diffusion_int8_attention_persisted.py,test_diffusion_transformer_quant.py,test_early_quant_probe.py,test_diffusion_probe_overlap.py,test_diffusion_cold_start.py,test_diffusion_early_probe_prewarm.py,test_diffusion_compat_preflight.py,test_diffusion_rocm_tag_detect.pyand one more block test) fail the same 36 test IDs on main and with this change. The 35 intest_diffusion_compat_preflight.pycome fromggufnot being installed in the test venv; the remaining one, intest_diffusion_cold_start.py, fails identically on main. There are no new failures.Not proven
cuda13010,nvrm590.48.01). The WSL, Windows and ROCm readers were exercised only through fakes.