Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ CUDA_Tile_jll = "2068806d-a867-5dbd-af0e-42c2eb5d895d"
CompilerCaching = "9db33cc3-5358-4881-8759-fa4194144afd"
EnumX = "4e289a0a-7415-4d19-859d-a7e5c4648b56"
GPUArrays = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7"
GPUCompiler = "61eb1bfa-7361-4325-ad38-22787b887f55"
GPUToolbox = "096a3bc2-3ced-46d0-87f4-dd12716f4bfc"
IRStructurizer = "93e32bba-5bb8-402b-805d-ffb066edee93"
LMDB = "11f193de-5e89-5f17-923a-7d207d56daf9"
Expand Down Expand Up @@ -43,6 +44,7 @@ CompilerCaching = "0.3.1, 0.4"
DLFP8Types = "0.1.0"
EnumX = "1.0"
GPUArrays = "11"
GPUCompiler = "2.4"
GPUToolbox = "3"
IRStructurizer = "0.6.3"
LMDB = "3"
Expand All @@ -53,3 +55,7 @@ REPL = "1"
SHA = "0.7.0"
Scratch = "1.2"
julia = "1.11"

[sources]
CompilerCaching = {url = "https://github.com/AntonOresten/CompilerCaching.jl", rev = "concurrent-const-seed"}
GPUCompiler = {url = "https://github.com/AntonOresten/GPUCompiler.jl", rev = "inference_batch"}
2 changes: 1 addition & 1 deletion src/compiler/driver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ function emit_tile!(cache::CacheView, mi::Core.MethodInstance,

# Compute bytecode via driver
sci, rettype, kernel_meta = ir_result
key = cache.owner::TileCacheKey
key = tile_cache_key(cache.owner)
opts = CGOpts((sm_arch=unpack_version(key.sm_arch),
opt_level=unpack_hint(key.opt_level),
num_ctas=unpack_hint(key.num_ctas),
Expand Down
10 changes: 4 additions & 6 deletions src/compiler/interpreter.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Integration with Julia's abstract interpreter


Base.Experimental.@MethodTable cuTileMethodTable

function get_method_table_view(world::UInt)
Expand All @@ -21,11 +20,10 @@ end

function cuTileInterpreter(cache::CacheView; always_inline::Bool=true)
method_table = get_method_table_view(cache.world)
@static if isdefined(CC, :InferenceCache)
inf_cache = CC.InferenceCache()
else
inf_cache = Vector{CC.InferenceResult}()
end
# Fresh per interpreter, unless inside `GPUCompiler.inference_batch`, which
# shares one per (task, owner, world) so const-prop results carry across
# the batch (e.g. autotuning over many const-seeded variants of a kernel).
inf_cache = GPUCompiler.inference_cache(cache.owner, cache.world)
inf_params = CC.InferenceParams()
opt_params = if always_inline
CC.OptimizationParams(; inline_cost_threshold=typemax(Int))
Expand Down
3 changes: 3 additions & 0 deletions src/cuTile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ using EnumX
public BFloat16

import CompilerCaching
import GPUCompiler
using CompilerCaching: CacheView, method_instance, match_method_instance, typeinf!, results, lookup, get_source

# Shared definitions
Expand Down Expand Up @@ -127,4 +128,6 @@ end

include("precompile.jl")

include("experimental/Experimental.jl")

end # module cuTile
15 changes: 15 additions & 0 deletions src/experimental/Experimental.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module Experimental

using ..cuTile
using ..cuTile: cuTileconvert, default_sm_arch, temporary_cufunction

using CUDACore: CUDACore
using GPUCompiler: inference_batch

using Random

include("search_space.jl")
include("autotune.jl")
include("autotune_macro.jl")

end
Loading