Add compiler stress test for broadcasts#2471
Conversation
…Core.jl into pb/stress-tests
This reverts commit b69d63f.
|
@dennisYatunin @imreddyTeja if you guys get a chance can you check if this is headed in the right direction? |
I don't know exactly what the goals of these tests are, but the test cases do seem good to me. I don't think any similar tests exist at the moment. Another case that might be good to test is everything you have done, but with more complex types. For example, many of the operations can work with nested named tuple |
imreddyTeja
left a comment
There was a problem hiding this comment.
I think the tests themselves cover a good range of broadcast cases. Most of my comments are my thoughts on what might be a more idiomatic way to accomplish this, but running each test in a subprocess probably makes those difficult. I think this is ready to merge, but I didn't look at the parsing functionality very closely.
|
|
||
| # Build command: skip srun if parent is already in srun to avoid resource contention | ||
| if in_srun | ||
| cmd = `$(Base.julia_cmd()) --startup-file=no --project=$(PROJECT_DIR) $tmp_file` |
There was a problem hiding this comment.
I wonder if this could be done using Expr(s) rather than writing strings to a temporary file. I'm not sure that if that has any advantages, but I think it is more idiomatic
There was a problem hiding this comment.
Should this file live in perf? It isn't clear to me what the distinction between perf and test is, but the other scripts in perf are not used from the test folder.
There was a problem hiding this comment.
The examples @dennisYatunin sent me put them under the test directory:
- https://github.com/JuliaLang/julia/blob/v1.11.9/test/compiler/inline.jl
- https://github.com/JuliaGPU/CUDA.jl/blob/v5.11.0/test/core/device/array.jl
I could see this fitting in test/gpu. That make sense to you?
| # ============================================================================ | ||
|
|
||
| """ | ||
| generate_field_test_code(test_name::String, test_impl::String) -> String |
There was a problem hiding this comment.
I might be missing something obvious, but what does the name test_impl signify?
There was a problem hiding this comment.
Added a docstring for this.
| "" | ||
| end | ||
|
|
||
| return """ |
There was a problem hiding this comment.
It seems like most of this could be non-generated if the functions take test_name and/or test_impl as arguments. Maybe code gen or generated functions would be applicable here.
This adds a script that runs a bunch of different broadcast types and complexities with CUDA to see where inlining or overall compilation fails. I realize this is a giant 2.5k line script, but it's all self-contained, so if it's not useful it can easily be deleted later.
This PR also adds a few unit tests on the brink of failure to make sure we don't regress there. In fact, one of them actually fails with Julia v1.10 and passes with 1.11.
TODO
Sample result for the full suite
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show
show