Skip to content

feat(export): include accumulated warnings in output json (#113)#116

Open
aryanputta wants to merge 1 commit into
IBM:mainfrom
aryanputta:feat/export-accumulated-warnings
Open

feat(export): include accumulated warnings in output json (#113)#116
aryanputta wants to merge 1 commit into
IBM:mainfrom
aryanputta:feat/export-accumulated-warnings

Conversation

@aryanputta

Copy link
Copy Markdown
Contributor

Closes #113.

What

Accumulated TraceWarnings that fire during processing are now exported into the output json under otherData.issues, keyed by warning name:

{
  "otherData": {
    ...
    "issues": {
      "zero_gap_time": "Detected 3 identical timestamps between consecutive events. ...",
      "flex_mismatch": "CAT: Found 21 categorization mismatches compared to FLEX src classifier."
    }
  }
}

This follows the preferred approach in the issue: reuse the existing TraceWarning class and let the exporter emit the active warnings, so problems are not lost when the console output is ignored or drowned out.

How

  • AbstractContext.collect_warnings() returns each active warning as name -> formatted text (mirrors the existing print_warnings).
  • EventProcessor keeps its stage contexts past drain() and aggregates their active warnings via collect_warnings().
  • AbstractTraceExporter.export_issues() is a no-op default; JsonFileTraceExporter overrides it to write into otherData (inherited by the TensorBoard exporter, propagated per rank). Empty issue sets add no section.
  • The engine calls export_issues(processor.collect_warnings()) after drain and before flush.

Tests

  • test_collect_warnings for the context-level collection.
  • test_exporter.py verifies the json exporter writes otherData.issues and skips the section when there are no warnings.
  • Full suite: 164 passed, 5 xfailed. flake8 clean.

Scope note

This covers the pipeline stage warnings. Ingestion-side warnings live on the importer and could be folded in as a follow-up if you want them in the same section.

Active TraceWarnings accumulated during processing are now collected from
the stage contexts and written to otherData.issues in the exported json.
Important warnings no longer get lost when console output is ignored or
drowned out. Resolves IBM#113.

Signed-off-by: Aryan Putta <aryansputta@gmail.com>

@lasch lasch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to hold this for a bit, sorry. There's a design change coming with respect to the verification pipeline that would simplify the approach.

Comment on current approach:

  • not yet convinced that additional tracking of contexts in the processing is needed. Kind of stores the contexts twice.

@aryanputta

Copy link
Copy Markdown
Contributor Author

Understood, happy to hold for the verification-pipeline change.

On the double-storage point: the second store exists only because warnings raised during processing have no path back to the context at export time today. If the redesign gives the exporter access to the context's warnings directly, I would drop the processor-side tracking entirely and just read from the context. Does the new pipeline expose that, or should I rebase onto it once it lands and resimplify then?

@lasch

lasch commented Jun 30, 2026

Copy link
Copy Markdown
Member

I just created #117 introducing a path from context warnings to exporter using metadata events. The basics should probably work for the regular processing pipeline too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include accumulated warnings into output file(s)

2 participants