Skip to content

Verbose log transform passes#294

Merged
take-cheeze merged 1 commit intoonnx:mainfrom
take-cheeze:log-pass-verbose
Mar 22, 2026
Merged

Verbose log transform passes#294
take-cheeze merged 1 commit intoonnx:mainfrom
take-cheeze:log-pass-verbose

Conversation

@take-cheeze
Copy link
Copy Markdown
Member

@take-cheeze take-cheeze commented Feb 26, 2026

For debugging with environment variable like LOG_THRESHOLD=-1

Signed-off-by: take-cheeze <takechi101010@gmail.com>
@take-cheeze take-cheeze requested review from a team as code owners February 26, 2026 12:12
@sonarqubecloud
Copy link
Copy Markdown

@justinchuby justinchuby requested a review from Copilot March 22, 2026 04:54
@take-cheeze take-cheeze merged commit dcbc15e into onnx:main Mar 22, 2026
26 checks passed
@take-cheeze take-cheeze deleted the log-pass-verbose branch March 22, 2026 04:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds verbose per-pass transform logging in the optimizer fixed-point pass manager to aid debugging when lowering the LOG_THRESHOLD (e.g., LOG_THRESHOLD=-1).

Changes:

  • Include onnxoptimizer/passes/logging.h in the pass manager implementation.
  • Emit VLOG(1) messages when a pass reports non-zero num_positive_transforms, including within fixed-point reruns.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +41 to +48
VLOG(1) << "Pass " << pass->getPassName() << " transformed " << count_analysis->num_positive_transforms;
}

while (count_analysis->fixedPointOptimizationNeeded()) {
count_analysis = std::static_pointer_cast<CountBasedPassAnalysis>(
pass->runPass(graph));
if (count_analysis->num_positive_transforms != 0) {
VLOG(1) << "Pass " << pass->getPassName() << " transformed " << count_analysis->num_positive_transforms;
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new VLOG statement is on a very long single line and likely won’t match the repository’s Google clang-format style (and may fail formatting/lint checks if enforced). Consider wrapping the stream expression across multiple lines (or using the existing Str(...) helper) to keep line lengths reasonable and consistent with the rest of the file.

Suggested change
VLOG(1) << "Pass " << pass->getPassName() << " transformed " << count_analysis->num_positive_transforms;
}
while (count_analysis->fixedPointOptimizationNeeded()) {
count_analysis = std::static_pointer_cast<CountBasedPassAnalysis>(
pass->runPass(graph));
if (count_analysis->num_positive_transforms != 0) {
VLOG(1) << "Pass " << pass->getPassName() << " transformed " << count_analysis->num_positive_transforms;
VLOG(1) << "Pass " << pass->getPassName()
<< " transformed "
<< count_analysis->num_positive_transforms;
}
while (count_analysis->fixedPointOptimizationNeeded()) {
count_analysis = std::static_pointer_cast<CountBasedPassAnalysis>(
pass->runPass(graph));
if (count_analysis->num_positive_transforms != 0) {
VLOG(1) << "Pass " << pass->getPassName()
<< " transformed "
<< count_analysis->num_positive_transforms;

Copilot uses AI. Check for mistakes.
Comment on lines +41 to +48
VLOG(1) << "Pass " << pass->getPassName() << " transformed " << count_analysis->num_positive_transforms;
}

while (count_analysis->fixedPointOptimizationNeeded()) {
count_analysis = std::static_pointer_cast<CountBasedPassAnalysis>(
pass->runPass(graph));
if (count_analysis->num_positive_transforms != 0) {
VLOG(1) << "Pass " << pass->getPassName() << " transformed " << count_analysis->num_positive_transforms;
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same formatting issue as above: this VLOG statement is very long and should be wrapped to match the repo’s clang-format/Google style (or use Str(...) to build the message) for consistency and to avoid potential format-check failures.

Suggested change
VLOG(1) << "Pass " << pass->getPassName() << " transformed " << count_analysis->num_positive_transforms;
}
while (count_analysis->fixedPointOptimizationNeeded()) {
count_analysis = std::static_pointer_cast<CountBasedPassAnalysis>(
pass->runPass(graph));
if (count_analysis->num_positive_transforms != 0) {
VLOG(1) << "Pass " << pass->getPassName() << " transformed " << count_analysis->num_positive_transforms;
VLOG(1) << "Pass " << pass->getPassName()
<< " transformed "
<< count_analysis->num_positive_transforms;
}
while (count_analysis->fixedPointOptimizationNeeded()) {
count_analysis = std::static_pointer_cast<CountBasedPassAnalysis>(
pass->runPass(graph));
if (count_analysis->num_positive_transforms != 0) {
VLOG(1) << "Pass " << pass->getPassName()
<< " transformed "
<< count_analysis->num_positive_transforms;

Copilot uses AI. Check for mistakes.
@take-cheeze
Copy link
Copy Markdown
Member Author

Maybe we need clang-format CI

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.

3 participants