Is there GPU support for the MatLab GitHub BERT Model?
2 ビュー (過去 30 日間)
古いコメントを表示
Bijan Sahamie
2022 年 2 月 21 日
コメント済み: David Willingham
2022 年 2 月 27 日
MatLab does not seem to natively support models like BERT, but there is a Gihub repository where pre-trained BERT models can be loaded.
However, to me this seems a little "workaorundy" and totally side-stepped from the standard architecture and workflow that the deep learning toolbox brings to MatLab. As painful as this is (for now I can live with this), my main problem the following:
I was not able to figure out how to use that code --for instance, using the pretrained BERT or FinBert-- with my GPU (GPU works, MatLab finds it, etc...). Inferencing on a relatively small dataset takes ages (>25 mins) compared to ~3 mins with GPU using a similar model and identical dataset in Tensorflow.
Help would be much appreciated. Thanks.
2 件のコメント
Walter Roberson
2022 年 2 月 21 日
in FineTuneBERT.m did you experiment with changing
mbqTrain = minibatchqueue(cdsTrain,2,...
"MiniBatchSize",miniBatchSize, ...
"MiniBatchFcn",@(X,Y) preprocessMiniBatch(X,Y,paddingValue,maxSequenceLength), ...
"PartialMiniBatch","discard");
to include 'OutputEnvironment',{'gpu','cpu'} ?
採用された回答
David Willingham
2022 年 2 月 24 日
Hi Bijan,
Did walter's comment help speed up your training? What version of MATLAB are you using?
On your comments regarding the Transformer models implementation. We currently don't have the inbuilt layers to support transformers, however the flexibility of the framework allows for users to create their own model functions when inbuilt layers don't exist. For more information on this, see this page Train Deep Learning in MATLAB. As you've pointed out though, this implementation does require more work to achieve the same benefits as compared to have full layer support. For reference we are actively looking at supporting more layers for Transformers in a future release.
2 件のコメント
David Willingham
2022 年 2 月 27 日
Hi Bijan,
Thanks for spending the time to give your comprehensive feedback. Whilst I can't offer an immediate solution to all of the areas you have listed, what I can state is our development team is actively working on: adding more layer support, improving training performance and enabling our importers to import more networks.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Deep Learning Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!