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

fix calculation of max size needed to hold tensors #892

Merged
merged 21 commits into from
Jun 16, 2019

Conversation

ankan-ban
Copy link
Member

@ankan-ban ankan-ban commented Jun 16, 2019

  1. kNumFilters can be smaller than kNumInputPlanes. We need to take max of them for computing sizes of intermediate buffers.
  2. for wdl, we need 3x the memory for holding value head output.

use bestmove_is_sent_ for Search::IsSearchActive() (LeelaChessZero#502)
- replace all cudaMemcpyAsync used for loading weights with cudaMemcpy as  source (in CPU memory) could be deleted before the async version of the function actually does the copy.
- minor naming/style changes.
- add comment explaining what the policy map layer does and how the layout conversion from CHW to HWC works.
- just add template instantiations.
- verified that it works and provides a (very) slight speedup.
 - no of filters can be less than no. of input planes!
@ankan-ban ankan-ban requested a review from Tilps June 16, 2019 06:51
@oscardssmith
Copy link
Contributor

Why does wdl change the policy head?

@ankan-ban
Copy link
Member Author

It doesn't. I meant the value head. Updated description.

@ankan-ban ankan-ban merged commit 7615177 into LeelaChessZero:master Jun 16, 2019
@ankan-ban ankan-ban deleted the bugfix branch June 16, 2019 17:15
Tilps pushed a commit that referenced this pull request Jul 21, 2019
* fix maxSize for tensor buffers

 - no of filters can be less than no. of input planes!

* fix calculation for value head allocation too

- need 3x the size for wdl

* take max of all layers when computing size to avoid assumptions
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

Successfully merging this pull request may close these issues.

4 participants