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

StarSpace GPU working? #2

Open
geirberge opened this issue Jan 22, 2018 · 6 comments
Open

StarSpace GPU working? #2

geirberge opened this issue Jan 22, 2018 · 6 comments
Labels

Comments

@geirberge
Copy link

When running starspace from docker-master/starspace/gpu/ the CPU is activated but not the GPU.
Is there an error?

BR

@loretoparisi
Copy link
Owner

@bluebyte9001 I will check it out, thanks.

@loretoparisi
Copy link
Owner

@bluebyte9001 I have checked your issue.
When using gpu/build.sh you came out with a cuda:8.0 supported ubuntu, once you have a gpu. At that point running nvdia-smi you should see some output like:

cd gpu/
$ ./run.sh 
# nvidia-smi
Tue Mar 28 22:25:50 2017       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 367.57                 Driver Version: 367.57                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GRID K520           Off  | 0000:00:03.0     Off |                  N/A |
| N/A   41C    P8    17W / 125W |      0MiB /  4036MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID  Type  Process name                               Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-

If so the gpu is connected via nvidia-docker. Hope this helps. Feel free to re-open if need more help!

@geirberge
Copy link
Author

Thank you.

I run 384.111 version of nvndia driver, with cuda 8. I get the nvidia-smi to work as outlined by you,
but only after editing run.sh as follows (edits: added the --runtime=nvidia parameter, updated nvidia version):
docker run --runtime=nvidia --rm -it --device=/dev/nvidiactl --device=/dev/nvidia-uvm
--device=/dev/nvidia0 -v nvidia_driver_384.111:/usr/local/nvidia:ro -v ml:/home/user/ml:rw --name $IMAGE $IMAGE $CMD

The main issue is connected to Starspace's lack of utilization of the GPU. It only uses the CPU.
The GPU-util is not changing when running nvidia-smi while running Starspace.

@geirberge
Copy link
Author

I thought Starspace was modified in your package to run on GPU. But I guess not? I cannot find so much information on Starspace, but fasText is a Facebook relative:
"Can we run fastText program on a GPU?
FastText only works on CPU for accessibility. That being said, fastText has been implemented in the caffe2 library which can be run on GPU."

@loretoparisi
Copy link
Owner

loretoparisi commented Mar 11, 2018

@bluebyte9001 yes I can confirm that fastText and Starspace only run on CPU in the default C++ implementation. I'm aware there were some attempts to run on GPU, but unofficial. Also consider that, while FastText does not use any BLAS library, Starspace is using the Boost library - see facebookresearch/StarSpace#49 about this. By the way, I have asked the FastText Facebook community here about the GPU and Caffe2, since I cannot see any reference to the FastText API in the current Caffe2 C++/Python API. Also I will re-open this, let's collect more info.

@geirberge
Copy link
Author

Thanks a lot for checking out. Would have been nice to have either or both run on the gpu.

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

No branches or pull requests

2 participants