Skip to content

Instantly share code, notes, and snippets.

@younesbelkada
Created November 10, 2022 11:19
Show Gist options
  • Save younesbelkada/afa873d4dfbea6a49268a6cffc55e8ed to your computer and use it in GitHub Desktop.
Save younesbelkada/afa873d4dfbea6a49268a6cffc55e8ed to your computer and use it in GitHub Desktop.

Bert large uncased - half - CUDA - T4

batch_size seq_len pad_percentage HF_time BT_time Speedup
8 64 0 0.025156218261718752 0.013504798583984375 1.8627614551432141
8 64 0.1 0.024825302734375 0.013796290283203125 1.7994187005908109
8 64 0.2 0.02481883056640625 0.013484359130859375 1.8405643401774714
8 64 0.5 0.02459789306640625 0.013327769775390625 1.8456120927167883
8 64 0.75 0.02464018310546875 0.01304416259765625 1.8889815977835211
8 128 0 0.02547349609375 0.0134563427734375 1.8930475035188665
8 128 0.1 0.0255438037109375 0.013838623046875 1.8458342007303776
8 128 0.2 0.02562197509765625 0.013650103759765626 1.8770535043974041
8 128 0.5 0.02571886474609375 0.0131774462890625 1.9517336046697331
8 128 0.75 0.025333615722656248 0.01315229736328125 1.9261741901747869
8 256 0 0.0258716455078125 0.014235115966796877 1.8174523880351656
8 256 0.1 0.02587228271484375 0.014193193359375 1.8228655144583361
8 256 0.2 0.02539270263671875 0.013467545166015624 1.8854737313816774
8 256 0.5 0.0260864404296875 0.013732843017578125 1.8995659089888886
8 256 0.75 0.026036142578125 0.013764832763671875 1.8914971961620592
batch_size seq_len pad_percentage HF_time BT_time Speedup
16 64 0 0.025781677246093752 0.01410529296875 1.8278016134235957
16 64 0.1 0.02556065673828125 0.014022840576171876 1.8227873731742237
16 64 0.2 0.025467412109374997 0.014076558837890624 1.809207236133806
16 64 0.5 0.02531725341796875 0.01339895751953125 1.8894942670774624
16 64 0.75 0.025573232421875 0.01396707275390625 1.8309657916489903
16 128 0 0.02635802734375 0.0142584423828125 1.8485909355374368
16 128 0.1 0.025796157226562498 0.014172303466796876 1.8201809809533216
16 128 0.2 0.0281596728515625 0.014656102294921876 1.9213616475179363
16 128 0.5 0.025650319824218754 0.013803294677734375 1.8582751743751738
16 128 0.75 0.0259761962890625 0.014016778564453125 1.8532215636864475
16 256 0 0.0267504638671875 0.0230415771484375 1.1609649675825906
16 256 0.1 0.0266965185546875 0.02136901611328125 1.2493096740235554
16 256 0.2 0.026101718750000003 0.01776152587890625 1.469565111013274
16 256 0.5 0.026359296875 0.014645411376953126 1.7998331488646695
16 256 0.75 0.02655657958984375 0.01391278076171875 1.9087902012309879
batch_size seq_len pad_percentage HF_time BT_time Speedup
64 64 0 0.0262995556640625 0.01964621826171875 1.3386574104853544
64 64 0.1 0.026344223632812504 0.018737479248046876 1.40596412591403
64 64 0.2 0.0266178759765625 0.016147353515625 1.6484358226755667
64 64 0.5 0.02638080078125 0.015347384033203126 1.718911882583817
64 64 0.75 0.0260063427734375 0.015106436767578127 1.721540504459203
64 128 0 0.0430806640625 0.03750741943359375 1.148590457916562
64 128 0.1 0.043006650390625005 0.03476615234375 1.237026460834583
64 128 0.2 0.043387553710937506 0.0319371875 1.3585276947426101
64 128 0.5 0.0433732421875 0.022888386230468752 1.8949890896965924
64 128 0.75 0.0432531884765625 0.014978743896484374 2.887637893769875
64 256 0 0.09337923828125 0.0786193017578125 1.187739348905764
64 256 0.1 0.09379266601562501 0.0742327490234375 1.2634944448307022
64 256 0.2 0.09353893554687501 0.06502940429687501 1.438409847948892
64 256 0.5 0.0939801171875 0.041531455078125 2.26286598942208
64 256 0.75 0.094655322265625 0.02300602294921875 4.114371374598639

