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

About Performance. #1

Open
KelSolaar opened this issue Mar 24, 2017 · 3 comments
Open

About Performance. #1

KelSolaar opened this issue Mar 24, 2017 · 3 comments

Comments

@KelSolaar
Copy link

Hi @crowsonkb/Katherine,

I wanted to discuss performance here, what are the gain compared to a classic Numpy implementation, especially in regard to the following comment:

Theano can compile it to use a GPU but this was found to run slower.

Cheers,

Thomas

@crowsonkb
Copy link
Owner

I implemented it in Numpy first and the result was extremely slow, especially since I had to compute derivatives via finite differences. The performance gain from switching to Theano on the CPU was at least a hundredfold. I am not sure which part is general Theano optimization and which part is having an analytical gradient. I suspect it runs slower on the GPU because the batch size is relatively small (for a 30-step color gradient, only 90 parameters!) but haven't checked the relative performance at absurd numbers of steps yet.

@crowsonkb
Copy link
Owner

At 16384 steps the GPU starts to close the gap: it took 23 seconds for the default gradient to converge vs 20 on the CPU. I am inclined to think batch size is the answer here. GPUs are massively parallel and quite inefficient on small amounts of data.

@KelSolaar
Copy link
Author

Thanks for the details, it is appreciated.

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