Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor console reporter #165

Merged
merged 2 commits into from
Nov 19, 2024
Merged

Refactor console reporter #165

merged 2 commits into from
Nov 19, 2024

Conversation

nicholasjng
Copy link
Collaborator

This also changes the way that context values are reported, they now
appear as key-value pairs above the table.

Each benchmark metric is one row, with the value appearing underneath.
A column-first mode could be added later.

Changes the inheritance structure to not put a display() method on the
base class.

Drops tabulate from requirements in favor of rich.

This also changes the way that context values are reported, they now
appear as key-value pairs above the table.

Each benchmark metric is one row, with the value appearing underneath.
A column-first mode could be added later.

Changes the inheritance structure to not put a `display()` method on the
base class.
@nicholasjng
Copy link
Collaborator Author

Example:

.venv ➜ nnbench run .sandbox/example.py --context="foo=bar"
foo: bar
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┓
┃ Benchmark ┃ Value                       ┃ Wall time (ns) ┃ Parameters       ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━┩
│ add       │ 3                           │ 1667           │ {'a': 1, 'b': 2} │
│ mul       │ 2                           │ 500            │ {'a': 1, 'b': 2} │
│ sub       │ ERROR: 'sub' is unsupported │ 5625           │ {'a': 1, 'b': 2} │
└───────────┴─────────────────────────────┴────────────────┴──────────────────┘

@nicholasjng nicholasjng merged commit 019a1cc into main Nov 19, 2024
14 checks passed
@nicholasjng nicholasjng deleted the refactor-console-reporter branch November 19, 2024 15:20
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.

1 participant