Skip to content

Track NNsight tracing interference with coverage.py #208

@speediedan

Description

@speediedan

Summary

We have a documented coverage interference issue when nnsight tracing is exercised under coverage.py.

The current note in distributed-insight/project_admin/interpretune/adapter_reference/NNsight/tracing_coverage_issue.md points to nnsight calling sys.settrace(None) inside its tracing implementation, which likely wipes out coverage's trace function during with model.trace(...) execution.

Current evidence

  • The issue appears to be tied to tests that execute actual NNsight tracing contexts.
  • The local note identifies these known trigger cases:
    • TestNNsightTracing::test_nnsight_trace_context
    • TestNNsightRemoteExecution::test_remote_local_consistency
  • The likely upstream touchpoint is nnsight/intervention/tracing/base.py where trace handling resets the interpreter trace function.

Why track this

  • This can undercount coverage for adapter and analysis code paths that are actually exercised.
  • It makes coverage interpretation less reliable exactly where we are adding NNsight-backed functionality.
  • We should decide whether to work around it locally, isolate affected coverage expectations, or push for an upstream fix.

Follow-up

  • Reproduce the coverage drop with a minimized pytest --cov case.
  • Confirm the exact nnsight version and upstream line(s) involved.
  • Open or link an upstream nnsight issue once the repro is reduced.
  • Decide whether affected tests should remain in standalone/optional buckets until the coverage interaction is understood.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions