params_cnt.sh 508 B

123456789101112
  1. # Copyright (c) 2020 NVIDIA Corporation. All rights reserved.
  2. NLAYERS=32 ## modify this param
  3. NHIDDEN=4096 ## modify this param
  4. NHEADS=32 ## modify this param
  5. SEQ_LEN=512 ## 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