Skip to content

Commit fe4d5f0

Browse files
Update float8 training benchmark script tensorwise configs (#1832)
1 parent 9b18955 commit fe4d5f0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed
File renamed without changes.

benchmarks/float8/training/float8_training_benchmark.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,19 @@ if [ -z "${TORCHTITAN_ROOT}" ]; then
1414
echo "Error: TORCHTITAN environment variable is not set. Please set it before running this script."
1515
echo "Usage: TORCHTITAN_ROOT=<directory> ./float8_training_benchmark.sh"
1616
echo "Optional parameters configurable via environment variables:"
17-
echo " * FLOAT8_RECIPE: "rowwise" or "tensorwise". if set, use float8 training with the specified recipe. otherwise, use bf16 mixed precision training."
17+
echo " * FLOAT8_RECIPE_WITH_BEST_SETTINGS: "rowwise" or "tensorwise". if set, use float8 training in torchtitan with the specified recipe, including the additional settings which are optimal for that recipe. otherwise, use bf16 mixed precision training."
1818
echo " * BATCH_SIZE: defaults to 1."
1919
echo " * STEPS: defaults to 100."
2020
exit 1
2121
fi
2222

2323
# validate recipe name
24-
if [ -n "${FLOAT8_RECIPE}" ]; then
25-
FLOAT8_ARGS="--model.converters="float8" --float8.recipe_name=${FLOAT8_RECIPE}"
24+
if [ -n "${FLOAT8_RECIPE_WITH_BEST_SETTINGS}" ]; then
25+
if [ "${FLOAT8_RECIPE_WITH_BEST_SETTINGS}" == "tensorwise" ]; then
26+
FLOAT8_ARGS="--model.converters="float8" --float8.enable_fsdp_float8_all_gather --float8.precompute_float8_dynamic_scale_for_fsdp --float8.force_recompute_fp8_weight_in_bwd"
27+
else
28+
FLOAT8_ARGS="--model.converters="float8" --float8.recipe_name=${FLOAT8_RECIPE_WITH_BEST_SETTINGS}"
29+
fi
2630
fi
2731

2832

0 commit comments

Comments
 (0)