Skip to content

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

Draft
Gasoonjia wants to merge 1 commit into
gasoonjia/fix-dflash-final-block-testfrom
gasoonjia/cuda-quiet-offgraph-kv-warnings
Draft

Gasoonjia wants to merge 1 commit into
gasoonjia/fix-dflash-final-block-testfrom
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.

❌ 1 New Failure, 8 Pending

As of commit 64ca607 with merge base 8d9eec3 (image):

NEW FAILURE - The following job has failed:

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)

…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/fix-dflash-final-block-test branch from caf7d3a to 6e13047 Compare October 21, 2026 17:25
@Gasoonjia
Gasoonjia force-pushed the gasoonjia/cuda-quiet-offgraph-kv-warnings branch from c4a4471 to 64ca607 Compare October 21, 2026 17:25

This branch was successfully deployed

1 active deployment
cadence — 64ca6079 Deployed Oct 21, 2026 by Gasoonjia via hifi-op-test / hifi4 #34290
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.

1 participant