Add mixed-batch inference benchmark to perf_check#2050
Open
misko wants to merge 2 commits into
Open
Conversation
Extends perf_check with MixedPerfCheckRunner that benchmarks varying batch sizes (4, 8, 16, 32, 64, 128, 256) across a diverse pool of systems spanning all 5 UMA tasks (oc20, omat, omol, odac, omc). Ground truth is computed once per pool entry at fp64 using the existing BASELINE_SETTINGS and cached on disk, mirroring the singleton runner. Batches are pre-materialized via a deterministic schedule that round-robins through batch sizes and forbids adjacent duplicate batches, so warmup and benchmark phases draw from the same prepared sequence. Per-system predictions are split out of each batched forward pass and compared against the cached baseline. The pool reuses benchmark.fake_dataset.generate_structures so size distributions match the training-benchmark datasets. Usage: fairchem -c configs/uma/benchmark/perf_check/mixed_benchmark.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
MixedPerfCheckRunnerthat extendsperf_checkto benchmark inference across varying batch sizes (4, 8, 16, 32, 64, 128, 256) over a diverse pool of systems spanning all 5 UMA tasks (oc20, omat, omol, odac, omc) at multiple size buckets.BASELINE_SETTINGSandrun_inference, then stored inmixed_baseline_cache.jsonkeyed by checkpoint, pool signature, device, seed, and batch sizes. Subsequent runs reuse the cache.batch_sizes. The schedule guarantees no two consecutive batches share the same(size, sorted_indices)multiset, so warmup and benchmark walk the same prepared sequence.natomsoffsets) and compared to the cached fp64 baseline — accuracy is decoupled from batch composition.fake_dataset.generate_structures. Reuses the same generator the training benchmark uses, so size distributions match production specs for each UMA task.Usage
Files
src/fairchem/core/components/benchmark/perf_check.py— addsMixedPerfCheckRunner,build_batch_schedule,run_mixed_inference,MixedInferenceResult,BatchTiming,format_mixed_report_table,_mixed_baseline_cache_key. Reuses existing_baseline_cache_key/_load_baseline_cache/_save_baseline_cache/run_inference/compare_resultsfrom the same file.src/fairchem/core/components/benchmark/systems.py— addsSystemPooldataclass andget_diverse_benchmark_pool.configs/uma/benchmark/perf_check/mixed_benchmark.yaml— Hydra config.tests/core/components/benchmark/test_mixed_perf_check.py— 13 tests, all CPU, no real model weights required.Test plan
pytest tests/core/components/benchmark/test_mixed_perf_check.py— 13/13 pass in ~15sget_diverse_benchmark_poolcovers all requested UMA tasks and size bucketspytest tests/core/components/benchmark/— full benchmark suite (22 passed, 2 skipped GPU-only smoke tests)pre-commit run --files ...on every modified file