Skip to content

Commit cd911de

Browse files
mcremon-metafacebook-github-bot
authored andcommitted
Add exception handling for numerical errors (#13026)
Summary: As titled. Instead of skipping, those tests will compare the errors to the existing values. Remove all updated tolerances from the runtime update side and make it an expected numerical accuracy. We should open tasks to trace the (large) errors, will do that as a follow up. On RT600, WW stage2, rnnt predictor and asr joiner are all showing flakiness. Opened T232829844 to track. Timeouts are still skipped for now. Reviewed By: abeakkas, zonglinpeng Differential Revision: D79065198
1 parent bedce91 commit cd911de

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

backends/cadence/aot/utils.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,22 @@ class MemoryPlanningAlgoFailure(Exception):
2929
pass
3030

3131

32+
class TypeMismatchError(Exception):
33+
pass
34+
35+
36+
class NumericalMismatchError(Exception):
37+
def __init__(self, msg: str, rms_value: Optional[float] = None) -> None:
38+
self.rms_value = rms_value
39+
super().__init__(msg)
40+
41+
42+
class NumericalMismatchExpectedError(Exception):
43+
def __init__(self, rms_expected_value: float) -> None:
44+
self.rms_expected_value = rms_expected_value
45+
super().__init__()
46+
47+
3248
# Get the output size of a 1D convolution given the input size and parameters
3349
def get_conv1d_output_size(
3450
in_size: torch.Size,

0 commit comments

Comments
 (0)