1+ #! /bin/bash
2+ # This script will be executed inside the SLURM job with Docker container
3+
4+ # Exit on error
5+ set -e
6+ set -x
7+
8+ # Check for NVIDIA GPUs
9+ nvidia-smi -L || true
10+ nvidia-smi || true
11+
12+ # Set up environment variables and paths
13+ export TRT_SUPPRESS_DEPRECATION_WARNINGS=1
14+ export VOLUME_BUILD_DIR=${CI_PROJECT_DIR} /$CI_JOB_ID
15+ export VOLUME_SRCDIR=$VOLUME_BUILD_DIR /gen_srcdir
16+ export VOLUME_DESTDIR=$VOLUME_BUILD_DIR /$TRITON_VERSION /qa_model_repository
17+ export VOLUME_SHAPEDESTDIR=$VOLUME_BUILD_DIR /$TRITON_VERSION /qa_shapetensor_model_repository
18+ export VOLUME_VARDESTDIR=$VOLUME_BUILD_DIR /$TRITON_VERSION /qa_variable_model_repository
19+ export VOLUME_RESHAPEDESTDIR=$VOLUME_BUILD_DIR /$TRITON_VERSION /qa_reshape_model_repository
20+ export VOLUME_DYNASEQDESTDIR=$VOLUME_BUILD_DIR /$TRITON_VERSION /qa_dyna_sequence_model_repository
21+ export VOLUME_DYNASEQIMPLICITDESTDIR=$VOLUME_BUILD_DIR /$TRITON_VERSION /qa_dyna_sequence_implicit_model_repository
22+
23+ # Ensure necessary directories exist
24+ mkdir -p $VOLUME_BUILD_DIR $VOLUME_SRCDIR $VOLUME_DESTDIR $VOLUME_SHAPEDESTDIR \
25+ $VOLUME_VARDESTDIR $VOLUME_RESHAPEDESTDIR $VOLUME_DYNASEQDESTDIR \
26+ $VOLUME_DYNASEQIMPLICITDESTDIR
27+
28+ # Models using shape tensor i/o
29+ python3 $VOLUME_SRCDIR /gen_qa_identity_models.py --tensorrt-shape-io --models_dir=$VOLUME_SHAPEDESTDIR
30+ python3 $VOLUME_SRCDIR /gen_qa_sequence_models.py --tensorrt-shape-io --models_dir=$VOLUME_SHAPEDESTDIR
31+ python3 $VOLUME_SRCDIR /gen_qa_dyna_sequence_models.py --tensorrt-shape-io --models_dir=$VOLUME_SHAPEDESTDIR
32+ chmod -R 777 $VOLUME_SHAPEDESTDIR
33+
34+ # Standard models generation
35+ python3 $VOLUME_SRCDIR /gen_qa_models.py --tensorrt --models_dir=$VOLUME_DESTDIR
36+ chmod -R 777 $VOLUME_DESTDIR
37+
38+ # Variable models generation
39+ python3 $VOLUME_SRCDIR /gen_qa_models.py --tensorrt --variable --models_dir=$VOLUME_VARDESTDIR
40+ chmod -R 777 $VOLUME_VARDESTDIR
41+
42+ # Identity models
43+ python3 $VOLUME_SRCDIR /gen_qa_identity_models.py --tensorrt --models_dir=$VOLUME_DESTDIR
44+ chmod -R 777 $VOLUME_DESTDIR
45+
46+ # Reshape models
47+ python3 $VOLUME_SRCDIR /gen_qa_reshape_models.py --tensorrt --variable --models_dir=$VOLUME_RESHAPEDESTDIR
48+ chmod -R 777 $VOLUME_RESHAPEDESTDIR
49+
50+ # Dynamic sequence models
51+ python3 $VOLUME_SRCDIR /gen_qa_dyna_sequence_models.py --tensorrt --models_dir=$VOLUME_DYNASEQDESTDIR
52+ chmod -R 777 $VOLUME_DYNASEQDESTDIR
53+
54+ # Implicit sequence models
55+ python3 $VOLUME_SRCDIR /gen_qa_dyna_sequence_implicit_models.py --tensorrt --models_dir=$VOLUME_DYNASEQIMPLICITDESTDIR
56+ chmod -R 777 $VOLUME_DYNASEQIMPLICITDESTDIR
0 commit comments