Transformer-LT MLPerf BFloat16 Training TensorFlow* Model
Published: 12/09/2020
Last Updated: 06/15/2022
Download Command
wget https://storage.googleapis.com/intel-optimized-tensorflow/models/v2_3_0/transformer-mlperf-bfloat16-training.tar.gz
Description
This document has instructions to run a Transformer Language BFloat16 training using Intel® Optimization for TensorFlow*. Detailed information on MLPerf* benchmark can be found in mlperf/training.
Datasets
Decide the problem you want to run to get the appropriate dataset. We will get the training data of it as an example:
Download dataset for computing BLEU score.
export DATASET_DIR=/home/<user>/transformer_data
mkdir $DATASET_DIR && cd $DATASET_DIR
wget https://nlp.stanford.edu/projects/nmt/data/wmt14.en-de/newstest2014.en
wget https://nlp.stanford.edu/projects/nmt/data/wmt14.en-de/newstest2014.de
For the training dataset, download and untar the model package.
wget https://storage.googleapis.com/intel-optimized-tensorflow/models/v2_3_0/transformer-mlperf-bfloat16-training.tar.gz
tar -xzf transformer-mlperf-bfloat16-training.tar.gz
export PYTHONPATH=$PYTHONPATH:/home/<user>/transformer-mlperf-bfloat16-training/models/common/tensorflow
export DATASET_DIR=/home/<user>/transformer_data
cd transformer-mlperf-bfloat16-training/models/language_translation/tensorflow/transformer_mlperf/training/bfloat16/transformer
python data_download.py --data_dir=$DATASET_DIR
Running python data_download.py --data_dir=$DATASET_DIR
assumes you have a Python* environment similar to what the intel/intel-optimized-tensorflow:2.4.0-ubuntu-18.04
container provides. One option would be to run the above within the intel/intel-optimized-tensorflow:2.4.0-ubuntu-18.04
container eg: docker run -u $(id -u):$(id -g) --privileged --entrypoint /bin/bash -v /home/:/home/ -it intel/intel-optimized-tensorflow:2.4.0-ubuntu-18.04
Quick Start Scripts
Transformer Language in MLPerf benchmark can run with full training or fewer training steps. During training we can control if it will do the evaluation or not.
Script name | Description |
---|---|
bfloat16_training_demo |
Runs 100 training steps. The script runs in single-instance mode by default, for multi-instance mode set MPI_NUM_PROCESSES . |
bfloat16_training |
Runs 200 training steps, saves checkpoints and does evaluation. The script runs in single-instance mode by default, for multi-instance mode set MPI_NUM_PROCESSES . |
Bare Metal
To run on bare metal, the following prerequisites must be installed in your environment:
- Python* 3
- intel-tensorflow
- numactl
After installing the prerequisites, download and untar the model package. Set environment variables for the path to your DATASET_DIR
and an OUTPUT_DIR
where log files will be written, then run a quickstart script.
DATASET_DIR=<path to the dataset>
OUTPUT_DIR=<directory where log files will be written>
wget https://storage.googleapis.com/intel-optimized-tensorflow/models/v2_3_0/transformer-mlperf-bfloat16-training.tar.gz
tar -xzf transformer-mlperf-bfloat16-training.tar.gz
cd transformer-mlperf-bfloat16-training
quickstart/<script name>.sh
Documentation and Sources
Get Started
Main GitHub*
Readme
Release Notes
Get Started Guide
Code Sources
Report Issue
License Agreement
LEGAL NOTICE: By accessing, downloading or using this software and any required dependent software (the “Software Package”), you agree to the terms and conditions of the software license agreements for the Software Package, which may also include notices, disclaimers, or license terms for third party software included with the Software Package. Please refer to the license file for additional details.
Related Containers and Solutions
Transformer-LT MLPerf BFloat16 Training TensorFlow* Container
Product and Performance Information
Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.