-
Notifications
You must be signed in to change notification settings - Fork 86
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
WIP: Experimental reconvergence tests #2916
base: main
Are you sure you want to change the base?
WIP: Experimental reconvergence tests #2916
Conversation
* Partial framework implemented
* Added more ops * Moved infrastructure into a utility file
* Refactor executing the program into a helper function * Add some predefined testcases in a separate group * Add comments and improve enum names * Add ballot, store, and return ops
* Very basic result checking
* Switch from var to let in most places * Add buffer checking * Fix some bugs: * all * simulation of IfId
* Add infinite for loops and elects * remove tabs * small optimizations to simulation runtime * add a predefined case with infinite for loop
* Add a variable based for that iterates based on subgroup id * Add a predefined test case to cover it
* program generation, code generations, and simulation * Add a predefined program that is run for both workgroup and maxial reconvergence
* Fixed a bug in the shader code for testbit * couldn't select bits [96,127] * Fix a bug in ForVar simulation * didn't loop correctly * Refactored some simulation code to reduce duplication
* added infinite loop * added better safeguards for program length * optimized simulation runtime * fixed a couple bugs
* remove the locations buffer * cap the maximum number of locations per invocation such that the buffer size is guaranteed < 256MB * fix simulation of return in main function * remove checking of last buffer value in UCF tests
* Add debug functions for dumping info * remove some logging * removve some default parameters to ensure consistency * change some limits to improve runtime performance * Add loop reduction factors to improve runtime performance * ForVar, ForInf, and LoopInf will execute half as many when inside 1 loop and a quarter inside 2 * Made all stores unique * identical else blocks previously reused values
* refactored test code * each reconvergence style is now a separate set of tests * Added more switch varieties * added predefined tests for coverage * fixed simulation of ForVar * reduction was incorrectly handled * fixed result comparison for ucf cases * fixed how ucf is calculated * more documentation
* requires unsafe typecast for experimental feature
* WGSLv1 style is a closer match to current WGSL spec * doesn't require loops to converge between iterations * added predefined and random test suites to exercise it * refactored uniform tests for reuse * improved loop continue ballot generation to avoid false errors * added a new predefined test that could distinguish between Workgroup and WGSLv1 reconvergence
* Add no-op code fragments at low frequency * Increase number of random testcases
* fix errors from npm run fix
af52f07
to
b8f7b88
Compare
Previews, as seen when this build job started (b8f7b88): |
I tried the fixed tests on a Pixel 6 Chrome Canary, with the enable-unsafe-apis flag and it couldn't acquire the device. |
@dneto0 from the logs this may have been due to too many GPU process crashes. You can try restarting the browser and running a single test to see if it works. (I was able to get results on Pixel 6 Pro, though in the Android 14 beta so maybe the driver has some bugfixes.) |
* The simulation incorrectly marked some continues as non-uniform * this leads to some ballots being marked with the special value * in WGSLv1, Workgroup, and Subgroup styles this would lead to fewer ballots being checked (so likely no change in results) * in Maximal though, this leads to some ballots being a wacky value and extra failures
FYI the latest commit fixes a bug that likely resulted in false negatives for maximal reconvergence tests. It likely has no affect on the other styles of reconvergence. |
Previews, as seen when this build job started (d7ea45d): |
* Added a new test suite 'uniform_maximal' that tests that ballots all work as expected when no divergent branches exist in the code * The generator has a mode to only generate uniform conditions * removes several if, loop, and switch styles * restricts types of breaks and continues that generated * removes the generation of the election based noise operation * Adds a predefined test to cover some operations
Previews, as seen when this build job started (8072695): |
Fro those coming new to this, all the tests here are under Pre-canned tests useful for playing around are:
There are other "random" tests that are for stress testing, running hundreds of iterations. replace
|
This PR is mainly to make these tests more easily accessible to run.
Experimental reconvergence tests to investigate portability of subgroup operations across platforms
The tests utilize an experimental chromium extension that exposes subgroupBallot(), subgroup_invocation_id, and subgroup_size. They are based on Vulkan CTS tests (some are experimental) and test a variety of reconvergence styles:
The test infrastructure simulates a program (either pseudo-random or predefined) and compares the results against a GPU run. It runs 128 invocations in a single workgroup (largest possible subgroup). The random program generator is parameterized to avoid excessive runtime or memory usage, but further testing is needed on a variety of devices to properly tune those parameters. Expect a few timeouts. Currently only runs 15 predefined cases and 100 random cases per reconvergence style, but ideally significantly more random tests would be run for more confidence in the results.
Issue: #
Requirements for PR author:
.unimplemented()
./** documented */
and new helper files are found inhelper_index.txt
.Requirements for reviewer sign-off:
When landing this PR, be sure to make any necessary issue status updates.