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

[benchmarks] Guard empty metrics on verifier runs. #7809

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

ysiraichi
Copy link
Collaborator

This PR fixes result_analyzer.py by guarding its metric processing function call get_calculated_metrics, checking whether it's empty or not.

Empty metrics was allowed on results.jsonl starting on #7777, where verifier-only runs were enabled.

cc @miladm @zpcore

Copy link
Collaborator

@zpcore zpcore left a comment

Choose a reason for hiding this comment

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

LGTM!

@zpcore
Copy link
Collaborator

zpcore commented Aug 8, 2024

We can add the python result_analyzer.py ... in the test:

function run_tests {
local overall_status=0
local pjrt_device="CPU"
# TODO(piz): Uncomment the following if we decide to run on GPU.
# if [ -x "$(command -v nvidia-smi)" ]; then
# num_devices=$(nvidia-smi --list-gpus | wc -l)
# echo "Found $num_devices GPU devices..."
# export GPU_NUM_DEVICES=$num_devices
# pjrt_device="CUDA"
# fi
for model in "${TORCHBENCH_MODELS[@]}"; do
echo "testing model: $model"
PJRT_DEVICE=$pjrt_device python -u benchmarks/experiment_runner.py \
--suite-name=torchbench \
--experiment-config='{"accelerator":"'"$pjrt_device"'","xla":"PJRT","dynamo":"openxla","test":"eval","torch_xla2":null,"xla_flags":null,"keep_model_data_on_cuda":false}' \
--model-config='{"model_name":"'"$model"'"}'
if [ $? -ne 0 ]; then
echo "ERROR: Failed to test $model. Exiting with failure." >&2
overall_status=1
else
success_count=$((success_count + 1))
fi
done
just to be safe.

@ysiraichi
Copy link
Collaborator Author

I will leave that to a follow-up PR.

@ysiraichi ysiraichi merged commit 9fbd64a into master Aug 8, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants