Default construct QueryPool with nonzero values #3721
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
We must bugfix this first to unblock either dumping querypool directly after inference or SDK development
Currently, if you try to init QueryPool during inference, it will crash at
vkCreateQueryPool
. Some debugging revealed in the test binary, it will crash only on VulkanComputeGraphTest but not VulkanComputeAPITest.It is because the
Context
instance is initialized in two different ways and thenQueryPoolConfig
is then initialized in two different ways.Static singleton https://fburl.com/code/iqo8xcg2 with above nonzero max query count and the compile time flag to change the query pool. We don't use this for model inference.
Explicit constructor https://fburl.com/code/m1xga4ra, invoked in
VulkanBackend::Init()
https://fburl.com/code/4j8y3pzu which goes through default construction ofGraphConfig
, default construction ofQueryPoolConfig
, leading to zero max query count and crash. We use this for model inference.This should be probably be unified, as it was extremely confusing to have the compile time flag work in non inference cases but not in inference case, and explicit const struct construction happens in the former vs completely default struct construction in the latter.
A quick solution to unblock.
QueryPoolConfig
has default init values of the compile time flags.Reviewed By: SS-JIA
Differential Revision: D57735873