Skip to content

Commit

Permalink
update performance mode
Browse files Browse the repository at this point in the history
  • Loading branch information
caozhou committed May 30, 2024
1 parent dbcc79f commit fe0fb2d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion flagscale/auto_tuner/tuner.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def tune(self):
# get best strategy
best_strategy = self.get_best()
if best_strategy:
self.logger.info(f"Best strategy tuned so far: {best_strategy}, and performance is {best_strategy["performance"]}.")
self.logger.info(f"Best strategy tuned so far: {best_strategy}, and performance is {best_strategy['performance']}.")
else:
self.logger.info(f"No strategy can run so far.")
tuner_end_time = time.time()
Expand Down
8 changes: 5 additions & 3 deletions flagscale/auto_tuner/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,15 @@ def sort_by_memory(strategy):
-strategy["use_distributed_optimizer"],
strategy["micro_batch_size"],
-strategy["use_recompute"],
-strategy["sequence_parallel"],
)


def sort_by_performance(strategy):
return (
-strategy["micro_batch_size"],
strategy["use_recompute"],
strategy["tensor_model_parallel_size"],
-strategy["use_recompute"],
(strategy["tensor_model_parallel_size"] % 4),
(strategy["micro_batch_size"] % 4),
strategy["pipeline_model_parallel_size"],
-strategy["sequence_parallel"],
)

0 comments on commit fe0fb2d

Please sign in to comment.