add speedup_ttfn to OnnxDiscrepancyCheck#2564
Conversation
|
@copilot add unit to cover the new metrics and fix test/passes/onnx/test_session_params_tuning.py:174: in test_ort_session_params_tuning_pass_with_dynamic_shapes |
|
@copilot continue |
Done! I've added comprehensive unit tests for the new speedup metrics and fixed the test failure. Changes made:
All tests pass and code is properly linted. Commit: 9f0b478 |
There was a problem hiding this comment.
Pull request overview
This PR extends OnnxDiscrepancyCheck to compute additional “time-to-first-N tokens” (TTFN) speedup metrics and updates/introduces unit tests to validate the new metrics and improve compatibility with changing upstream error messages.
Changes:
- Compute and persist derived
speedup_ttfn_*metrics based on existing*_ttfn_stiming results. - Add unit tests for
_compute_final_metricsspeedup calculations. - Relax a PyTorch error-message assertion to be compatible across versions.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
olive/passes/onnx/discrepancy_check.py |
Adds _compute_final_metrics and calls it before saving results to include derived TTFN speedup ratios. |
test/passes/onnx/test_discrepancy_check.py |
Adds new unit tests for _compute_final_metrics speedup outputs. |
test/passes/onnx/test_session_params_tuning.py |
Updates an assertion to tolerate PyTorch error message variations. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
All comments from the review thread have been addressed:
All three files pass the linter with no issues. |
| _ratio("transformers_ttfn_s", "genai_ttfn_s", "speedup_ttfn_genai_torch") | ||
| _ratio("transformers_ttfn_s", "llama_cpp_ttfn_s", "speedup_ttfn_llama_cpp_torch") | ||
| _ratio("llama_cpp_ttfn_s", "genai_ttfn_s", "speedup_ttfn_genai_llama_cpp") |
Describe your changes
Add speedup metrics to OnnxDiscrepancyCheck, compares the time to get 5 tokens