← Back to Pull requests

`DualPipeV` optimisations #8705

Open
phoeenniixx opened this pull request with 369 lines diff across 6 files
View on GitHub
phoeenniixx phoeenniixx commented on Sep 29, 2026 16:57 UTC
Author

Summary

Follow-up to #8576. This adds two parts of the DualPipe reference that the first DualPipeV PR left out.

Changes

  • Zero bubble: A backward pass can defer its weight gradients. A later weight pass computes them while the rank would otherwise wait for its neighbor. The schedule marks the same backward chunks as the reference, in steps 3, 6 and 7.

  • WeightPass instruction: The weight chunks of the schedule now run the deferred weight gradients. Before, they only committed pending communication.

  • WeightGradStore: Layers opt in through this class, exported from deepspeed.pipe. A layer needs a custom torch.autograd.Function to defer its weight gradient. Other layers behave as before.

  • Freeing sent activations: After a send completes, the engine drops the data of the sent output and keeps its graph.

  • Overlapped forward and backward: DualPipeVModule takes an optional overlapped_forward_backward function. The engine calls it where the schedule runs a forward pass and the backward pass of another micro-batch back to back. Without it the forward pass runs first, as in the reference.
  • Limitations

  • Deferring weight gradients with the BF16 optimizer raises an assertion.

  • A stage must not return a tensor that another op in the same stage also consumed. Freeing that tensor breaks the backward of that op. The reference has the same limit.

  • The loss stage's backward no longer runs under compiled_autograd.

  • An overlapped backward runs inside the forward's autocast context. This is not tested with fp16.
  • Tests

  • test_pipe_schedule.py checks that every WeightPass has a deferred backward to serve. It also checks that none is left at the optimizer step.

  • TestDualPipeV compares loss and weights against the unpartitioned model. It runs with nn.Linear, with a linear layer that defers its weight gradients, and with an overlap function. Each runs with and without activation checkpointing.
  • Diff: 369 lines (+335 / -34) across 6 files Reviewer: phoeenniixx Review duration: 53678m
    All Vouch review confidence checks passed
    Residual risk 0.12 = Change Risk (0.67) × (1 − Review Confidence (0.82)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.67 · 369 lines diff across 6 files
    0.67
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.90 · 5 substantive comment(s)
    0.90
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    81%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.354
    Self Review self_review
    0.140
    Real PR Conversation Timeline
    13 items
    Copilot Copilot commented on code on Sep 29, 2026 17:15 UTC
    Code Review
    docs/_tutorials/pipeline.md:1
    @@ -350,3 +350,35 @@ DualPipeV has the following requirements:
     * Boolean tensors cannot be passed between stages.
     * The `pipe_partitioned` and `grad_partitioned` options for model parallelism
       are not supported.
    +
    +#### Zero bubble
    +DualPipeV can compute weight gradients later than the rest of a backward pass,
    +while a GPU would otherwise wait for its neighbor. A layer opts in from the
    +`backward()` of a custom `torch.autograd.Function`: when
    +`WeightGradStore.enabled` is set, it passes the function that accumulates its
    +weight gradient to `WeightGradStore.put()` instead of calling it.
    +```python
    +from deepspeed.pipe import WeightGradStore
    +
    +class LinearFunc(torch.autograd.Function):
    +    @staticmethod
    +    def forward(ctx, input, weight):
    +        ctx.save_for_backward(input, weight)
    +        return torch.nn.functional.linear(input, weight)
    +
    +    @staticmethod
    +    def backward(ctx, grad_output):
    +        input, weight = ctx.saved_tensors
    +
    +        def grad_weight_fn():
    +            grad = grad_output.flatten(0, -2).T @ input.flatten(0, -2)
    +            weight.grad = grad if weight.grad is None else weight.grad + grad
    +
    +        if WeightGradStore.enabled:
    +            WeightGradStore.put(grad_weight_fn)
    +        else:
    +            grad_weight_fn()
    +        return grad_output @ weight, None
    +```
    +Other layers need no changes. Deferring weight gradients is not supported with
    +the BF16 optimizer.

    Please document the activation-lifetime restriction introduced by this optimization. DualPipeV now clears each sent output's data after communication, so a stage that both returns a tensor and consumes that same tensor in another local operation can produce an incorrect backward pass. Without this warning, the public tutorial presents the feature as generally safe for existing layers even though this valid stage topology is unsupported.

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Sep 29, 2026 17:15 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    Copilot review overview

    🟡 Changes recommended

    The public documentation omits a correctness-critical restriction caused by freeing sent activation data.

    Review effort: Balanced
    Findings: 1 <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.png" alt="Low severity" width="62" height="18" align="texttop"></picture>

    <details open>
    <summary><strong>Open (1)</strong></summary>

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.png" alt="Low severity" width="62" height="18" align="texttop"></picture> [Document DualPipeV activation lifetime restriction](#discussion_r4136291409) · New

  • </details>

    <details>
    <summary><strong>What changed in this PR</strong></summary>

    Adds zero-bubble weight-gradient deferral and activation-memory optimizations to DualPipeV.

    Changes:

  • Adds deferred weight-gradient storage and WeightPass execution.

  • Frees sent activation data after communication.

  • Adds schedule, integration, and documentation updates.
  • | File | Description |
    | ---- | ----------- |
    | deepspeed/​runtime/​pipe/​dualpipev.py | Implements gradient deferral and activation freeing. |
    | deepspeed/​runtime/​pipe/​schedule.py | Adds zero-bubble scheduling and WeightPass. |
    | deepspeed/​pipe/​__init__.py | Exports WeightGradStore. |
    | tests/​unit/​runtime/​pipe/​test_pipe.py | Tests deferred gradients end to end. |
    | tests/​unit/​runtime/​pipe/​test_pipe_schedule.py | Validates deferred-pass scheduling. |
    | docs/​_tutorials/​pipeline.md | Documents zero-bubble layer integration. |
    </details>

    ---

    💡 <a href="/deepspeedai/DeepSpeed/new/master?filename=.github/skills/code-review/SKILL.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add a code-review agent skill</a> or configure MCP servers for context-aware, tailored reviews. <a href="https://docs.github.com/copilot/how-tos/use-copilot-agents/request-a-code-review/use-code-review?tool=webui#mcp-servers-and-agent-skills" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn more in the docs.</a>

    phoeenniixx phoeenniixx commented on Sep 29, 2026 17:17 UTC
    Author

    I still need to add the overlapping forward-backward support. I am working on it - a bit confused how to add that. Will post the issue if I stay stuck for a longer time. Thanks!

    phoeenniixx phoeenniixx commented on code on Sep 29, 2026 17:38 UTC
    Code Review
    docs/_tutorials/pipeline.md:1
    @@ -350,3 +350,35 @@ DualPipeV has the following requirements:
     * Boolean tensors cannot be passed between stages.
     * The `pipe_partitioned` and `grad_partitioned` options for model parallelism
       are not supported.
    +
    +#### Zero bubble
    +DualPipeV can compute weight gradients later than the rest of a backward pass,
    +while a GPU would otherwise wait for its neighbor. A layer opts in from the
    +`backward()` of a custom `torch.autograd.Function`: when
    +`WeightGradStore.enabled` is set, it passes the function that accumulates its
    +weight gradient to `WeightGradStore.put()` instead of calling it.
    +```python
    +from deepspeed.pipe import WeightGradStore
    +
    +class LinearFunc(torch.autograd.Function):
    +    @staticmethod
    +    def forward(ctx, input, weight):
    +        ctx.save_for_backward(input, weight)
    +        return torch.nn.functional.linear(input, weight)
    +
    +    @staticmethod
    +    def backward(ctx, grad_output):
    +        input, weight = ctx.saved_tensors
    +
    +        def grad_weight_fn():
    +            grad = grad_output.flatten(0, -2).T @ input.flatten(0, -2)
    +            weight.grad = grad if weight.grad is None else weight.grad + grad
    +
    +        if WeightGradStore.enabled:
    +            WeightGradStore.put(grad_weight_fn)
    +        else:
    +            grad_weight_fn()
    +        return grad_output @ weight, None
    +```
    +Other layers need no changes. Deferring weight gradients is not supported with
    +the BF16 optimizer.

    will add it in the next commit
    Thanks!

    phoeenniixx phoeenniixx commented on code on Sep 30, 2026 12:27 UTC
    Code Review
    docs/_tutorials/pipeline.md:1
    @@ -350,3 +350,35 @@ DualPipeV has the following requirements:
     * Boolean tensors cannot be passed between stages.
     * The `pipe_partitioned` and `grad_partitioned` options for model parallelism
       are not supported.
    +
    +#### Zero bubble
    +DualPipeV can compute weight gradients later than the rest of a backward pass,
    +while a GPU would otherwise wait for its neighbor. A layer opts in from the
    +`backward()` of a custom `torch.autograd.Function`: when
    +`WeightGradStore.enabled` is set, it passes the function that accumulates its
    +weight gradient to `WeightGradStore.put()` instead of calling it.
    +```python
    +from deepspeed.pipe import WeightGradStore
    +
    +class LinearFunc(torch.autograd.Function):
    +    @staticmethod
    +    def forward(ctx, input, weight):
    +        ctx.save_for_backward(input, weight)
    +        return torch.nn.functional.linear(input, weight)
    +
    +    @staticmethod
    +    def backward(ctx, grad_output):
    +        input, weight = ctx.saved_tensors
    +
    +        def grad_weight_fn():
    +            grad = grad_output.flatten(0, -2).T @ input.flatten(0, -2)
    +            weight.grad = grad if weight.grad is None else weight.grad + grad
    +
    +        if WeightGradStore.enabled:
    +            WeightGradStore.put(grad_weight_fn)
    +        else:
    +            grad_weight_fn()
    +        return grad_output @ weight, None
    +```
    +Other layers need no changes. Deferring weight gradients is not supported with
    +the BF16 optimizer.

    Added in the latest commit. (a warning in docstring and to the docs)

    phoeenniixx phoeenniixx commented on Sep 30, 2026 13:11 UTC
    Author

    Hi @delock @hwchen2017
    The PR is ready for review. Thanks!

    Copilot Copilot commented on code on Sep 30, 2026 16:11 UTC
    Code Review
    docs/_tutorials/pipeline.md:1
    @@ -350,3 +350,71 @@ DualPipeV has the following requirements:
     * Boolean tensors cannot be passed between stages.
     * The `pipe_partitioned` and `grad_partitioned` options for model parallelism
       are not supported.
    +* A stage must not pass a floating point tensor that it returns to another
    +  operation in the same stage. See the warning below.
    +
    +**Warning:** During training, DualPipeV clears the data of a stage's outputs
    +once they are sent to the next GPU. This saves memory, but the backward pass of
    +any operation in the stage that took such an output as its input then computes
    +wrong gradients. No error is raised.
    +{: .notice--warning}
    +
    +```python
    +def forward(self, x):
    +    h = self.block(x)
    +    return h, h * self.scale           # unsupported: h is returned and also used
    +    return h.clone(), h * self.scale   # supported: the copy is cleared, h is kept
    +```
    +Integer tensors, such as token ids, and outputs that are views of another
    +tensor are not cleared.
    +
    +#### Zero bubble
    +DualPipeV can compute weight gradients later than the rest of a backward pass,
    +while a GPU would otherwise wait for its neighbor. A layer opts in from the
    +`backward()` of a custom `torch.autograd.Function`: when
    +`WeightGradStore.enabled` is set, it passes the function that accumulates its
    +weight gradient to `WeightGradStore.put()` instead of calling it.
    +```python
    +from deepspeed.pipe import WeightGradStore
    +
    +class LinearFunc(torch.autograd.Function):
    +    @staticmethod
    +    def forward(ctx, input, weight):
    +        ctx.save_for_backward(input, weight)
    +        return torch.nn.functional.linear(input, weight)
    +
    +    @staticmethod
    +    def backward(ctx, grad_output):
    +        input, weight = ctx.saved_tensors
    +
    +        def grad_weight_fn():
    +            grad = grad_output.flatten(0, -2).T @ input.flatten(0, -2)
    +            weight.grad = grad if weight.grad is None else weight.grad + grad

    This weight-gradient formula fails for a valid 1-D torch.nn.functional.linear input: transposing a 1-D grad_output is a no-op, so the matrix product cannot produce the [out_features, in_features] weight gradient. Reshape both operands to 2-D before multiplying so the public example also handles unbatched inputs.

    Copilot Copilot commented on code on Sep 30, 2026 16:11 UTC
    Code Review
    docs/_tutorials/pipeline.md:1
    @@ -350,3 +350,71 @@ DualPipeV has the following requirements:
     * Boolean tensors cannot be passed between stages.
     * The `pipe_partitioned` and `grad_partitioned` options for model parallelism
       are not supported.
    +* A stage must not pass a floating point tensor that it returns to another
    +  operation in the same stage. See the warning below.
    +
    +**Warning:** During training, DualPipeV clears the data of a stage's outputs
    +once they are sent to the next GPU. This saves memory, but the backward pass of
    +any operation in the stage that took such an output as its input then computes
    +wrong gradients. No error is raised.
    +{: .notice--warning}
    +
    +```python
    +def forward(self, x):
    +    h = self.block(x)
    +    return h, h * self.scale           # unsupported: h is returned and also used
    +    return h.clone(), h * self.scale   # supported: the copy is cleared, h is kept
    +```
    +Integer tensors, such as token ids, and outputs that are views of another
    +tensor are not cleared.
    +
    +#### Zero bubble
    +DualPipeV can compute weight gradients later than the rest of a backward pass,
    +while a GPU would otherwise wait for its neighbor. A layer opts in from the
    +`backward()` of a custom `torch.autograd.Function`: when
    +`WeightGradStore.enabled` is set, it passes the function that accumulates its
    +weight gradient to `WeightGradStore.put()` instead of calling it.
    +```python
    +from deepspeed.pipe import WeightGradStore
    +
    +class LinearFunc(torch.autograd.Function):
    +    @staticmethod
    +    def forward(ctx, input, weight):
    +        ctx.save_for_backward(input, weight)
    +        return torch.nn.functional.linear(input, weight)
    +
    +    @staticmethod
    +    def backward(ctx, grad_output):
    +        input, weight = ctx.saved_tensors
    +
    +        def grad_weight_fn():
    +            grad = grad_output.flatten(0, -2).T @ input.flatten(0, -2)
    +            weight.grad = grad if weight.grad is None else weight.grad + grad
    +
    +        if WeightGradStore.enabled:
    +            WeightGradStore.put(grad_weight_fn)
    +        else:
    +            grad_weight_fn()
    +        return grad_output @ weight, None
    +```
    +Other layers need no changes. Deferring weight gradients is not supported with
    +the BF16 optimizer.
    +
    +#### Overlapping forward and backward
    +In the middle of a batch, a GPU runs the forward pass of one micro-batch and
    +then the backward pass of another. Pass a function as
    +`overlapped_forward_backward` to overlap the two. Without it, the forward pass
    +runs first and the backward pass second.
    +```python
    +def overlap(forward, inputs, backward, tensors, grad_tensors):
    +    outputs = forward(inputs)
    +    backward(tensors, grad_tensors)
    +    return outputs

    This callback executes the complete forward pass before starting backward, exactly matching the no-callback fallback, so it demonstrates no overlap and provides no optimization. Please show forward work split around the backward(...) call (or explicitly label this as an interface-only scaffold) so users can implement the feature described by this section.

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Sep 30, 2026 16:11 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    Copilot review overview

    🟡 Changes recommended

    The public examples contain an invalid unbatched gradient formula and demonstrate no actual forward/backward overlap.

    Review effort: Balanced
    Findings: 2 <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.png" alt="Low severity" width="62" height="18" align="texttop"></picture>

    <details open>
    <summary><strong>Open (2)</strong></summary>

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.png" alt="Low severity" width="62" height="18" align="texttop"></picture> [Weight gradient fails for unbatched 1-D linear inputs](#discussion_r4146753245) · New

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.png" alt="Low severity" width="62" height="18" align="texttop"></picture> [Callback example performs no forward/backward overlap](#discussion_r4146753312) · New

  • </details>

    <details>
    <summary><strong>Resolved since last review (1)</strong></summary>

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.png" alt="Low severity" width="62" height="18" align="texttop"></picture> [Document DualPipeV activation lifetime restriction](#discussion_r4136291409)

  • </details>

    phoeenniixx phoeenniixx commented on Oct 01, 2026 20:04 UTC
    Author

    Hi @hwchen2017, I have addressed the copliot reviews. Thanks!

    PKUWZP PKUWZP commented on Oct 01, 2026 21:19 UTC
    Contributor

    @phoeenniixx Thanks for the PR. Can you explain what's the motivation of submitting this PR given that PyTorch has natively support DualPipeV: https://docs.pytorch.org/docs/2.14/distributed.pipelining.html, also do you have any benchmarking results on modeling training here as well?

    phoeenniixx phoeenniixx commented on Oct 02, 2026 07:59 UTC
    Author

    Thanks for the comment @PKUWZP! TBH i didnt know torch has also released its pp version! Thanks for sharing it.

    DualPipeV was added from this issue: #7100
    Also, this PR is made to setup for Bidirectional DualPipe which i think is not present in torch. DeepSeek's DualPipe uses the same zero-bubble and overlapped forward/backward pieces this PR adds.

    Also, I think we cannot use torch implementation our of the box in deepspeed, we would need to actually create a wrapper around it. Otherwise the user would have to go down a layer (from deepspeed to torch) to use this. Also:

  • PyTorch's pipelining sends tensors with torch.distributed directly (stage.py), so pipeline traffic would bypass deepspeed.comm and its communication logging. We would have to monkeypatch torch to handle this (or some better way?). The current implementation sends through deepspeed.comm.

  • https://docs.pytorch.org/docs/2.14/distributed.pipelining.html says it is in alpha and the API may change - which i think is dangerous to have unstable API in our codebase.
  • Please let me know what your preference here - keeping the current implementation, a new torch wrapper or should we drop the idea of having DualpipeV at all (This would mean reverting #8576). Happy to do whatever you prefer.
    Thanks!

    ---
    Regarding benchmarks, I actually didnt have much compute, so tried the benchmarks on 2 T4s from kaggle (notebook). Though having just 2 ranks i think are not enough for for a meaningful comparison. The results:

    ranks=2 micro_batches=8 micro_batch_size=4 seq=256 hidden=512 heads=8 blocks=8 dtype=fp32 zero=0 measured steps=10 torch=2.10.0+cu128 device=cuda
    

    | schedule | step time (s) | samples/s | vs 1F1B | peak mem rank 0 (MB) | peak mem rank 1 (MB) | final loss | max loss diff vs first |
    |---|---|---|---|---|---|---|---|
    | 1F1B | 0.214 | 149.2 | 1.00x | 402 | 294 | 2.373949 | 0.00e+00 |
    | DualPipeV | 0.212 | 151.2 | 1.01x | 469 | 458 | 2.373949 | 2.38e-07 |
    | DualPipeV + zero bubble | 0.208 | 154.2 | 1.03x | 469 | 461 | 2.373949 | 2.38e-07 |
    | torch DualPipeV | 0.207 | 154.9 | 1.04x | 531 | 531 | 2.373949 | 2.38e-07 |
    ranks=2 micro_batches=8 micro_batch_size=4 seq=256 hidden=512 heads=8 blocks=8 dtype=fp16 zero=1 measured steps=10 torch=2.10.0+cu128 device=cuda
    

    | schedule | step time (s) | samples/s | vs 1F1B | peak mem rank 0 (MB) | peak mem rank 1 (MB) | final loss | max loss diff vs first |
    |---|---|---|---|---|---|---|---|
    | 1F1B | 0.094 | 341.6 | 1.00x | 362 | 323 | 2.378906 | 0.00e+00 |
    | DualPipeV | 0.094 | 342.1 | 1.00x | 388 | 381 | 2.378906 | 0.00e+00 |
    | DualPipeV + zero bubble | 0.109 | 292.7 | 0.86x | 388 | 385 | 2.378906 | 0.00e+00 |
    | torch DualPipeV | 0.094 | 340.4 | 1.00x | 421 | 421 | 2.377197 | 1.71e-03 |
    ranks=2 micro_batches=16 micro_batch_size=4 seq=256 hidden=512 heads=8 blocks=8 dtype=fp32 zero=0 measured steps=10 torch=2.10.0+cu128 device=cuda
    

    | schedule | step time (s) | samples/s | vs 1F1B | peak mem rank 0 (MB) | peak mem rank 1 (MB) | final loss | max loss diff vs first |
    |---|---|---|---|---|---|---|---|
    | 1F1B | 0.422 | 151.5 | 1.00x | 400 | 310 | 2.372787 | 0.00e+00 |
    | DualPipeV | 0.424 | 150.9 | 1.00x | 486 | 458 | 2.372787 | 2.38e-07 |
    | DualPipeV + zero bubble | 0.423 | 151.3 | 1.00x | 489 | 462 | 2.372787 | 4.77e-07 |
    | torch DualPipeV | 0.425 | 150.7 | 0.99x | 628 | 631 | 2.372787 | 4.77e-07 |

    Reviewers
    Assignees
    phoeenniixx phoeenniixx
    Labels
    risk: low confidence: 81.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 66.7% (HIGH) · Higher = larger blast radius
    66.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 81.7% · Lower = rushed or shallow review
    81.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 12.2% · Safe to merge
    12.2%