-
Notifications
You must be signed in to change notification settings - Fork 1
fix(gpu): recover device-only declines at the remaining cliff sites (R4 DEEP, comp-tree, R3 barycentric) #935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a812ad4
fix(gpu): recover device-only declines at the remaining cliff sites (…
ColoCarletti a891020
test(gpu): exercise the cliff-site recoveries end to end
ColoCarletti 956b1e5
Merge branch 'main' into gpu-cliff-recovery
ColoCarletti 88aa439
fix(gpu): address cliff-recovery review — race-free sticky hook, para…
ColoCarletti 23fabf4
Merge branch 'gpu-cliff-recovery' of github.com:yetanotherco/lambda_v…
ColoCarletti b64e7a3
style(gpu): rustfmt check_sticky and correct its doc
ColoCarletti 7863a67
test(gpu): assert the parts-download counter is zero on the happy pat…
MauroToscano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| //! Sticky fault-injection hooks for the GPU error-path tests. | ||
| //! | ||
| //! Unlike the one-shot hooks in `fri` and `inverse` (which disarm after | ||
| //! firing, so a drain-and-retry absorbs the injected error before it can | ||
| //! surface), a sticky hook keeps failing once its armed call count is | ||
| //! reached, until explicitly disarmed. The device-decline recovery tests | ||
| //! need that: a stage falls through to its host path only when every device | ||
| //! arm of that stage declines in the same prove. | ||
|
|
||
| use std::sync::atomic::{AtomicI64, Ordering}; | ||
|
|
||
| use crate::Result; | ||
|
|
||
| /// R3 barycentric entries (`barycentric_{base,ext3}_on_device{,_with_dev_inv_denoms}`). | ||
| pub static FAULT_BARYCENTRIC_STICKY: AtomicI64 = AtomicI64::new(-1); | ||
| /// R4 DEEP composition entries (`deep_composition_ext3*`). | ||
| pub static FAULT_DEEP_STICKY: AtomicI64 = AtomicI64::new(-1); | ||
| /// R2 comp-poly tree entries (`build_comp_poly_tree_from_{evals_ext3_keep,slabs_dev}`). | ||
| pub static FAULT_COMP_TREE_STICKY: AtomicI64 = AtomicI64::new(-1); | ||
|
|
||
| /// Countdown check shared by the sticky hooks: negative = disarmed (the | ||
| /// production state); N > 0 counts down across calls and the Nth call — and | ||
| /// every call after it — returns Err (the counter parks at 0); 0 therefore | ||
| /// doubles as the "fired" marker. Disarm by storing -1. | ||
| /// | ||
| /// The transition is a single `fetch_update`, so concurrent table dispatches | ||
| /// (the prover runs a rayon task per table) cannot race the load against the | ||
| /// decrement: each caller walks the counter one step (the closure returns | ||
| /// `None` at `<= 0`, so it parks at 0 and never underflows), which keeps both | ||
| /// the sticky guarantee and the `== 0` fired check sound. The fire decision | ||
| /// reads `fetch_update`'s own result — `Ok(prev)` for the call that | ||
| /// decremented, `Err(cur)` for a no-op — so no second load is needed. | ||
| pub fn check_sticky(counter: &AtomicI64) -> Result<()> { | ||
| // One atomic transition, so concurrent dispatches saturate at 0 rather | ||
| // than underflowing: a decrement only happens from a positive value. | ||
| let fired = counter | ||
| .fetch_update(Ordering::Relaxed, Ordering::Relaxed, |v| match v { | ||
| n if n < 0 => None, // disarmed: never fires | ||
| 0 => None, // already parked: stay fired (sticky) | ||
| _ => Some(v - 1), // count down toward the parked 0 | ||
| }) | ||
| // Ok(prev): this call decremented — the 1 → 0 step fires. | ||
| // Err(cur): no-op — fires only if already parked at 0. | ||
| .map_or_else(|cur| cur == 0, |prev| prev <= 1); | ||
| if fired { | ||
| return Err(cudarc::driver::DriverError( | ||
| cudarc::driver::sys::CUresult::CUDA_ERROR_UNKNOWN, | ||
| )); | ||
| } | ||
| Ok(()) | ||
| } |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.