#๐Ÿ”’ How to Run Colab 155,000 Data Entries Fast

202 messages ยท Page 1 of 1 (latest)

rough nebula
#

I have been trying to run a 155,000 data entries on Python and my Colab crashes, any suggestions?

granite wigeonBOT
#

@rough nebula

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

slim seal
#

What data? image, csv, excel, txt? Please elaborate more

elder sonnet
elder sonnet
#

because 155k entires in a csv normally wouldn't cause a crash

#

even in colab

rough nebula
#

Can I send you guys a link in DM

#

It has my personal email on it

elder sonnet
#

uh i think you can send the data in dm but i can't help you there

#

i'll have to send the help messages here (not the data though)

rough nebula
#

yeah just data

elder sonnet
#

how big is the file

rough nebula
#

Actually I'll send it here

#

I'll remove it after I am satisfied with the help

elder sonnet
#

oki

#

ok so which step is it crashing on

rough nebula
#

Train Roberta on NormBank using the features: setting, behavior, and constraints or Test Roberta on health-related test set

#

If it passes the former it will crash on the latter

elder sonnet
#

ok, trying now

#

oh ew i dont have access to the a100 gpu

rough nebula
#

I just brought Pro to see if it works on there

elder sonnet
#

will take a while to install transformers and torch and stuff, will get back here when it installs and runs

rough nebula
#

The writer of the code told me it runs on Colab

elder sonnet
#

oh it errors because i dont have NormBank.csv

#

can you send that

rough nebula
#

This has only 77500

elder sonnet
#

oki

#

do i just need to have this file in my drive and it'll be able to access it

rough nebula
#

Just upload file into Colab

elder sonnet
#

nvm im stupid

#

i see

rough nebula
#

Full dataset:

elder sonnet
#

ah thanks

#

how long does it take to train? and do i need to run a training to completion to reproduce your behavior?

#

or do i just need to start it

rough nebula
elder sonnet
#

yeah i'm running training now but does it need to finish training

rough nebula
#

yes

elder sonnet
#

it's been on epoch 1/7 for a few minutes now

#

because i can only run on a t4 gpu

rough nebula
#

yeah same thing happens to me

elder sonnet
#

oh

#

sad, so this'll take a while

#

how long does it take you to train

rough nebula
#

yeah lol

#

14 min - 3 hrs

#

this is for undergrad research

elder sonnet
#

damn

#

my undergrad ai research stuff takes like 1.5h on a 4090, but we run locally

rough nebula
#

I think I can connect to that

#

Is that faster?

elder sonnet
#

yeah

#

it's like the best nvidia gpu on the market

rough nebula
#

How do I connect my Colab to it

elder sonnet
#

consumer grade

#

uh i don't think it's an option in colab

#

you'd have to own one personally or rent it elsewhere

rough nebula
#

My teacher has one

elder sonnet
#

if you change runtime type to a100 though, that's probably the best you'll get

rough nebula
#

I can use his

elder sonnet
#

it's not going to be that much faster than an a100 on colab fwiw

#

but it's far better than a t4 for the free plans

rough nebula
#

So 4090 and A100 are same in computing time?

elder sonnet
#

not exactly the same but close enough iirc

#

in raw compute i think the 4090 is a bit faster but a100 has a bunch more vram so it can run much larger models than a 4090

rough nebula
#

damn

elder sonnet
#

just got to epoch 2/7

#

after like 15m

rough nebula
#

yeah it is slow ๐Ÿ˜ข

#

With A100 I got epich 2 in 2 mins

elder sonnet
#

oof

rough nebula
#

I am hoping it does not crash like in the latter step

elder sonnet
#

yeah we'll see

rough nebula
#

Which step are you on?

elder sonnet
#

setting behavior and constraint

rough nebula
#

Did you finish the step: Train Roberta on NormBank using the feature: setting-behavior

elder sonnet
#

i didnt realize that was also needed

rough nebula
#

So no way prevent Colab from crashing?

#

The program will crash eventually

elder sonnet
#

it hasnt crashed so i have no clue

#

when it crashes, do you get an error or does the window just go blank

rough nebula
#

error

#

runtime disconnected

elder sonnet
#

huh

#

do you have a traceback

rough nebula
#

nope

#

it said runtime disconnected

#

sometimes it went blank

elder sonnet
#

huh

#

and does it happen in the middle of a training

#

or right after it finishes

rough nebula
#

yeah

#

middle

elder sonnet
#

oh

rough nebula
#

my screen went blank

elder sonnet
#

and were you watching/clicking buttons consistently throughout the run

#

because there's an idle timeout of 90m

rough nebula
#

just watching

elder sonnet
#

and if it runs more than 12h total it automatically disconnects

elder sonnet
#

honestly training models in colab for research is probably not the best way to do it, it'd be much more reliable to run it locally on a jupyter notebook or something if you have a strong enough gpu

rough nebula
#

you mean 90 min?

elder sonnet
#

90m = 90 minutes, 12h = 12 hours

rough nebula
#

then i was clicking buttons too

elder sonnet
#

in this case ofc

rough nebula
#

i thought 90 ms

elder sonnet
#

and did you have the colab notebook open for >12 hours

rough nebula
#

nope

elder sonnet
#

huh

#

what browser are you using

rough nebula
#

chrome

elder sonnet
#

ok

#

do you have any extensions

rough nebula
#

Train Roberta on NormBank using the features: setting, behavior, and constraints took 12 minutes to get epoch 2

elder sonnet
rough nebula
#

JSonVue

elder sonnet
#

any others?

rough nebula
#

And some proctoring app

#

Thats all

elder sonnet
#

ah well the proctoring app could cause issues

#

they're known to do such things because of how intrusive they are

rough nebula
#

ok removed it

elder sonnet
#

ok, try restarting the runtime now

#

clean slate

#

if this doesn't work then all i can advise would be to just run the model on your teacher's 4090

rough nebula
#

how to i do that from colab?

elder sonnet
#

the best way to do it would be not to run it on colab but rather local jupyter notebooks, but if you really need colab then local runtimes are the way to go

rough nebula
#

if i do 4090 do i run my codeb on vscode or locally

elder sonnet
#

both could work

rough nebula
#

how do i run on it the server because the .py file is on my pc not on server

elder sonnet
#

wdym on the server

#

is the 4090 on a server

#

if it's a linux server, i'd recommend SSHing in

#

otherwise you could remote desktop

rough nebula
#

yeah i it is linux server

elder sonnet
#

ok then use ssh or vnc

rough nebula
#

i sshed into it

#

i sshed into it

elder sonnet
#

ok

#

then you can just run python3 myscript.py from the ssh terminal

#

replace myscript with the name of the python file

rough nebula
#

python3: can't open file '/home/zhyahya/CSI_4495.py': [Errno 2] No such file or directory

elder sonnet
#

hm

rough nebula
#

do i have to create a python file on my server account

elder sonnet
#

yes

rough nebula
#

oh ok

rough nebula
#

any updates?

elder sonnet
#

just finished for me

#

so i'm starting the health run now

rough nebula
#

wtf... it crashed for me

elder sonnet
#

oh shoot

#

i accidentally terminated the runtime

#

shit im sorry

rough nebula
#

oh well thanks for your help

#

and time

elder sonnet
#

np, if you need help setting up the sshing and local running in the future or now then i'd be happy to help here again

rough nebula
#

ok ill do that rn

elder sonnet
#

oki

rough nebula
#

how do i transfer my CSV file on to it

elder sonnet
#

uh

#

do you have vscode installed on both machines perchance

rough nebula
#

nope

#

just on local pc

#

my pc

elder sonnet
#

ok

#

ok and are you on windows

#

if so, you can run on powershell SCP file.py remote_username@remote_ip:/home/yourusername/folder

rough nebula
#

do i connect ssh first

elder sonnet
#

yes

#

wait

#

it doesnt matter actually

#

but the powershell part shoudl run on your windows machine

rough nebula
#

and file.py is the nane of file on my pc

elder sonnet
#

yes

rough nebula
#

CSI_4995.py: No such file or directory

elder sonnet
#

ugh

rough nebula
#

thats the name

elder sonnet
#

what folder is that file in

#

on windows

#

you'll want to be in the directory of that file in powershel

rough nebula
#

my user folder

elder sonnet
#

or else pass the path from your current powershell directory

#

ok is the powershell terminal inside your user folder

#

if you ran it as admin it won't be by default

rough nebula
#

ok.. i got to go, but thank you for your time and help

#

!close

granite wigeonBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.