Conversation
Signed-off-by: take-cheeze <takechi101010@gmail.com>
|
There was a problem hiding this comment.
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.hin the pass manager implementation. - Emit
VLOG(1)messages when a pass reports non-zeronum_positive_transforms, including within fixed-point reruns.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 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; |
There was a problem hiding this comment.
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.
| 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; |
| 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; |
There was a problem hiding this comment.
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.
| 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; |
|
Maybe we need clang-format CI |



For debugging with environment variable like
LOG_THRESHOLD=-1