Skip to content

Verify Level-2 workspace reservations - #32189

Draft
Chi Lo (chilo-ms) wants to merge 1 commit into
chilo/workspace-estimation-loggingfrom
chilo/level2-workspace-verification
Draft

Verify Level-2 workspace reservations#32189
Chi Lo (chilo-ms) wants to merge 1 commit into
chilo/workspace-estimation-loggingfrom
chilo/level2-workspace-verification

Conversation

@chilo-ms

@chilo-ms Chi Lo (chilo-ms) commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

PR stack

  1. Add workspace estimation accounting and reporting #31962 - Level-1 workspace estimation and reporting
  2. Verify Level-2 workspace reservations #32189 - Level-2 reservation verification
  3. Integrate CUDA workspace with activation memory patterns #32071 - activation-aware CUDA workspace preallocation

This is the middle PR. Please review it relative to chilo/workspace-estimation-logging; it contains one stack-specific commit.

Summary

  • retain accepted per-node workspace reservations after graph partitioning;
  • compare post-kernel-creation Level-2 declarations with the reservation used by partitioning;
  • report larger, equal, smaller, missing-declaration, and missing-reservation counts and bytes;
  • warn by default when Level 2 exceeds the reservation;
  • optionally fail session initialization with session.strict_workspace_verification=1.

Scope

This PR verifies the partitioning contract after kernels are created and prepacked. It does not repartition the graph or change runtime workspace allocation. Static preallocation is the next PR in the stack (#32071).

Validation

  • onnxruntime_test_all Debug build passed.
  • ResourceAccountantTest.* and RealAccountantTest.*: 18 tests passed.

Persist accepted per-node workspace reservations through partitioning and compare them with kernel declarations during session finalization. Add an opt-in strict mode for constrained deployments.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: cdd38fe6-fcf3-45c2-acea-b8e6206a7839
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant