params_cnt.sh 500 B

123456789101112
  1. # Copyright (c) 2020 NVIDIA Corporation. All rights reserved.
  2. NLAYERS= ## modify this param
  3. NHIDDEN= ## modify this param
  4. NHEADS= ## modify this param
  5. SEQ_LEN= ## modify this param
  6. VOCAB_SIZE=56000 ## modify this param
  7. MODEL_SIZE=$((($NLAYERS * (12*$NHIDDEN**2 + 13*$NHIDDEN) + ($VOCAB_SIZE * $NHIDDEN) + ($SEQ_LEN * $NHIDDEN) ) / 10**9))
  8. EXACT_MODEL_SIZE=$(($NLAYERS * (12*$NHIDDEN**2 + 13*$NHIDDEN) + ($VOCAB_SIZE * $NHIDDEN) + ($SEQ_LEN * $NHIDDEN) ))
  9. echo $MODEL_SIZE
  10. echo $EXACT_MODEL_SIZE