New Autograde Preprocessor: IgnorePattern #1904
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Creating a new preprocessor, which is useful for removing specific warning cells that might result in a false-negative autograde result. This is used when the assignment is already out and released, but you notice a problem in a test after the fact. This provides a much easier way of recovering compared to editing the assignment.
We at @AaltoSciComp came across an issue where Torch raised a specific warning on stderr (due to some avx1 incompatibility in the node on which the grading would happen), and the auto-grader would mark the solution as wrong. Since the warning was not a Python Warning object (NNPACK.cpp warning), it cannot be suppressed the usual way. Since this warning can't be easily predicted in advance, the assignment couldn't be made to compensate for it.
We addressed the problem by inserting this preprocessor in the
c.Autograde.autograde_preprocessors
list immediately afterExecute
to detect and remove pre-defined warning (stderr) outputs from GradeCells. The module uses a configured regular expression (c.IgnorePattern.pattern
) to find and delete the matching outputs before the grading process. The default value is empty, which short-circuits the processing so has no effect (and anyway an empty value would have no effect by default).It shouldn't be needed often, but when it's needed it will save a lot of time.
It has tests and all. We haven't used it live since we made it too late, but we definitely had a need for it.