Skip to content

Add script tool to normalize jsonbin sidecar paths in existing NVBench JSON files #407

Description

@oleksandr-pavlyk

Problem

Older NVBench jsonbin output can contain sidecar filenames that are not relative to the JSON file location, see #404. This makes post-processing fragile when benchmarks are launched from one working directory but the JSON output is written elsewhere.

Desired Tool

Add a script that rewrites existing NVBench JSON files so that jsonbin sidecar filenames are normalized relative to the JSON file’s directory.
The tool should:

  • Read an NVBench JSON file.
  • Locate jsonbin sidecar summaries, including sample time and frequency sidecars.
  • Resolve existing sidecar files from candidate locations.
  • Rewrite filename fields to paths relative to the JSON file directory.
  • Preserve all other JSON content.
  • Provide a dry-run mode.
  • Support either in-place update with backup or writing to a separate output file.

Ambiguity Handling

Some files may be resolvable from multiple locations. The tool should avoid guessing silently. Possible options:

nvbench-normalize-jsonbin result.json --dry-run
nvbench-normalize-jsonbin result.json --in-place
nvbench-normalize-jsonbin result.json --output normalized.json
nvbench-normalize-jsonbin result.json --sidecar-root /path/to/use

If multiple candidates match, the tool should report the ambiguity and require --sidecar-root or another explicit resolution option.

Acceptance Criteria

  • Normalized JSON works when moved together with its sidecar directories.
  • Missing sidecars are reported clearly.
  • Ambiguous sidecar resolution is not silently guessed.
  • Existing valid JSON-relative sidecar paths are left unchanged.
  • Tests cover current JSON-relative files and older launch-directory-relative files.

Motivation

This complements the jsonbin sidecar path fixes (#405 and change to nvbench-compare in #386) for newly generated output while providing a migration path for previously collected benchmark data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Task.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions