-
Notifications
You must be signed in to change notification settings - Fork 53
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
Updates for Julia 1.12 #656
Conversation
@@ -518,7 +542,7 @@ end | |||
function ci_cache_lookup(cache, mi, min_world, max_world) | |||
wvc = WorldView(cache, min_world, max_world) | |||
ci = CC.get(wvc, mi, nothing) | |||
if ci !== nothing && ci.inferred === nothing | |||
if VERSION < v"1.12.0-DEV.1434" && ci !== nothing && ci.inferred === nothing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this; we encounter CIs with inferred
set to nothing, and those seem safe to pass to codegen now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally most CI should have their value set to nothing
. Anything else you might have observed (whether on this version or in the past) is a transient state and can change concurrently, so is unsafe to rely upon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you're saying that check is not necessary? If I don't forcibly populate our CI cache for CIs with ci.inferred == nothing
, codegen calls into inference which is disallowed (Refusing to automatically run type inference with custom cache lookup.
). On 1.11, at least.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #656 +/- ##
=======================================
Coverage 74.18% 74.18%
=======================================
Files 24 24
Lines 3300 3312 +12
=======================================
+ Hits 2448 2457 +9
- Misses 852 855 +3 ☔ View full report in Codecov by Sentry. |
c125f6c
to
74f7602
Compare
@test occursin(r"\.type.*(julia|j)_[[:alnum:]_.]*child1_\d*,@function", asm) | ||
@test occursin(r"\.type.*(julia|j)_[[:alnum:]_.]*child2_\d*,@function", asm) | ||
|
||
asm = sprint(io->GCN.code_native(io, mod.parent2, Tuple{Int}; dump_module=true)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@test occursin(r"\.type.*(julia|j)_[[:alnum:]_.]*child1_\d*,@function", asm) | |
@test occursin(r"\.type.*(julia|j)_[[:alnum:]_.]*child2_\d*,@function", asm) | |
asm = sprint(io->GCN.code_native(io, mod.parent2, Tuple{Int}; dump_module=true)) | |
@test occursin(r"\.type.*(julia|j)_[[:alnum:]_.]*child1_\d*,@function", asm) | |
@test occursin(r"\.type.*(julia|j)_[[:alnum:]_.]*child2_\d*,@function", asm) | |
@test occursin(r"\.type.*(julia|j)_[[:alnum:]_.]*child1_\d*,@function", asm) | |
@test occursin(r"\.type.*(julia|j)_[[:alnum:]_.]*child2_\d*,@function", asm) |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@test occursin(r"s_add_u32.*(julia|j)_child_.*@rel32@", asm) | ||
@test occursin(r"s_addc_u32.*(julia|j)_child_.*@rel32@", asm) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@test occursin(r"s_add_u32.*(julia|j)_child_.*@rel32@", asm) | |
@test occursin(r"s_addc_u32.*(julia|j)_child_.*@rel32@", asm) | |
@test occursin(r"s_add_u32.*(julia|j)_child_.*@rel32@", asm) | |
@test occursin(r"s_addc_u32.*(julia|j)_child_.*@rel32@", asm) |
@test occursin(r"\.type.*(julia|j)_[[:alnum:]_.]*child_\d*,@function", asm) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@test occursin(r"\.type.*(julia|j)_[[:alnum:]_.]*child_\d*,@function", asm) | |
@test occursin(r"\.type.*(julia|j)_[[:alnum:]_.]*child_\d*,@function", asm) | |
@test occursin(r"\.type.*(julia|j)_[[:alnum:]_.]*child_\d*,@function", asm) |
@test occursin(r"\.type.*(julia|j)_[[:alnum:]_.]*child1_\d*,@function", asm) | ||
@test occursin(r"\.type.*(julia|j)_[[:alnum:]_.]*child2_\d*,@function", asm) | ||
|
||
asm = sprint(io->GCN.code_native(io, mod.parent2, Tuple{Int}; dump_module=true)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@test occursin(r"\.type.*(julia|j)_[[:alnum:]_.]*child1_\d*,@function", asm) | |
@test occursin(r"\.type.*(julia|j)_[[:alnum:]_.]*child2_\d*,@function", asm) | |
asm = sprint(io->GCN.code_native(io, mod.parent2, Tuple{Int}; dump_module=true)) | |
@test occursin(r"\.type.*(julia|j)_[[:alnum:]_.]*child1_\d*,@function", asm) | |
@test occursin(r"\.type.*(julia|j)_[[:alnum:]_.]*child2_\d*,@function", asm) | |
@test occursin(r"\.type.*(julia|j)_[[:alnum:]_.]*child1_\d*,@function", asm) | |
@test occursin(r"\.type.*(julia|j)_[[:alnum:]_.]*child2_\d*,@function", asm) |
@test contains(ir, r"(julia|j)_identity") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@test contains(ir, r"(julia|j)_identity") | |
@test contains(ir, r"(julia|j)_identity") | |
@test contains(asm, r"(julia|j)_identity") |
@@ -187,7 +187,7 @@ end | |||
ir = sprint(io->Native.code_llvm(io, valid_kernel, Tuple{}; optimize=false, dump_module=true)) | |||
|
|||
# module should contain our function + a generic call wrapper | |||
@test occursin(r"define\ .* void\ @.*julia_valid_kernel.*\(\)"x, ir) | |||
@test occursin(r"define\ .* void\ @.*(julia|j)_valid_kernel.*\(\)"x, ir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@test occursin(r"define\ .* void\ @.*(julia|j)_valid_kernel.*\(\)"x, ir) | |
@test occursin(r"define\ .* void\ @.*(julia|j)_valid_kernel.*\(\)"x, ir) |
@@ -149,7 +149,7 @@ end | |||
end | |||
|
|||
asm = sprint(io->PTX.code_native(io, mod.parent, Tuple{Int64})) | |||
@test occursin(r"call.uni\s+julia_child_"m, asm) | |||
@test occursin(r"call.uni\s+(julia|j)_child_"m, asm) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@test occursin(r"call.uni\s+(julia|j)_child_"m, asm) | |
@test occursin(r"call.uni\s+(julia|j)_child_"m, asm) |
@test !occursin(r"\.visible \.func (julia|j)_nonentry", asm) | ||
@test occursin(r"\.func (julia|j)_nonentry", asm) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@test !occursin(r"\.visible \.func (julia|j)_nonentry", asm) | |
@test occursin(r"\.func (julia|j)_nonentry", asm) | |
@test !occursin(r"\.visible \.func (julia|j)_nonentry", asm) | |
@test occursin(r"\.func (julia|j)_nonentry", asm) |
@test occursin(r"\.func (julia|j)_child_", asm) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@test occursin(r"\.func (julia|j)_child_", asm) | |
@test occursin(r"\.func (julia|j)_child_", asm) | |
@test occursin(r"\.func (julia|j)_child_", asm) |
@test occursin(r"\.func (julia|j)_child1_", asm) | ||
@test occursin(r"\.func (julia|j)_child2_", asm) | ||
|
||
asm = sprint(io->PTX.code_native(io, mod.parent2, Tuple{Int})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@test occursin(r"\.func (julia|j)_child1_", asm) | |
@test occursin(r"\.func (julia|j)_child2_", asm) | |
asm = sprint(io->PTX.code_native(io, mod.parent2, Tuple{Int})) | |
@test occursin(r"\.func (julia|j)_child1_", asm) | |
@test occursin(r"\.func (julia|j)_child2_", asm) | |
@test occursin(r"\.func (julia|j)_child1_", asm) | |
@test occursin(r"\.func (julia|j)_child2_", asm) |
@@ -89,7 +89,7 @@ end | |||
end | |||
|
|||
asm = sprint(io->SPIRV.code_native(io, kernel, Tuple{Bool}; kernel=true)) | |||
@test occursin(r"OpFunctionCall %void %julia_error", asm) | |||
@test occursin(r"OpFunctionCall %void %(julia|j)_error", asm) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@test occursin(r"OpFunctionCall %void %(julia|j)_error", asm) | |
@test occursin(r"OpFunctionCall %void %(julia|j)_error", asm) |
The compiler has changed a lot:
SOURCE_MODE_FORCE_SOURCE
removaljl_emit_native
instead ofjl_create_native
AFAIU, as explained by @vtjnash, this now means GPUCompiler.jl has to collect all code instances involved in a compilation job, and make sure type inference has run on them so that the cache is primed (as codegen no longer can recurse back into inference). The implementation for that is based on https://github.com/JuliaLang/julia/blob/0d6bd8cbe4673e7c7eb6237cc18de968b9bbdf63/Compiler/src/typeinfer.jl#L1296-L1325.
@vtjnash Added some questions for you inline.