Back to Annotated Deep Learning Paper Implementations

LLM.INT8භාවිතා කරමින් ජීපීටී-නියෝක්ස් තක්සේරු කරන්න () පරීක්ෂණ කට්ටලය මත ප්රමාණකරණය

docs/si/neox/evaluation/half_precision.html

latest1.8 KB
Original Source

homeneoxevaluation

View code on Github

#

LLM.INT8භාවිතා කරමින් ජීපීටී-නියෝක්ස් තක්සේරු කරන්න () පරීක්ෂණ කට්ටලය මත ප්රමාණකරණය

මෙමකේතය කාර්යයන් කට්ටලයකින් භාවිතා කරමින් ජීපීටී-නියෝක්ස් ඇගයීමට ලක් කරයි.

12importargparse1314importtorch15fromtorchimportnn1617fromlabml\_nn.neox.evaluationimportrun\_eval\_harness18fromlabml\_nn.neox.modelimportLayerGenerator

#

21defmain():

#

තර්ක විතර්ක

23parser=argparse.ArgumentParser()2425parser.add\_argument("--flash",action='store\_true',help="whether to use Flash Attention")2627opt=parser.parse\_args()

#

උපාංගය

30device=torch.device('cuda:0')

#

ස්ථරපූරණය කරන්න

32layers=list(LayerGenerator(is\_clone\_layers=True,33filter\_layers=None,34dtype=torch.float16,35device=device,36is\_flash\_attention=opt.flash,37).load())

#

nn.Sequential ආකෘතිය සාදන්න

40model=nn.Sequential(\*layers)

#

ඇගයීම් පටි ධාවනය කරන්න

43print(run\_eval\_harness(model,'half\_precision',['lambada'],device))

#

47if\_\_name\_\_=='\_\_main\_\_':48main()

Trending Research Paperslabml.ai