Skip to content

[executorch][cuda] Check FQN weight coverage without AOTI's per-buffer warnings - #24052

Merged
Gasoonjia merged 1 commit into
mainfrom
gasoonjia/cuda-quiet-offgraph-kv-warnings
Oct 22, 2026
Merged

Gasoonjia merged 1 commit into
mainfrom
gasoonjia/cuda-quiet-offgraph-kv-warnings

Conversation

@Gasoonjia

Copy link
Copy Markdown
Contributor

Stacked on #24050.

Every CUDA method load that binds FQN weights next to an off-graph KV cache printed one AOTI warning line per KV buffer:

[WARNING] Found constant or module state buffer or empty module state parameter __et_offgraph_kv_layer_0_k in model, but not provided by user!

The unittest-cuda-muse-glimmer-batching log contains 1672 of these lines, out of 11650 lines total.

Why it happens. CudaWeightCache::load binds the weights with validate_full_update=true and intentionally leaves the off-graph KV buffers unbound, because the KV pool binds them later. AOTI's full-update check (assert_all_constants) allows absent buffers, but it writes a warning to stderr for each absent buffer on every load.

Fix.

  • When the AOTI library exports AOTInductorModelContainerGetConstantType and AOTInductorModelContainerGetConstantFromFolded, ExecuTorch runs the same completeness rule itself. Folded constants, buffers, tensor constants, and empty parameters may be absent. Every other constant must be bound, otherwise load fails with InvalidProgram.
  • Binding then runs with validate_full_update=false. In AOTI that flag only gates assert_all_constants, so nothing else about binding changes.
  • If the library does not export those two APIs, load keeps validate_full_update=true as before.

Test plan:

  • g++ -fsyntax-only on cuda_weight_cache.cpp and cuda_backend.cpp against the CUDA 12.6 headers.
  • CI: the CUDA unittest jobs and the muse-glimmer batching job should pass, and their logs should no longer contain the __et_offgraph_kv_ warnings.

@pytorch-bot

pytorch-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/24052

Note: Links to docs will display an error until the docs builds have been completed.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 21, 2026
@linux-foundation-easycla

linux-foundation-easycla Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: Gasoonjia / name: gasoonjia (64ca607)

@Gasoonjia
Gasoonjia force-pushed the gasoonjia/cuda-quiet-offgraph-kv-warnings branch from c4a4471 to 64ca607 Compare October 21, 2026 17:25
@Gasoonjia
Gasoonjia marked this pull request as ready for review October 22, 2026 07:28
@Gasoonjia
Gasoonjia added this pull request to stack #24077 October 22, 2026 07:28
@Gasoonjia
Gasoonjia deployed to upload-benchmark-results October 22, 2026 13:18 — with GitHub Actions Active
@Gasoonjia
Gasoonjia force-pushed the gasoonjia/cuda-quiet-offgraph-kv-warnings branch from 64ca607 to 14d0ef0 Compare October 22, 2026 17:55
@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@Gasoonjia
Gasoonjia force-pushed the gasoonjia/cuda-quiet-offgraph-kv-warnings branch from 14d0ef0 to 9ffe236 Compare October 22, 2026 21:07
Base automatically changed from gasoonjia/fix-dflash-final-block-test to main October 22, 2026 21:10
…r warnings

Every CUDA method load that binds FQN weights next to an off-graph KV
cache printed one AOTI line per KV buffer, e.g.

  [WARNING] Found constant or module state buffer or empty module state
  parameter __et_offgraph_kv_layer_0_k in model, but not provided by user!

The muse-glimmer batching CI log had 1672 of these lines out of 11650.

CudaWeightCache::load binds weights with validate_full_update=true while
it deliberately leaves the off-graph KV buffers unbound; the KV pool binds
them later. AOTI's full update allows absent buffers but writes this
warning to stderr for each one, on every load.

When the AOTI library exports GetConstantType and GetConstantFromFolded,
do the same completeness check ExecuTorch-side: folded constants,
buffers, tensor constants and empty parameters may be absent, every
other constant must be bound, else InvalidProgram. Then bind with
validate_full_update=false. validate_full_update only gates that check
in AOTI, so binding is otherwise unchanged. Libraries without the two
APIs keep validate_full_update=true.

Test plan:
- g++ -fsyntax-only on cuda_weight_cache.cpp and cuda_backend.cpp
  against the CUDA 12.6 headers.
- CI: CUDA unittest and muse-glimmer batching jobs pass, and their logs
  no longer contain the __et_offgraph_kv_ warnings.
@Gasoonjia
Gasoonjia force-pushed the gasoonjia/cuda-quiet-offgraph-kv-warnings branch from 9ffe236 to d6d412b Compare October 22, 2026 21:10
@Gasoonjia
Gasoonjia merged commit 71a713c into main Oct 22, 2026
267 of 270 checks passed
@Gasoonjia
Gasoonjia deleted the gasoonjia/cuda-quiet-offgraph-kv-warnings branch October 22, 2026 21:15
@Gasoonjia
Gasoonjia deployed to upload-benchmark-results October 23, 2026 03:17 — with GitHub Actions Active

This branch was successfully deployed

1 active and 1 inactive deployments
upload-benchmark-results — d6d412b9 Deployed Oct 23, 2026 by Gasoonjia via upload-benchmark-results #21220
cadence — d6d412b9 Deployed Oct 22, 2026 by Gasoonjia via hifi-op-test / hifi4 #34409
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants