Skip to content

Subgroup2 Benchmark #190

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

Closed
wants to merge 19 commits into from
Closed

Subgroup2 Benchmark #190

wants to merge 19 commits into from

Conversation

devshgraphicsprogramming
Copy link
Member

No description provided.

@devshgraphicsprogramming devshgraphicsprogramming changed the title Subgroup2 Unit Test Subgroup2 Benchmark Apr 9, 2025
Comment on lines 690 to 696
options.spirvOptimizer = nullptr;
//#ifndef _NBL_DEBUG
// ISPIRVOptimizer::E_OPTIMIZER_PASS optPasses = ISPIRVOptimizer::EOP_STRIP_DEBUG_INFO;
// auto opt = make_smart_refctd_ptr<ISPIRVOptimizer>(std::span<ISPIRVOptimizer::E_OPTIMIZER_PASS>(&optPasses, 1));
// options.spirvOptimizer = opt.get();
//#endif
options.debugInfoFlags |= IShaderCompiler::E_DEBUG_INFO_FLAGS::EDIF_LINE_BIT;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you must use zero debug flags and a SPIR-V optimizer to get representable perf, just ask @Fletterio about his FFT examples

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's in the createShader method in main.cpp of example 28, but to get a standard optimizer + strip debug info you just provide an optimizer with a single strip debug info flag to the compiler.

I don't remember exactly whether this invokes other optimizations or just the strip debug

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should invoke the standard passes specified in the SPIRV compiler repo when you run with -O, but in that regard I think the intent of the optimizer is busted (providing a custom optimizer likely is intended to disable all other passes by default)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keptsecret you correctly optimize and strip bedug info in 23 the test, but not ex 29 the benchmark?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +374 to +397
// barrier transition to GENERAL
{
IGPUCommandBuffer::SPipelineBarrierDependencyInfo::image_barrier_t imageBarriers[1];
imageBarriers[0].barrier = {
.dep = {
.srcStageMask = PIPELINE_STAGE_FLAGS::NONE,
.srcAccessMask = ACCESS_FLAGS::NONE,
.dstStageMask = PIPELINE_STAGE_FLAGS::COMPUTE_SHADER_BIT,
.dstAccessMask = ACCESS_FLAGS::SHADER_WRITE_BITS
}
};
imageBarriers[0].image = dummyImg.get();
imageBarriers[0].subresourceRange = {
.aspectMask = IImage::EAF_COLOR_BIT,
.baseMipLevel = 0u,
.levelCount = 1u,
.baseArrayLayer = 0u,
.layerCount = 1u
};
imageBarriers[0].oldLayout = IImage::LAYOUT::UNDEFINED;
imageBarriers[0].newLayout = IImage::LAYOUT::GENERAL;

cmdbuf->pipelineBarrier(E_DEPENDENCY_FLAGS::EDF_NONE, { .imgBarriers = imageBarriers });
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you don't actually touch the image, you don't need to transition it (you may need to transition right after creation / first frame so validation layer doesn't complain about it being in UNDEFINED layout)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keptsecret do you need the pipeline barriers for Nsight to capture?

Comment on lines +502 to +525
// barrier transition to PRESENT
{
IGPUCommandBuffer::SPipelineBarrierDependencyInfo::image_barrier_t imageBarriers[1];
imageBarriers[0].barrier = {
.dep = {
.srcStageMask = PIPELINE_STAGE_FLAGS::COMPUTE_SHADER_BIT,
.srcAccessMask = ACCESS_FLAGS::SHADER_WRITE_BITS,
.dstStageMask = PIPELINE_STAGE_FLAGS::NONE,
.dstAccessMask = ACCESS_FLAGS::NONE
}
};
imageBarriers[0].image = m_surface->getSwapchainResources()->getImage(m_currentImageAcquire.imageIndex);
imageBarriers[0].subresourceRange = {
.aspectMask = IImage::EAF_COLOR_BIT,
.baseMipLevel = 0u,
.levelCount = 1u,
.baseArrayLayer = 0u,
.layerCount = 1u
};
imageBarriers[0].oldLayout = IImage::LAYOUT::TRANSFER_DST_OPTIMAL;
imageBarriers[0].newLayout = IImage::LAYOUT::PRESENT_SRC;

cmdbuf->pipelineBarrier(E_DEPENDENCY_FLAGS::EDF_NONE, { .imgBarriers = imageBarriers });
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

transition once to PRESENT and never touch later on

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me know if nsight needs some barrier usage of the swapchain in order to capture, I don't think it does

@keptsecret
Copy link
Contributor

Should close, replace with #192

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.

3 participants