Skip to content

Commit

Permalink
improve demo time
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjurado committed Nov 17, 2023
1 parent a66af6b commit 7a23424
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions image_classification/run_demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,48 +38,43 @@ fi

export COMPLIANCE_FILE=$(pwd)/mlperf_compliance.log

sed -i "s/NUM_TRAIN_FILES = 1024/NUM_TRAIN_FILES = 1/g" tensorflow2/imagenet_preprocessing.py
sed -i "s/ os.path.join(data_dir, 'train-%05d-of-01024' % i)/ os.path.join(data_dir, 'train-%05d-of-00001' % i)/g" tensorflow2/imagenet_preprocessing.py

# run benchmark
echo "running benchmark"

# run training
TF_XLA_FLAGS='--tf_xla_auto_jit=2' \
python3 tensorflow2/resnet_ctl_imagenet_main.py \
--distribution_strategy="one_device" \
--base_learning_rate=8.5 \
--batch_size=150 \
--batch_size=200 \
--data_dir=${DATASET_DIR} \
--datasets_num_private_threads=1 \
--dtype=fp32 \
--device_warmup_steps=1 \
--datasets_num_private_threads=4 \
--dtype=fp16 \
--noenable_device_warmup \
--enable_eager \
--noenable_xla \
--epochs_between_evals=1 \
--enable_xla \
--noeval_dataset_cache \
--eval_offset_epochs=1 \
--eval_prefetch_batchs=8 \
--label_smoothing=0.1 \
--lars_epsilon=0 \
--log_steps=125 \
--lr_schedule=polynomial \
--model_dir=${OUTPUT_MODEL_DIR} \
--momentum=0.9 \
--num_accumulation_steps=1 \
--num_accumulation_steps=32 \
--num_classes=1000 \
--num_gpus=1 \
--optimizer=LARS \
--optimizer=SGD \
--noreport_accuracy_metrics \
--single_l2_loss_op \
--skip_eval \
--steps_per_loop=1 \
--target_accuracy=0.759 \
--steps_per_loop=20 \
--notf_data_experimental_slack \
--tf_gpu_thread_mode=gpu_private \
--notrace_warmup \
--train_epochs=1 \
--notraining_dataset_cache \
--training_prefetch_batchs=8 \
--training_prefetch_batchs=128 \
--nouse_synthetic_data \
--warmup_epochs=1 \
--weight_decay=0.0002 |& tee "$LOG_DIR/train_console.log"

# Copy log file to MLCube log folder
Expand All @@ -102,4 +97,4 @@ echo "ENDING TIMING RUN AT $end_fmt"
result=$(($end - $start))
result_name="IMAGE_CLASSIFICATION"

echo "RESULT,$result_name,,$result,nvidia,$start_fmt"
echo "RESULT,$result_name,,$result,nvidia,$start_fmt"

0 comments on commit 7a23424

Please sign in to comment.