microsoft / rat-sql

A relation-aware semantic parsing model from English to SQL
https://arxiv.org/abs/1911.04942
MIT License
406 stars 117 forks source link

Could not enable GPU for Bert based model #8

Closed senthurRam33 closed 4 years ago

senthurRam33 commented 4 years ago

I am training the Bert based RATSQL model in Google colab pro. It takes roughly around 55 minutes for 10 steps. After started training, a warning pops up in the colab notebook. "WARNING: you are connected to a GPU runtime but not utilizing the GPU". After debugging the code, it shows that GPU is not enabled for Bert training. What can be done to enable CUDA? And please tell me what is the good environmental setup for training Bert based model?

senthurRam33 commented 4 years ago

After updating the CUDA package, this issue has been resolved. We can train the BERT in P100 but it may take upto a week

mellahysf commented 3 years ago

Hi @senthurRam33

Can you tel me please how to run RATSQL in Google colab? Precisely how to set up the environment based on docker ?

Thank you very much.

senthurRam33 commented 3 years ago

I didn't implement docker on colab as it is nearly impossible to run docker in that. I installed all the packages by mounting google drive on colab and started training. If the training stops, then I started retraining from the previously saved model using checkpoints

mellahysf commented 3 years ago

Thank you @senthurRam33 four your replay.

you said 'I installed all the packages by mounting google drive on colab' How did you do that? I have the problem of setting up the environment !!

senthurRam33 commented 3 years ago

Can you precisely tell me what's the problem??

mellahysf commented 3 years ago

Since it is impossible to use docker in colab, I want to set up manually the environment (installing packages and dependencies) in order to run RATSQL.

How to do that in colab?

senthurRam33 commented 3 years ago

--> First clone the repo in the google drive --> Then install all the packages required to run the repo --> Then upload the datasets in the drive --> Then run the commands given in the repo to start the training I would recommend you to use colab pro for faster training

mellahysf commented 3 years ago

I have the problem just in the second step. How to install all the packages required to run the repo ? By simply running 'pip install -r requirements.txt' ?

sorry for the perturbation

senthurRam33 commented 3 years ago

Yes. But in colab you run terminal commands like this "!pip install -r requirements.txt". But there are some packages that needs to be installed separetely. In my case, jsonnet and attr packages

mellahysf commented 3 years ago

it requires only: !pip install -r requirements.txt !pip install jsonnet !pip install attr for setting up the environment?

senthurRam33 commented 3 years ago

For me those are the ones that required. Just try to run the repo using the command. It will tell you what are the packages that you are missing

mellahysf commented 3 years ago

Thank you very much @senthurRam33 Just one more remark, I think it requires also running Stanford corenlp server, is it true ? if yes how?

senthurRam33 commented 3 years ago

Yes it requires that package too. Try installing with !pip install corenlp command

mellahysf commented 3 years ago

And I think also it requires python>=3.7 instead of the default python in colab which is 3.6.9

Thank you very much for all your help.

I will try to run it in colab.