-
Notifications
You must be signed in to change notification settings - Fork 42
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
Update: add gpu option #6
base: master
Are you sure you want to change the base?
Conversation
Hi @gionanide , thank you for this contribution! I left a few comments in the code. Also, do you have any benchmark showing how using GPU can speed up the training process? It would be good to see some numbers in the readme file! |
@@ -18,11 +18,28 @@ R = np.array([ | |||
[0, 1, 5, 4], | |||
]) | |||
|
|||
|
|||
#because there are many dot products to calculate during the procedure, GPU can be used for this task |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this part can be simplified to as follows, because this is not an actual script that can be executed, but just a sample of how to use the module:
gpu = False # Set to True to use GPU in training and prediction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes you are right it is more clear like this, and also according to its significance it is better in the end of the arguments, as you proposed.
@@ -1,9 +1,15 @@ | |||
import pycuda.autoinit | |||
import pycuda.gpuarray as gpuarray | |||
import skcuda.linalg as linalg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good if you can add a requirements.txt
file to specify the dependencies. I didn't have one because it was only dependent on numpy before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I will write a .txt file like this and upload it.
Hello Albert @albertauyeung Because the matrix R in very small, the running time with and without GPU is the same, to see the difference you need to have bigger matrices. I can add in the read me file as comment the dimensions of a bigger array and the running times to illustrate the difference if you want. |
Looks good. Thanks! I will test and then merge soon. |
No description provided.