Skip to content

add fast test to check with bfloat16#2581

Open
xadupre wants to merge 6 commits into
mainfrom
xadupre/bf16
Open

add fast test to check with bfloat16#2581
xadupre wants to merge 6 commits into
mainfrom
xadupre/bf16

Conversation

@xadupre

@xadupre xadupre commented Jul 21, 2026

Copy link
Copy Markdown
Member

fix discrepancy tests for bfloat16

@xadupre

xadupre commented Jul 21, 2026

Copy link
Copy Markdown
Member Author

@copilot in test_bf16_precision, do you check that speedup is here with no error?

Copilot AI commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

@copilot in test_bf16_precision, do you check that speedup is here with no error?

It wasn't — fixed in the latest commit. The run call now passes --test_metrics mae,speedup to enable timing, and three assertions were added after it:

  1. TEST_OUTPUT_MARKER_FILE exists in the output directory (confirms the run finished without error).
  2. discrepancy_check_results.json exists.
  3. The speedup key is present, is a number, and is > 0.

@xadupre
xadupre marked this pull request as ready for review July 21, 2026 17:21
Copilot AI review requested due to automatic review settings July 21, 2026 17:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new CLI smoke test intended to exercise the olive optimize + olive run --test flow when targeting BF16 precision, and to validate that the discrepancy report is produced with a speedup metric.

Changes:

  • Add test_bf16_precision / _assert_bf16_precision to run an optimize+run workflow with --precision bf16.
  • Validate that discrepancy_check_results.json is written and includes a numeric, positive speedup value.

Comment thread test/cli/test_cli_test_model_smoke.py
Comment thread test/cli/test_cli_test_model_smoke.py Outdated
Comment on lines +265 to +268
"--device",
"cpu",
"--provider",
"CPUExecutionProvider",
Comment thread test/cli/test_cli_test_model_smoke.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@xadupre

xadupre commented Jul 22, 2026

Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

Copilot AI commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved in 3058fc9.

Comment on lines +378 to +382
try:
import onnxruntime as ort
import torch
except ImportError:
return False

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this check? test env will always install onnxruntime and torch.

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.

4 participants