Fix: Resolve NaN Logit Memory Leak During Sequential Benchmarks (Issue #2095)#2108
Open
glaziermag wants to merge 1 commit intoEricLBuehler:masterfrom
Open
Fix: Resolve NaN Logit Memory Leak During Sequential Benchmarks (Issue #2095)#2108glaziermag wants to merge 1 commit intoEricLBuehler:masterfrom
glaziermag wants to merge 1 commit intoEricLBuehler:masterfrom
Conversation
c77e476 to
816eeda
Compare
816eeda to
ea333da
Compare
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.
Fixes memory corruption and sequence state leakage during sequential
mistralrs benchiterations (#2095).Cause
When benchmarking long generations offline (e.g.,
--gen-len >= 512) over sequential iterations, the engine accumulates orphan sequences. Becausemistralrsengine daemon recycles the exact same context array for sequential throughput loops on a per-benchmark thread, unevicted KV caches overlap bounds into the multi-nomial sampler over sequence accumulation, forcing the engine core to panic dynamically.Changes
mistralrs-cli/src/commands/bench.rs: Explicitly drops the engine state variables by triggeringRequest::TerminateAllSeqsNextStepdynamically between consecutive benchmark iteration stages and immediately following the warmup sequence block.Empirical Execution Baseline (GCP
g2-standard-32L4 Tensor Verification)Before
When running raw pipelines against L4 instances utilizing native
f16orGGUF:After
(Successfully completes exactly 5/5 generation loops without logging numerical instability or NaN panics across GPU threading models)