Add logging knob to control console output#44
Merged
erwei-xilinx merged 5 commits intomainfrom Apr 11, 2026
Merged
Conversation
Addresses #40 — compilation messages (cache hits, tiling script paths, compile-only output) now use Python's logging module instead of print(). By default the logger is set to WARNING (silent on success). Set AMD_TRITON_NPU_DEBUG=1 to restore verbose output at DEBUG level. Autotuning prints remain gated by knobs.autotuning.print. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR replaces several print() statements in the NPU backend driver with Python logging, introducing an AMD_TRITON_NPU_DEBUG environment variable intended to control whether compilation/cache-related messages appear on the console.
Changes:
- Added a module logger and an
AMD_TRITON_NPU_DEBUG-controlled logging setup. - Converted selected compilation/cache/tiling-script console prints to
logger.info(...). - Converted device-detection error prints to
logger.warning(...).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ects - Set logger default to WARNING so info/debug messages stay suppressed even when the embedding app configures root logger to INFO - Replace logging.basicConfig() with a module-local StreamHandler using a message-only formatter to avoid global side effects - Set logger.propagate = False to isolate from app logging config - Change all logger.info() to logger.debug() since these are verbose debug messages, not standard informational output Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ypapadop-amd
suggested changes
Apr 10, 2026
4 tasks
… failures - Default log level → CRITICAL per reviewer request (suppress all non-critical) - xrt-smi CalledProcessError → logger.error (was warning) - Unexpected Exception → logger.exception (includes traceback) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
erwei-xilinx
added a commit
that referenced
this pull request
Apr 11, 2026
- Treat None as "unset" in air_project_path setter (reverts to env var / default instead of crashing with Path(None)) - Use __dict__.copy() in config_context() so new fields are automatically saved/restored - Mention both config property and env var in error messages for output_format and transform_tiling_script - Incorporate PR #44 logging changes (rebase on top of feature/logging-knob-issue-40) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
erwei-xilinx
added a commit
that referenced
this pull request
Apr 11, 2026
- Treat None as "unset" in air_project_path setter (reverts to env var / default instead of crashing with Path(None)) - Use __dict__.copy() in config_context() so new fields are automatically saved/restored - Mention both config property and env var in error messages for output_format and transform_tiling_script - Incorporate PR #44 logging changes (rebase on top of feature/logging-knob-issue-40) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
erwei-xilinx
added a commit
that referenced
this pull request
Apr 11, 2026
- Treat None as "unset" in air_project_path setter (reverts to env var / default instead of crashing with Path(None)) - Use __dict__.copy() in config_context() so new fields are automatically saved/restored - Mention both config property and env var in error messages for output_format and transform_tiling_script - Incorporate PR #44 logging changes (rebase on top of feature/logging-knob-issue-40) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
print()calls indriver.pywith Python'sloggingmodule, controlled by a newAMD_TRITON_NPU_DEBUGenvironment variable0), only warnings are shown — no compilation messages clutter stdout during normal runsAMD_TRITON_NPU_DEBUG=1to restore verbose output (cache hits, tiling script paths, compile-only mode details)knobs.autotuning.printand are unaffectedCloses #40
Test plan
AMD_TRITON_NPU_DEBUG— verify no compilation prints on stdoutAMD_TRITON_NPU_DEBUG=1— verify same output as before this changeAMD_TRITON_NPU_COMPILE_ONLY=1+AMD_TRITON_NPU_DEBUG=1— verify compile-only messages appearAMD_TRITON_NPU_DEBUG=1— verify cache hit message appearsknobs.autotuning.print🤖 Generated with Claude Code