Commit 9b769b8
Add robust field filtering in TBEDataConfig.from_json (#5164)
Summary:
X-link: facebookresearch/FBGEMM#2163
Add field validation and filtering to `TBEDataConfig.from_json` to handle JSON inputs, used in benchmark, that may contain unknown or extra fields.
The current `tbe_reporter` has adhoc properties added to the output that mismatch with the current structure.
This change makes JSON deserialization more robust by filtering out unrecognized fields and logging warnings for missing expected fields and info messages for ignored extra fields. This allows the code to gracefully handle evolving schema or data from external sources without breaking deserialization.
Differential Revision: D876582171 parent 1bb480f commit 9b769b8
1 file changed
+15
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
81 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
82 | 96 | | |
83 | 97 | | |
84 | 98 | | |
| |||
0 commit comments