Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ch9 - training deep neural network - how to attach GPU? #165

Closed
jgammerman opened this issue Feb 10, 2023 · 7 comments
Closed

Ch9 - training deep neural network - how to attach GPU? #165

jgammerman opened this issue Feb 10, 2023 · 7 comments

Comments

@jgammerman
Copy link

jgammerman commented Feb 10, 2023

@lakshmanok - regarding my earlier issue (#164), I've ended up manually exporting the data from BQ to cloud storage using the GUI.

The rest of the notebook is working fine, but now I'm training the deep neural network it's awfully slow (I'm still on the first of the 10 epochs and it's not even half way through it after 10 minutes!).

I'm guessing that the problem is that I'm using CPUs rather than a GPU...on p.322 of the book you state "Making sure that the Vertex AI Workbench notebook that I’m working on has a GPU attached to it, I can now launch off the training job..." but if I'm not mistaken it's not covered in the textbook or notebook how to do this?

I've already set up my fully-managed notebook to enable an NVIDIA T4 GPU, but I believe that it won't be attached automatically without me doing something else.

image

The GC docs refer to creating a separate CustomJob to achieve this - is that what you did or is there a quicker way?

@lakshmanok
Copy link
Contributor

lakshmanok commented Feb 10, 2023 via email

@jgammerman
Copy link
Author

Still no quicker I'm afraid - one epoch is taking about 20 minutes...

My notebook instance now comes with a GPU:

image

And when starting the notebook I've selected as my kernel Tensorflow 2 (Local), previously it was Python (local) :

image

I can't see any other options for specifying that my GPU should be used...

@jgammerman
Copy link
Author

jgammerman commented Feb 10, 2023

Also - I have a really dumb question but it's come up before in this book so I may as well ask it now...

I'd like to see the CPU/GPU usage of the VM that my notebook is running on. In other cloud platforms (eg. Azure) you have to connect the notebook to a VM manually every time, which makes this easy to do.

But in GCP, everything seems to happen in the background and it's not clear how to inspect your VM....if I go to the VM Instances API in the console, it looks like I don't have any:

image

Please could you advise? Sorry if this is a stupid question but I'm guessing it's not just me who is confused!

@lakshmanok
Copy link
Contributor

lakshmanok commented Feb 10, 2023 via email

@jgammerman
Copy link
Author

jgammerman commented Feb 10, 2023

  1. Oh I changed DEVELOP=True to DEVELOP=False after successfully running 2 epochs very quickly, under a minute as you said. The flow of the Jupyter notebook is somewhat different to the textbook chapter so I thought that was what I was supposed to do - maybe not!

  2. Unfortunately I can't see any Monitoring tab, only Logs:

image

Thanks for these quick response by the way...I'll be sure to mention them in the glowing Amazon review I give of the book once I'm done with it!

@lakshmanok
Copy link
Contributor

lakshmanok commented Feb 10, 2023 via email

@jgammerman
Copy link
Author

I see! Thank you Lak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants