---
name: ad-conf-check-bbb9536b636b
description: >
  Check whether AutoDeploy YAML configs were actually applied by analyzing server logs
  and optionally graph dumps (AD_DUMP_GRAPHS_DIR). Use when the user wants to verify
  config application, debug config issues, or check if AutoDeploy transforms (piecewise
  CUDA graph, multi-stream, sharding, fusion, etc.) were applied or fell back. Triggers
  on: "check config", "verify config", "ad-conf-check", "were my configs applied",
  "config not working", "check if piecewise is enabled", "check log for config", or any
  request to compare AD YAML settings against runtime behavior.
license: Apache-2.0
metadata:
  author: NVIDIA Corporation
---

# AutoDeploy Config Checker

Verify that AutoDeploy YAML configs were applied at runtime by cross-referencing with server logs and optionally graph dumps.

## Input

- **TensorRT-LLM source directory** (required) — path to the TensorRT-LLM repo root. Used to read the latest `default.yaml` and source code for up-to-date log patterns (the bundled reference doc may be stale).
- **YAML config file path(s)** (required) — one or more AutoDeploy YAML configs. When multiple files are provided, they are deep-merged left-to-right (later files override earlier ones for overlapping keys).
- **Server log file path** (required) — log output from the AutoDeploy server run.
- **Graph dump directory** (optional) — `AD_DUMP_GRAPHS_DIR` output directory containing per-transform graph snapshots (`NNN_stage_transform.txt`). Provides additional evidence for resolving UNKNOWN results.
- **Nsys trace file** (optional) — Nsight Systems profile (`.nsys-rep` or `.sqlite`) from the server run. Useful for verifying executor-level configs that produce no log output (e.g., `enable_chunked_prefill`, multi-stream concurrency, CUDA graph capture/replay).
- **Table output file path** (optional) — path to write human-friendly table results.
- **JSON output file path** (optional) — path to write machine-friendly JSON results.

## Output

### Human-friendly table (always presented to user)
- **Verification table** — one row per config key with columns: **Config** (key=value), **Result** (APPLIED / FAILED / SKIPPED / DISABLED / UNKNOWN), **Evidence** (log line or graph analysis proving the result).
- **Summary line** — total counts per status (e.g., `Total configs checked: 29 | APPLIED: 23 | UNKNOWN: 4 | ...`).
- **FAILED/WARNING details** — expanded information for any configs that failed or had warnings.

### Machine-friendly JSON (when JSON output path is given)
JSON file with two top-level keys:
- **`results`** — array of objects, each with `config`, `value`, `status`, `evidence`.
- **`summary`** — object with `total` (int) and `counts` (object mapping status to count, only non-zero statuses included).

## Workflow

1. **[Collect Inputs]** Ask the user for the following inputs:
   - **TensorRT-LLM source directory** (required) — path to the TensorRT-LLM repo root. Used to cross-check `default.yaml` and source code for the latest log patterns.
   - **YAML config file path(s)** (required) — one or more AutoDeploy configs used for the run. When multiple YAMLs are provided, they are deep-merged left-to-right: **later files override earlier ones** for overlapping keys. Tell the user: *"If you have multiple configs (e.g., a default config and a user override), list them in priority order — lowest priority first, highest priority last."*
   - **Server log file path** (required) — the log output from the server
   - **Graph dump directory** (optional but recommended) — the `AD_DUMP_GRAPHS_DIR` output directory containing per-transform graph snapshots. Files are named `NNN_stage_transform.txt` and show the graph AFTER each transform. When provided, graph analysis provides additional evidence (e.g., verifying sharded weights, collective ops, fused ops). This is especially useful for resolving UNKNOWN results.
   - **Nsys trace file** (optional) — Nsight Systems profile (`.nsys-rep` or `.sqlite`) from the server run. Useful for verifying executor-level configs that produce no log output (e.g., `enable_chunked_prefill`, multi-stream concurrency, CUDA graph capture/replay).
   - TensorRT-LLM source reference paths:
     - Example configs: `<trtllm_src>/examples/auto_deploy/model_registry/configs/*.yaml`
     - Default transform config (all available transforms and their defaults): `<trtllm_src>/tensorrt_llm/_torch/auto_deploy/config/default.yaml`

2. **[Update Reference Doc]** Before checking configs, ensure the bundled reference doc is up-to-date with the TensorRT-LLM source.

   Launch the `ad-conf-check-update` agent with:
   - `<trtllm_src>` — the TensorRT-LLM source directory from step 1
   - `<skill_dir>` — the directory containing this SKILL.md file

   The agent compares `<trtllm_src>/tensorrt_llm/_torch/auto_deploy/config/default.yaml` and the AutoDeploy source code against `<skill_dir>/references/config_log_patterns.md`. If any configs were added, removed, renamed, or if log patterns have changed, the agent updates the reference doc in-place and reports what changed.

   **After the agent completes:**
   - If the reference doc was updated, inform the user: *"Updated references/config_log_patterns.md to match the latest TensorRT-LLM source — see the agent's change summary below."* Then show the agent's summary.
   - If no changes were needed, briefly note: *"Reference doc is up-to-date with the TensorRT-LLM source."*

3. **[Parse Configs]** Run the parser script to flatten the YAML configs (`<skill_dir>` is the directory containing this SKILL.md file):

   **Input:** The TensorRT-LLM `default.yaml` as the base, followed by the user's YAML config path(s) from step 1. Always include `default.yaml` first so that user configs override the defaults.

   ```bash
   python3 <skill_dir>/scripts/parse_config.py <trtllm_src>/tensorrt_llm/_torch/auto_deploy/config/default.yaml <yaml_path1> [<yaml_path2> ...]
   ```
   This deep-merges the YAML files left-to-right (later files override earlier ones) and flattens nested keys into dotted notation (e.g., `kv_cache_config.enable_block_reuse`). By including `default.yaml` first, every known config key appears in the output even if the user only overrode a subset.

   **Output:** Flat JSON with all config `{key, value}` pairs. Example:
   ```json
   {
     "yaml_files": ["default.yaml", "user_override.yaml"],
     "total_configs": 15,
     "configs": [
       {"key": "compile_backend", "value": "torch-cudagraph"},
       {"key": "kv_cache_config.free_gpu_memory_fraction", "value": "0.85"},
       {"key": "transforms.compile_model.piecewise_enabled", "value": "True"}
     ]
   }
   ```

4. **[Quick Scan]** Check each config against the server log using parallel agents.

   **Input:** Config list from step 3, server log path from step 1, and [references/config_log_patterns.md](references/config_log_patterns.md).

   Split the configs from step 3 into 3 groups by section and launch 3 agents **in parallel**, each checking its group:

   | Agent | Config group | Keys starting with | Reference section |
   |-------|-------------|-------------------|-------------------|
   | Agent 1 | Top-level configs | `runtime`, `compile_backend`, `attn_backend`, `max_seq_len`, `max_num_tokens`, `max_batch_size`, `cuda_graph_batch_sizes`, `enable_chunked_prefill`, `model_factory`, `dtype`, etc. | "Top-Level Config Parameters" |
   | Agent 2 | KV cache configs | `kv_cache_config.*` | "kv_cache_config Parameters" |
   | Agent 3 | Transform configs | `transforms.*` (or any key matching a transform name like `compile_model`, `detect_sharding`, `multi_stream_*`, `fuse_*`, `gather_logits_*`, etc.) | "Transform Parameters" |

   Each agent receives:
   - Its subset of `{key, value}` pairs
   - The server log file path
   - The reference doc [references/config_log_patterns.md](references/config_log_patterns.md) (including verification source tags: `[log]`, `[graph]`, `[nsys]`)
   - The nsys trace file path (if provided)

   Each agent, for every config in its group:
   1. Reads the reference doc to find the relevant keywords and patterns for this config key.
   2. Greps the server log for those patterns. Key search strategies:
      - For transform configs: grep for `[stage=..., transform=<name>]` and check the `[SUMMARY]` line (`matches=N` → APPLIED if N>0, SKIPPED if N=0).
      - For configs with success/failure indicators: grep for those specific strings.
      - For configs with no known log pattern: grep for `key=value` or the key name near the value.
      - For configs with `enabled: false`: mark as DISABLED without log search.
   3. Assigns a status based on what was found:
      - **APPLIED** — log confirms the config took effect
      - **FAILED** — log shows the config was attempted but fell back or errored
      - **SKIPPED** — transform ran but found nothing to do (0 matches)
      - **DISABLED** — config explicitly set `enabled: false`
      - **UNKNOWN** — no log evidence found (config may still be active but unlogged)
   4. Records the evidence (the matching log line or lack thereof).

   **Output:** Each agent returns a list of `{config, value, status, evidence}` entries for its group. Merge all 3 lists into the combined result.

5. **[Double Check]** For any UNKNOWN entries from step 4, investigate further **before** presenting results to the user (FAILED entries already have concrete log evidence and do not need double-checking):

   **Input:** List of UNKNOWN config entries from step 4 output, the server log file, and [references/config_log_patterns.md](references/config_log_patterns.md).

   - Re-read [references/config_log_patterns.md](references/config_log_patterns.md) for alternative patterns
   - Grep the log more broadly for the transform name: `[stage=..., transform=<name>]`
   - Look for `[APPLY]` prefixed lines and `[SUMMARY]` lines for that transform
   - Check for `"Falling back"`, `"Skipping"`, or `"failed"` near the transform logs
   - If graph dump directory was provided:
     - Graph files are named `NNN_stage_transform.txt` — each contains the FX graph AFTER that transform. Compare before/after by reading consecutive files.
     - Graph evidence can upgrade UNKNOWN to APPLIED (e.g., collective ops after lm_head confirm sharding, fused custom ops confirm fusion transforms).
     - Graph analysis verifies: sharding (collective ops, weight shape changes), attention backend (op types), MoE fusion (fused op presence), GEMM fusion (linear op count changes), RMSNorm/SwiGLU/RoPE pattern matching (custom op presence).
     - See [references/graph_verification_patterns.md](references/graph_verification_patterns.md) for the full list of graph-based checks.
   - If nsys trace was provided, check for executor-level configs tagged `[nsys]` in the reference doc (e.g., `enable_chunked_prefill`, `enable_block_reuse`, multi-stream concurrency, CUDA graph capture/replay)

   **Output:** For each investigated UNKNOWN entry, either additional evidence found (with status upgrade) or confirmation that the config is genuinely unlogged.

6. **[Report]** Present the final results to the user.

   **ALWAYS show the full detailed table.** Do NOT summarize or condense. Present one row per config with columns:
   - **Config** — the config key and its value (e.g., `compile_backend = torch-cudagraph`)
   - **Result** — one of: APPLIED, FAILED, SKIPPED, DISABLED, UNKNOWN
   - **Evidence** — the log line or pattern that proves the result

   After the table, show the summary line (e.g., `Total configs checked: 29 | APPLIED: 23 | ...`) and any FAILED/WARNING details. Include any additional findings from the Double Check step (step 5).

   If the user requested output files, write:
   - **Table output** — the human-friendly table as plain text
   - **JSON output** — machine-friendly JSON with `results` array and `summary` object

## Key Patterns to Know

- Every transform logs: `[stage=<stage>, transform=<name>] [SUMMARY] matches=N | time: ...`
- Piecewise success chain: `dual-mode enabled` -> `prepared with N submodules` -> `captured graphs`
- Piecewise failure: `"model is not a GraphModule...Falling back to eager execution"`
- Sharding: `"Using allreduce strategy: SYMM_MEM"`, `"Applied N TP shards from config"`

## Gotchas

- **Every YAML key must appear in the output.** Check all configs from the YAML, not just ones with known patterns. If a config key has no entry in the reference doc, grep the log for the key name and value. New/unknown configs should still be reported — never silently skip them.
- **UNKNOWN does not mean the config was ignored.** Some configs (e.g., `enable_chunked_prefill`, `enable_block_reuse`) are consumed at executor/runtime level and produce no log output. UNKNOWN means "no log evidence found", not "config was not applied".
- **Deprecated config names may cause FAILED.** For example, `torch_dtype` is deprecated in favor of `dtype`, and `cuda_graph_batch_sizes` (top-level) is replaced by `cuda_graph_config.batch_sizes`. Look for deprecation warning messages in the log. Old keys may be silently ignored.
- **Runtime may adjust configured values.** For example, `max_seq_len` may be configured as 262144 but adjusted down to 16384 at runtime due to memory constraints. Report this as APPLIED with a WARNING annotation.
- **ANSI color codes in logs.** AutoDeploy uses colored log output. Strip or ignore ANSI escape sequences when matching patterns.
- **Reference doc is auto-updated.** Step 2 runs the `ad-conf-check-update` agent to sync [references/config_log_patterns.md](references/config_log_patterns.md) with the latest TensorRT-LLM source before any config checking begins. If the agent reports changes, review its summary to understand what shifted.


---
Source attribution: yo-steven
Original project: https://github.com/yo-steven/skills-exploration-20260522/blob/6e1127ffb7690aa8038b172d0ae7cc720754870d/skills/TensorRT-LLM/ad-conf-check/SKILL.md
License: Apache-2.0
License information: https://www.apache.org/licenses/LICENSE-2.0
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

SPDX-License-Identifier: Apache-2.0 AND CC-BY-4.0

Copyright (c) 2026 NVIDIA Corporation

This project is licensed under a dual license:
- Apache License 2.0 (for code and configuration)
- Creative Commons Attribution 4.0 International (CC BY 4.0) (for documentation)

You may use the contents of this repository under the terms of either license,
or both, as applicable to the type of content.

================================================================================
                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to the Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by the Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding any notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

================================================================================
              Creative Commons Attribution 4.0 International License
                              (CC BY 4.0)

                https://creativecommons.org/licenses/by/4.0/

You are free to:

  Share — copy and redistribute the material in any medium or format for any
  purpose, even commercially.

  Adapt — remix, transform, and build upon the material for any purpose, even
  commercially.

  The licensor cannot revoke these freedoms as long as you follow the license
  terms.

Under the following terms:

  Attribution — You must give appropriate credit, provide a link to the license,
  and indicate if changes were made. You may do so in any reasonable manner, but
  not in any way that suggests the licensor endorses you or your use.

  No additional restrictions — You may not apply legal terms or technological
  measures that legally restrict others from doing anything the license permits.

Notices:

  You do not have to comply with the license for elements of the material in the
  public domain or where your use is permitted by an applicable exception or
  limitation.

  No warranties are given. The license may not give you all of the permissions
  necessary for your intended use. For example, other rights such as publicity,
  privacy, or moral rights may limit how you use the material.

For the full legal text, see:
https://creativecommons.org/licenses/by/4.0/legalcode



# Mega AI Hub resource metadata

Creator / publisher: yo-steven
Original project: https://github.com/yo-steven/skills-exploration-20260522/blob/6e1127ffb7690aa8038b172d0ae7cc720754870d/skills/TensorRT-LLM/ad-conf-check/SKILL.md
Attribution basis: Source repository record

Fields of work: Development & Engineering
Roles: Backend Developer, Data Engineer, ML / AI Engineer
Specialties: API, Backend
Tools: Nsight Systems, Tensorrt Llm
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 5a9b2749fb54a454d9f8de29470fb38302d7a585be0e8c1a60b88468bb15ecf1
