feat(gpu_prover): cap device allocation via PROVER_GPU_MEMORY_FRACTION#312
Open
ericker-cyfrin wants to merge 2 commits into
Open
feat(gpu_prover): cap device allocation via PROVER_GPU_MEMORY_FRACTION#312ericker-cyfrin wants to merge 2 commits into
ericker-cyfrin wants to merge 2 commits into
Conversation
ProverContext::new() allocates all free GPU memory, which prevents co-locating another GPU process (e.g. a SNARK prover) on the same device. Add an optional PROVER_GPU_MEMORY_FRACTION env var (0 < f <= 1), read in ProverContextConfig::default(); when set, device allocation is capped at min(free, total * fraction). Unset preserves the previous "allocate all free memory" behavior, so this is a no-op by default.
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.
ProverContext::new() allocates all free GPU memory, which prevents co-locating another GPU process (e.g. a SNARK prover) on the same device. Add an optional PROVER_GPU_MEMORY_FRACTION env var (0 < f <= 1), read in ProverContextConfig::default(); when set, device allocation is capped at min(free, total * fraction). Unset preserves the previous "allocate all free memory" behavior, so this is a no-op by default.
What ❔
It introduces an environment variable that is a decimal value between 0<1 that limits the amount of memory of a GPU that the FRI prover takes upon startup
Why ❔
There are times when you want to run both the FRI and SNARK provers on the same GPU. By limiting the amount of memory allocated to the FRI prover on startup, the SNARK prover is allowed enough memory to function.
Is this a breaking change?
Checklist