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

Cleaner report on completed stages #68

Merged
merged 40 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
c7f3238
Remove the deprecated quantization tool (#53)
jeremyfowers Dec 4, 2023
d5390fb
Stop saving labels files in the cache (#54)
jeremyfowers Dec 4, 2023
f8f8093
Better naming for Stats methods and members (#56)
jeremyfowers Dec 5, 2023
47248e1
Refactor build_model() out of benchmark_model() (#48)
jeremyfowers Dec 5, 2023
6214ab3
Remove the SetSuccess stage (and the need for it) (#59)
jeremyfowers Dec 5, 2023
4d612eb
Show stages completed following all stages order
danielholanda Dec 5, 2023
aaf08a2
Fix CI testing numbering of `cli.py` (#60)
danielholanda Dec 5, 2023
d749c5c
Add NOT STARTED
danielholanda Dec 5, 2023
acae5bb
Add not started and sort alphabetically
danielholanda Dec 5, 2023
4f891d8
Fix CI
danielholanda Dec 5, 2023
a550bed
Merge branch 'canary' into stage_order
danielholanda Dec 5, 2023
9ea9537
Fix CI
danielholanda Dec 5, 2023
f3f0584
Split into multiple columns for clarity
danielholanda Dec 6, 2023
d85c9de
Look for correct column
danielholanda Dec 6, 2023
00d96f1
stages_selected vs selected_stages
danielholanda Dec 6, 2023
eaa1358
Fix CI
danielholanda Dec 6, 2023
607a7b0
suggested changes
danielholanda Dec 7, 2023
57bed7d
merge main into branch
danielholanda Dec 7, 2023
7e7401a
lint
danielholanda Dec 8, 2023
4b8c2a7
Merge branch 'main' into stage_order
danielholanda Dec 18, 2023
38fd493
Update branch
danielholanda Dec 18, 2023
f443f68
Unified terminology
danielholanda Jan 7, 2024
a7e86ae
Suggested implementation
danielholanda Jan 7, 2024
2d2d8fa
Release notes
danielholanda Jan 7, 2024
95bd5de
Unify all build/benchmark/stage status to one enum
jeremyfowers Jan 9, 2024
1d802ff
cleanup
jeremyfowers Jan 9, 2024
45e666d
fix bugs
jeremyfowers Jan 9, 2024
e4d5f70
Improved patch notes
jeremyfowers Jan 9, 2024
a6b957d
Merge branch 'main' into stage_order
jeremyfowers Jan 10, 2024
cfd8ce0
Add release note for #78
jeremyfowers Jan 10, 2024
f49821c
fix test
jeremyfowers Jan 10, 2024
8441018
zzzz
jeremyfowers Jan 10, 2024
01fe625
print info on test fail
jeremyfowers Jan 10, 2024
ce7ae52
fix typo
jeremyfowers Jan 10, 2024
25bce69
fix case
jeremyfowers Jan 10, 2024
5bee2db
Fix test bug. Properly initialize build and benchmark status
jeremyfowers Jan 10, 2024
32098b1
wordsmithing
jeremyfowers Jan 10, 2024
83be9bb
merge with main
jeremyfowers Jan 10, 2024
a5d3545
Report incomplete stages as killed
jeremyfowers Jan 10, 2024
d6a878a
one more release note
jeremyfowers Jan 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions docs/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,30 @@ We are tracking two types of major changes:

If you are creating the release notes for a new version, please see the [template](#template-version-majorminorpatch). Release notes should capture all of the significant changes since the last numbered package release.

# Version 1.1.0

This version focuses on improving the clarity of the telemetry reported.

## Users

### User Improvements

- Report splits `stages_completed` into stage status and duration.

## User Breaking Changes

None.

## Developers

### Developer Improvements

None

### Developer Breaking Changes

None

# Version 1.0.0

This version focuses on cleaning up technical debts and most of the changes are not visible to users. It removes cumbersome requirements for developers, removes unused features to streamline the codebase, and also clarifying some API naming schemes.
Expand Down
2 changes: 1 addition & 1 deletion src/turnkeyml/build/stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def launch(self, state: build.State) -> build.State:
# Collect telemetry for the build
stats = fs.Stats(state.cache_dir, state.config.build_name, state.evaluation_id)
stats.save_model_eval_stat(
fs.Keys.ALL_BUILD_STAGES,
fs.Keys.SELECTED_SEQUENCE_OF_STAGES,
self.get_names(),
)

Expand Down
41 changes: 39 additions & 2 deletions src/turnkeyml/cli/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,41 @@ def summary_spreadsheets(args) -> None:

# Copy the build-specific stats
for key, value in build.items():
# Break each value in "completed build stages" into its own column
# to make analysis easier
# Break each value in "completed build stages" into status and duration
# to make the analysis of this data easier
if key == fs.Keys.COMPLETED_BUILD_STAGES:
<<<<<<< HEAD
previous_state_incomplete = False
for stage in build[fs.Keys.SELECTED_SEQUENCE_OF_STAGES]:
duration_column_name = f"stage_duration: {stage}"
state_column_name = f"stage_status: {stage}"
if stage in build[fs.Keys.COMPLETED_BUILD_STAGES]:
evaluation_stats[
state_column_name
] = "COMPLETED"
evaluation_stats[duration_column_name] = build[
fs.Keys.COMPLETED_BUILD_STAGES
][stage]
elif not previous_state_incomplete:
previous_state_incomplete = True
evaluation_stats[
state_column_name
] = "INCOMPLETE"
evaluation_stats[duration_column_name] = "-"
else:
evaluation_stats[
state_column_name
] = "NOT STARTED"
evaluation_stats[duration_column_name] = "-"

# Do not add the raw version of COMPLETED_BUILD_STAGES to the report
continue

=======
for subkey, subvalue in value.items():
evaluation_stats[subkey] = subvalue

>>>>>>> main
# If a build or benchmark is still marked as "running" at
# reporting time, it
# must have been killed by a time out, out-of-memory (OOM), or some
Expand All @@ -93,7 +122,12 @@ def summary_spreadsheets(args) -> None:
) and value == fs.FunctionStatus.RUNNING:
value = fs.FunctionStatus.KILLED

<<<<<<< HEAD
# Add stats ensuring that those are all in lower case
evaluation_stats[key.lower()] = value
=======
evaluation_stats[key] = value
>>>>>>> main

all_evaluation_stats.append(evaluation_stats)
except yaml.scanner.ScannerError:
Expand All @@ -108,6 +142,9 @@ def summary_spreadsheets(args) -> None:
if header not in column_headers:
column_headers.append(header)

# Sort all columns alphabetically
column_headers = sorted(column_headers)

# Add each build to the report
for evaluation_stats in all_evaluation_stats:
# Start with a dictionary where all of the values are "-". If a build
Expand Down
4 changes: 2 additions & 2 deletions src/turnkeyml/common/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,10 @@ class Keys:
# ONNX model input tensor dimensions
ONNX_INPUT_DIMENSIONS = "onnx_input_dimensions"
# List of all build stages in the Sequence
ALL_BUILD_STAGES = "all_build_stages"
SELECTED_SEQUENCE_OF_STAGES = "selected_sequence_of_stages"
# Map of build stages that completed successfully to the
# execution time for that stage. We can figure out if any build
# stages failed if all_build_stages != completed_build_stages.keys().
# stages failed if selected_sequence_of_stages != completed_build_stages.keys().
COMPLETED_BUILD_STAGES = "completed_build_stages"
# Location of the most up-to-date ONNX file for this build. If the
# build completed successfully, this is the final ONNX file.
Expand Down
2 changes: 1 addition & 1 deletion src/turnkeyml/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.0"
__version__ = "1.1.0"
23 changes: 11 additions & 12 deletions test/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ def test_026_cli_report(self):
"device",
"mean_latency",
"throughput",
"all_build_stages",
"selected_sequence_of_stages",
"completed_build_stages",
]
linear_summary = summary[1]
Expand Down Expand Up @@ -995,19 +995,18 @@ def test_026_cli_report(self):

# Make sure the report.get_dict() API works
result_dict = report.get_dict(
summary_csv_path, ["all_build_stages", "completed_build_stages"]
summary_csv_path,
[
"selected_sequence_of_stages",
"stage_duration: export_pytorch",
"stage_status: export_pytorch",
],
)
for result in result_dict.values():
# All of the models should have exported to ONNX, so the "onnx_exported" value
# should be True for all of them
assert "export_pytorch" in yaml.safe_load(result["all_build_stages"])
assert (
"export_pytorch"
in yaml.safe_load(result["completed_build_stages"]).keys()
)
assert (
yaml.safe_load(result["completed_build_stages"])["export_pytorch"] > 0
)
# All of the models should have exported to ONNX
assert "export_pytorch" in result["selected_sequence_of_stages"]
assert result["stage_status: export_pytorch"] == "COMPLETED"
assert result["stage_duration: export_pytorch"] > 0


if __name__ == "__main__":
Expand Down