params_cnt.sh 402 B

123456789101112
  1. # Copyright (c) 2020 NVIDIA Corporation. All rights reserved.
  2. NLAYERS=32
  3. NHIDDEN=2048
  4. NHEADS=32
  5. SEQ_LEN=64
  6. VOCAB_SIZE=32000
  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