flair icon indicating copy to clipboard operation
flair copied to clipboard

Slow inference using TARSClassifier base model on GPU

Open akshaykekuda opened this issue 2 years ago • 3 comments

The inference time during evaluation using dev/test set is very slow. While training happens very fast as expected the evaluation time is too large for GPU. Running the same experiments using TransformerDocumentEmbeddings model results in the expected lightning training and inference speed using the same datasets(I understand that the embedding model is much smaller than that of tars base)

Screenshots The below image is for training and evaluation using TransformerDocumentEmbeddings: image The below image is for training and evaluation using tars-base model: image

akshaykekuda avatar Jun 19 '22 15:06 akshaykekuda

Hi @akshaykekuda how many different labels do you have? Is num_negative_labels_to_sample set to the default? How many positive labels does one sentence have on average?

The training will create a sample for each positive label plus num_negative_labels_to_sample per sample. The evaluation will do one prediction per sample and label, hence it could be way more.

helpmefindaname avatar Jun 19 '22 22:06 helpmefindaname

I do have around 50 labels. Everything is set to default. The same dataset on a similar distil bert model finishes inference in 2 mins, while with tars base it takes 1 hour. Looks like something is off.

akshaykekuda avatar Jun 23 '22 14:06 akshaykekuda

2 minutes * 50labels = 100minutes (1.66hrs). I suppose the 2 minutes are rounded up? But the numbers sound fine to me.

helpmefindaname avatar Jun 24 '22 09:06 helpmefindaname

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 22 '22 19:10 stale[bot]