-
Notifications
You must be signed in to change notification settings - Fork 21.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nicer logs for dynamic shapes #99277
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1945,10 +1945,10 @@ def hint(): | |
msg = f" {len(error_msgs) + 1}. {msg()}" | ||
error_msgs.append(msg) | ||
if len(error_msgs) > 0: | ||
log.warning("Warning only constraints violated %s", warn_msgs) | ||
log.info("Warning only constraints violated %s", warn_msgs) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wait, this looks like a botched merge, we shouldn't warn here at all, we're going to raise an error! |
||
raise ConstraintViolationError(f"Constraints violated!\n{error_msgs}") | ||
elif len(warn_msgs) > 0: | ||
log.warning("%s Warning only constraints violated", len(warn_msgs)) | ||
log.info("%s Warning only constraints violated", len(warn_msgs)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This probably suppresses too much but we can figure out a better strategy later (maybe only warn this once per frame) |
||
|
||
return exprs | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one gets very noisy, so maybe we keep him debug, and make the others info? Open to bikshedding. @ezyang opine please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is hard to say without actually using the logs. Keeping everything as debug to start is a safe start, assuming this doesn't trigger too much (but I don't think it does, since we debug trace every opcode in dynamo). Note that you can selectively up logging from ONLY this module with
TORCH_LOGS=+torch._dynamo.variables.builder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would bikeshed the message here though; "registered" isn't very descriptive. In the log message, I think I probably want the words
frame_state
in it. Maybeframe_state[name] = curr_sizes
. But in that case, why don't we move the log message down to where we actually do the setter, and then delete all the other branches?