JuliaGPU / JuliaGPU/GPUCompiler.jl

Some compilation failures result in nasty errors

Open
#213 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
187
Forks
68
Avg merge
1d 12h
Merged PRs (30d)
28

Description

e.g. with LLVM.jl on the `breaking changes` PR but GPUCompiler/CUDA.jl not, CUDA.jl gives:

```
ERROR: LoadError: LoadError: AssertionError: Core.Compiler.haskey(wvc, mi)
Stacktrace:
[1] ci_cache_populate(interp::GPUCompiler.GPUInterpreter, cache::GPUCompiler.CodeCache, mt::Nothing, mi::Core.MethodInstance, min_world::UInt64, max_world::Int32)
@ GPUCompiler ~/Julia/pkg/GPUCompiler/src/jlgen.jl:284
[2] compile_method_instance(job::GPUCompiler.CompilerJob, method_instance::Core.MethodInstance)
@ GPUCompiler ~/Julia/pkg/GPUCompiler/src/jlgen.jl:327
[3] macro expansion
@ ~/Julia/depot/packages/TimerOutputs/PZq45/src/TimerOutput.jl:226 [inlined]
[4] irgen(job::GPUCompiler.CompilerJob, method_instance::Core.MethodInstance)
@ GPUCompiler ~/Julia/pkg/GPUCompiler/src/irgen.jl:4
[5] macro expansion
@ ~/Julia/pkg/GPUCompiler/src/driver.jl:149 [inlined]
[6] macro expansion
@ ~/Julia/depot/packages/TimerOutputs/PZq45/src/TimerOutput.jl:226 [inlined]
[7] macro expansion
@ ~/Julia/pkg/GPUCompiler/src/driver.jl:148 [inlined]
[8] emit_llvm(job::GPUCompiler.CompilerJob, method_instance::Any; libraries::Bool, deferred_codegen::Bool, optimize::Bool, only_entry::Bool)
@ GPUCompiler ~/Julia/pkg/GPUCompiler/src/utils.jl:62
[9] codegen(output::Symbol, job::GPUCompiler.CompilerJob; libraries::Bool, deferred_codegen::Bool, optimize::Bool, strip::Bool, validate::Bool, only_entry::Bool, parent_job::Nothing)
@ GPUCompiler ~/Julia/pkg/GPUCompiler/src/driver.jl:58
[10] emit_function!(mod::LLVM.Module, job::GPUCompiler.CompilerJob, f::Function, method::GPUCompiler.Runtime.RuntimeMethodInstance)
@ GPUCompiler ~/Julia/pkg/GPUCompiler/src/rtlib.jl:68
[11] build_runtime(job::GPUCompiler.CompilerJob, ctx::LLVM.Context)
@ GPUCompiler ~/Julia/pkg/GPUCompiler/src/rtlib.jl:114
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure described with LLVM.jl on the breaking-changes PR while GPUCompiler and CUDA.jl are mismatched. Start in src/jlgen.jl at ci_cache_populate and follow the stack through src/irgen.jl, src/driver.jl, src/utils.jl, and src/rtlib.jl. Done means compilation failures report a useful error instead of the shown assertion, with regression coverage if an existing test location is identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.