-
Notifications
You must be signed in to change notification settings - Fork 646
[Backend Tester] Reduce log verbosity / spam #13312
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
base: gh/GregoryComer/122/head
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/13312
Note: Links to docs will display an error until the docs builds have been completed. ❌ 3 New Failures, 1 Unrelated FailureAs of commit c583fa1 with merge base d7ecd87 ( NEW FAILURES - The following jobs have failed:
BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@@ -39,7 +40,9 @@ def graph_module(self) -> None: | |||
|
|||
def run_artifact(self, inputs): | |||
inputs_flattened, _ = tree_flatten(inputs) | |||
executorch_module = _load_for_executorch_from_buffer(self.buffer) | |||
executorch_module = _load_for_executorch_from_buffer( | |||
self.buffer, program_verification=Verification.Minimal |
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.
what does this do? i.e. Minimal ==> "do the verification but don't print warnings"?
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 doesn't actually cause any change in verification, because the extended verification feature isn't compiled into pybindings by default. So the runtime logs a warning because it was requested but not available. This change updates the code to not ask for extended verification.
Here's the relevant code from the runtime. The "InternalConsistency verification requested but not available " log is the one contributing to log spam.
executorch/runtime/executor/program.cpp
Lines 123 to 136 in d7ecd87
#if ET_ENABLE_PROGRAM_VERIFICATION | |
EXECUTORCH_SCOPE_PROF("Program::verify_internal_consistency"); | |
flatbuffers::Verifier verifier( | |
reinterpret_cast<const uint8_t*>(program_data->data()), | |
program_data->size()); | |
bool ok = executorch_flatbuffer::VerifyProgramBuffer(verifier); | |
ET_CHECK_OR_RETURN_ERROR( | |
ok, | |
InvalidProgram, | |
"Verification failed; data may be truncated or corrupt"); | |
#else | |
ET_LOG( | |
Info, "InternalConsistency verification requested but not available"); | |
#endif |
@@ -249,6 +250,10 @@ def build_test_filter(args: argparse.Namespace) -> TestFilter: | |||
def runner_main(): | |||
args = parse_args() | |||
|
|||
# Suppress deprecation warnings for export_for_training, as it generates a | |||
# lot of log spam. We don't really need the warning here. | |||
warnings.simplefilter("ignore", category=FutureWarning) |
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.
FYI PyTest has this nice feature where they count same warnings and at the end print warning summary https://docs.pytest.org/en/stable/how-to/capture-warnings.html
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 want to look at using pytest or another framework once we get the core harness and suite landed. I originally went with unittest, in part, because staying closer to unittest made it easier to run within buck/Meta-internal. But if that constraint is lifted, we can probably leverage pytest for some nicer features without having to make too many code changes.
When running tests, deprecation warnings for export_for_training and "internal consistency verification was requested but not available" create a large amount of spam in the CLI and drown out actual test info during the run. Neither warning is particularly useful. I've suppressed the the export_for_training warning in the backend tester only and switched the tester to not request internal consistency verification since it's not compiled into pybindings by default. This gives much cleaner CLI output.
Before:
After: