Skip to content

GPURuntime compilation can "embedd" julia runtime values #460

Open
@vchuravy

Description

@vchuravy

@pxl-th reported on slack the following odd behavior.

During first execution exception reporting on AMDGPU (HIP rewrite) works fine, on the second one it
doesn't and the host code that tries to read the exception from the buffer sees a pointer to a type from the previous Julia session.

This could happen with Types/Symbols/... the works.

This is due to the fact that the runtime saves it bitcode to disk and re-uses it between sessions, so our usual assumptions of embedding
host pointers is fine, is no longer okay. This becomes even more relevant under generalized caching. (x-ref: #351 )

I see two paths forward:

  1. We fix imaging mode and use it for code that will be cached. The current problem with imaging mode is that we are missing a mapping from GV to JL value. (This is an issue for StaticCompiler as well currently)
  2. We do the Enzyme / StaticCompiler hack for the runtime. Find pointer values, rewrite them to GVs... carry on.

The former will likely need changes to Julia base, and the latter is "proven" but stupid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions