Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions examples/speculative_decoding/launch_train.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ while [ $# -gt 0 ]; do
if [[ "$1" != *=* ]]; then shift; fi
AR_VALIDATE_STEPS="${1#*=}"
;;
--num_ttt_steps*)
if [[ "$1" != *=* ]]; then shift; fi
NUM_TTT_STEPS="${1#*=}"
;;
--cp_size*)
if [[ "$1" != *=* ]]; then shift; fi
CP_SIZE="${1#*=}"
Expand Down Expand Up @@ -154,6 +158,7 @@ DP_SHARD_SIZE=${DP_SHARD_SIZE:-$((TOTAL_GPU/CP_SIZE))}
LOG_STEPS=${LOG_STEPS:-100}
DRAFT_VOCAB_CACHE=${DRAFT_VOCAB_CACHE:-""}
MIX_HIDDEN_STATES=${MIX_HIDDEN_STATES:-"False"}
NUM_TTT_STEPS=${NUM_TTT_STEPS:-3}


if [[ "$MODE" == "eagle3" ]]; then
Expand Down Expand Up @@ -247,6 +252,7 @@ CMD="accelerate launch $MULTI_NODE_ARGS --mixed_precision bf16 ${SCRIPT_DIR}/mai
$FSDP_ARGS \
--cp_size $CP_SIZE \
--dp_shard_size $DP_SHARD_SIZE \
--num_ttt_steps $NUM_TTT_STEPS \
"

start_time=$(date +%s)
Expand Down
5 changes: 5 additions & 0 deletions examples/speculative_decoding/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ class EagleArguments:
default=False,
metadata={"help": "Whether to mix hidden states from previous TTT step."},
)
num_ttt_steps: int = field(
default=3,
metadata={"help": "Number of train-time-test steps to use during training."},
)


def train():
Expand Down Expand Up @@ -208,6 +212,7 @@ def train():
"eagle_decoder_type": eagle_args.eagle_decoder_type,
"eagle_offline": use_offline_training,
"eagle_mix_hidden_states": eagle_args.mix_hidden_states,
"eagle_ttt_steps": eagle_args.num_ttt_steps,
"eagle_architecture_config": custom_config,
}

Expand Down
2 changes: 1 addition & 1 deletion modelopt/torch/speculative/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class EagleConfig(ModeloptBaseConfig):
)

eagle_ttt_steps: int = ModeloptField(
default=4, description=("The number of train-time-test steps in training.")
default=3, description=("The number of train-time-test steps in training.")
)

eagle_mix_hidden_states: bool = ModeloptField(
Expand Down
Loading