Skip to content

Replace print() with logger.info() in fusion_utils.py#4499

Open
Ashutosh0x wants to merge 1 commit into
pytorch:mainfrom
Ashutosh0x:fix/fusion-utils-print-to-logger
Open

Replace print() with logger.info() in fusion_utils.py#4499
Ashutosh0x wants to merge 1 commit into
pytorch:mainfrom
Ashutosh0x:fix/fusion-utils-print-to-logger

Conversation

@Ashutosh0x

Copy link
Copy Markdown

Summary

The rope_sdpa_fusion_pass function in fusion_utils.py uses print() for status messages, which produces unsilenceable console output on every torch.compile call. Changed to logger.info() so users can control output via standard logging configuration.

Also switched from f-strings to %-style formatting for lazy evaluation (standard practice for logger calls -- the format string is only evaluated if the log level is enabled).

Partial fix for #4333

Test Plan

Behavioral change is only in output routing (stdout -> logging). The log messages and their content are unchanged.

This change was authored with the assistance of an AI coding assistant.

The rope_sdpa_fusion_pass function uses print() for status
messages, which produces unsilenceable console output on every
torch.compile call. Changed to logger.info() so users can control
output via standard logging configuration.

Also switched from f-strings to %-style formatting for lazy
evaluation (standard practice for logger calls).

Partial fix for pytorch#4333

Test Plan:
Behavioral change is only in output routing (stdout -> logging).
The log messages and their content are unchanged.

This change was authored with the assistance of an AI coding assistant.
@pytorch-bot

pytorch-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/4499

Note: Links to docs will display an error until the docs builds have been completed.

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 Jun 15, 2026
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