Repository navigation
Fix autotuner latency ranking and the FLOPS metric name - #8767
Open
Aravind-11 wants to merge 1 commit into
Open
Aravind-11 wants to merge 1 commit into
Aravind-11 wants to merge 1 commit into
Conversation
Latency is lower-is-better, but every selector kept the largest number, so metric "latency" returned the slowest config. "flops" and "FLOPS" now read the FLOPS_per_gpu field the training run writes. Signed-off-by: ARAVINDHAN T <arvindhant01@gmail.com>
This branch has not been deployed
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.
Fixes #8766
The bug
"metric": "latency"keeps the largest latency, sods_config_optimal.jsonis the slowest trial.get_best_space_record,get_best_space_records,ResourceManager.parse_results, andBaseTuner.tuneall use>. Throughput and FLOPS are larger-is-better. Latency is the step time, so the smaller number is the better config.find_estimated_top_configsalready reverses the sort for latency. The selectors that publish the winner do not.The engine writes FLOPS as
FLOPS_per_gpu(DeepSpeedEngine._autotuning_exit). The README tells users to set"FLOPS", andAUTOTUNING_METRIC_FLOPSis"flops".results[metric]raisesKeyErrorfor either name. On the fast path that read is inrun_tuning_micro_batch_sizes, outside the tuner'stry, so the run aborts.The fix
metric_is_betterindeepspeed/autotuning/utils.pyis the one comparison. Latency replaces the incumbent only when it is smaller. Every other metric replaces it only when it is larger.Nonenever wins.metric_valuemaps"flops"and"FLOPS"toFLOPS_per_gpu. An exact key already present in the file still wins.The cross-stage check treats a previous metric of
0as "no previous stage", not as a measured latency of zero. A real latency is not compared against that sentinel. Throughput ranking is unchanged.Testing
CPU tests in
tests/unit/autotuning/test_autotuning.py:"FLOPS","flops", and"FLOPS_per_gpu"read the engine's fieldparse_resultsdoes bothBaseTuner.tunekeeps the smaller latency and does not let a missing metric replace a real one0sentinel does not count as a regression for latency or throughputtests/unit/autotuning/test_autotuning.pypasses (18 tests). yapf and flake8 are clean on the changed files. No GPU run.cc @loadams