Bert base uncased - half - T4

batch_size seq_len pad_percentage HF_time BT_time Speedup
8 64 0 0.011259946289062501 0.0064715625 1.7399115420831526
8 64 0.1 0.011087462158203125 0.00663257080078125 1.6716688733872442
8 64 0.2 0.011395234375 0.006564637451171875 1.7358512880198433
8 64 0.5 0.011138026123046875 0.006474192504882813 1.7203730217547
8 64 0.75 0.011569703369140625 0.006556705932617187 1.7645603582106115
8 128 0 0.014257119140625002 0.012094984130859375 1.178762947216203
8 128 0.1 0.014496824951171876 0.012211727294921875 1.1871232136996897
8 128 0.2 0.014793966064453126 0.010958970947265625 1.3499411701738628
8 128 0.5 0.013860137939453126 0.007878035278320311 1.7593394101185427
8 128 0.75 0.014368358154296877 0.006392376098632813 2.2477335395472036
8 256 0 0.029753046875 0.025368386230468748 1.1728395572622214
8 256 0.1 0.029978532714843752 0.024399189453124998 1.2286692052798567
8 256 0.2 0.030469296875 0.02030005126953125 1.5009467941951442
8 256 0.5 0.03072086181640625 0.013663634033203125 2.2483668504113505
8 256 0.75 0.030576337890625003 0.00718065673828125 4.258153398089282
batch_size seq_len pad_percentage HF_time BT_time Speedup
16 64 0 0.013830799560546876 0.01224318115234375 1.1296736843511626
16 64 0.1 0.014228476562500002 0.0114694970703125 1.2405493000498522
16 64 0.2 0.014384005126953125 0.011557879638671876 1.2445193735038758
16 64 0.5 0.013761381835937501 0.007544381713867188 1.824056941689862
16 64 0.75 0.01386477783203125 0.006603365478515625 2.09965325668267
16 128 0 0.027931621093749998 0.024239606933593748 1.1523132850409168
16 128 0.1 0.028122524414062502 0.023850888671875 1.1790975506595953
16 128 0.2 0.027926860351562503 0.020012564697265627 1.395466336974702
16 128 0.5 0.027516079101562497 0.013421179199218751 2.050198324090942
16 128 0.75 0.028191035156250002 0.007370257568359375 3.824972858109401
16 256 0 0.06028671386718751 0.0533044140625 1.1309891484127503
16 256 0.1 0.0601092041015625 0.049222275390625 1.221178899685955
16 256 0.2 0.059955771484375 0.042165073242187504 1.4219297364907062
16 256 0.5 0.059938652343749996 0.02651422607421875 2.260622360840155
16 256 0.75 0.059325317382812506 0.014698393554687501 4.0361769578480855
batch_size seq_len pad_percentage HF_time BT_time Speedup
64 64 0 0.051154638671874995 0.0442753857421875 1.1553742065567743
64 64 0.1 0.0511606884765625 0.043276474609375004 1.182182442963585
64 64 0.2 0.0517386669921875 0.041659267578125 1.2419485507074812
64 64 0.5 0.0511150732421875 0.02786785400390625 1.8341948122385985
64 64 0.75 0.051044619140625 0.017318992919921877 2.9473202845362243
64 128 0 0.10701274414062499 0.09994836914062499 1.0706802428167745
64 128 0.1 0.10738455078125 0.089402822265625 1.2011315533440257
64 128 0.2 0.10663646484375 0.08019868652343749 1.3296535076367648
64 128 0.5 0.105417900390625 0.05480259765625 1.9235931306004896
64 128 0.75 0.104776826171875 0.026630390625000003 3.9344832618982655
64 256 0 0.23075937500000002 0.21094093749999998 1.0939525429955959
64 256 0.1 0.23153876953125 0.196920390625 1.175798853518296
64 256 0.2 0.2286816015625 0.17352843750000002 1.3178335773495338
64 256 0.5 0.22876626953125 0.107109267578125 2.1358214345400968
64 256 0.75 0.2294320703125 0.05248962890625 4.37099813988552
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment