Skip to content

Add workspace estimation accounting and reporting - #31962

Draft
Chi Lo (chilo-ms) wants to merge 6 commits into
mainfrom
chilo/workspace-estimation-logging
Draft

Add workspace estimation accounting and reporting#31962
Chi Lo (chilo-ms) wants to merge 6 commits into
mainfrom
chilo/workspace-estimation-logging

Conversation

@chilo-ms

Copy link
Copy Markdown
Contributor

Description

Adds workspace-memory accounting and reporting for resource-constrained graph partitioning.

  • tracks pending workspace during GetCapability and commits it only for accepted nodes
  • preserves correct accounting across the two-pass NHWC layout transformation flow
  • combines workspace sources using the policy: profile only, estimator only, max(profile, estimator) when both exist, and fallback when neither is available
  • applies the Level-1 MatMulNBits workspace estimator before CUDA budget decisions
  • reports non-workspace, workspace, total estimated memory, and accepted-node source counts after partitioning
  • reports Level-2 per-node and aggregate declared workspace during session initialization
  • renames the internal implementation to SizeBasedResourceAccountant to reflect that it handles profile, fallback, and operator-estimated costs

Related to #29775.

Testing

Added resource-accountant and two-pass partitioning unit coverage. Tests were not run for this update.

Chi Lo (chilo-ms) and others added 4 commits August 10, 2026 10:30
Move workspace reporting out of GetCapabilityForEP and into the completed
GraphPartitioner::Partition boundary. Track workspace estimates as pending during
capability probing and commit them only for nodes that ORT actually assigns.

Replace the generic safety-margin workspace with the MatMulNBits Level-1
estimate before CUDA's budget decision. Preserve workspace estimates across the
layout-transformation deferred-commit path, and report non-workspace, workspace,
and total estimated memory once per resource-accounted EP.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: cdd38fe6-fcf3-45c2-acea-b8e6206a7839
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: cdd38fe6-fcf3-45c2-acea-b8e6206a7839
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: cdd38fe6-fcf3-45c2-acea-b8e6206a7839
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: cdd38fe6-fcf3-45c2-acea-b8e6206a7839
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: cdd38fe6-fcf3-45c2-acea-b8e6206a7839
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