Skip to content

AMDGPU LTS DAE initialization emits invalid IR with ModelingToolkitBase 1.79Β #587

Closed

Description

@ChrisRackauckas-Claude

🚧 UNREVIEWED β€” awaiting review by @ChrisRackauckas. Filed by an AI agent running as @ChrisRackauckas-Claude on behalf of @ChrisRackauckas; Chris has not seen this.
Harness: Codex CLI 0.164.0 Β· Model: gpt-6-astra
Conversation: local job diffeqgpu-amdgpu-dae (no session URL)

AMDGPU Julia 1.10.12 fails the computed-initialization DAE test with InvalidIRError reporting both ijl_field_index and ijl_has_no_field_error. The dependency trigger is ModelingToolkitBase 1.79.0 adding verbose = Minimal() to initialization-problem keywords. A controlled local comparison changing only ModelingToolkitBase 1.79.0 β†’ 1.78.1 removes that keyword, restores the problem's isbits property, and removes the runtime field lookup from the inspected initialization code.

Public CI boundary

Evidence DAE result ModelingToolkitBase
Master at 9cef7c8, build 1843 84 / 84 pass 1.77.5
Last tested build before this signature, 1844 84 / 84 pass 1.77.5
First build with this signature, 1847 80 pass / 2 fail / 1 error 1.79.0

I inspected builds 1840–1850. Builds 1845 and 1846 did not run; 1849 and 1850 repeat the signature. The earlier jobs fail later for other reasons despite passing DAE tests. Build 1847 is version-only PR 582: the comparison with master changes only the package version, with identical source, tests, and compatibility bounds.

Across the boundary, AMDGPU 2.8.0, CUDA 6.3.1, GPUCompiler 2.6.0, LLVM 9.13.2, KernelAbstractions 0.9.45, SciMLBase 3.58.0, SimpleNonlinearSolve 2.14.6, and SciMLLogging 2.1.0 stay unchanged. ModelingToolkit changes 11.45.5 β†’ 11.46.1, NonlinearSolveBase 2.55.0 β†’ 2.55.1, and IRTools 0.4.21 β†’ 0.4.24 among other updates. These other versions are held fixed in the one-package local control.

Failing path and local evidence

The computed-initialization test produces this keyword type with ModelingToolkitBase 1.79.0:

Base.Pairs{Symbol, SciMLLogging.Minimal, Tuple{Symbol},
           @NamedTuple{verbose::SciMLLogging.Minimal}}

Both public CI stacks run through NamedTuple indexing, Pairs indexing, SimpleNonlinearSolve's solve at line 139, and DiffEqGPU's solve_initialization_problem at line 180. SimpleNonlinearSolve checks haskey(prob.kwargs, :sensealg) before prob.kwargs[:sensealg]. Julia 1.10 checks the runtime iteration keys of Pairs, so the guard remains dynamic even though :sensealg is a literal field name. CPU code_llvm for the nonlinear initialization retains jl_f_getfield; CPU execution itself succeeds.

I reconstructed 295 dependency versions from the failing log (omitting the five AMD-only packages), kept the identical master source, and ran the original computed-initialization setup on Julia 1.10.12. It reports COMPATIBLE_ISBITS=false, INITPROB_ISBITS=false, and Base.Pairs(:verbose => Minimal()). CUDA.code_llvm of wrappers around gpu_initialization_solve and solve_initialization_problem contains both ijl_field_index and ijl_has_no_field_error. Changing only ModelingToolkitBase to 1.78.1 gives empty keywords, both isbits checks true, and neither runtime call in those CPU/CUDA LLVM outputs. This is generated-code inspection; it is not a successful GPU execution.

Source history identifies the logging integration in ModelingToolkit PR 5014, commit 38c641a8d96c019fc28cd292fe91babd8e0dae61, released in ModelingToolkitBase 1.79.0. This is a controlled package-version comparison plus source inspection, not an executed commit-by-commit bisect of that repository.

Reduced compilation reproducer

This loads no SciML package. On Julia 1.10.12 with CUDA 6.3.1 and GPUCompiler 2.6.0, I ran:

using CUDA

struct Verbosity end
function lookup_pairs(key::Symbol)
    kwargs = Base.Pairs((verbose=Verbosity(),), (key,))
    if haskey(kwargs, :sensealg)
        kwargs[:sensealg]
    end
    return
end

CUDA.@cuda launch=false lookup_pairs(:verbose)

Observed:

InvalidIRError: compiling MethodInstance for lookup_pairs(::Symbol) resulted in invalid LLVM IR
Reason: unsupported call to an unknown function (call to ijl_field_index)
Reason: unsupported call to an unknown function (call to ijl_has_no_field_error)

Both traces contain namedtuple.jl:168 and iterators.jl:324, matching AMDGPU CI. An otherwise identical function using kwargs = (verbose=Verbosity(),) compiles successfully. This reproduces the underlying keyword-lookup pattern, not the entire AMDGPU kernel.

Local versioninfo() (environment-path lines omitted):

Julia Version 1.10.12
Commit d93beab124c (2026-08-15 10:29 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 32 Γ— AMD Ryzen 9 9950X3D 16-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, generic)
Threads: 4 default, 0 interactive, 2 GC (on 32 virtual cores)

Limits and repair scope

No AMD hardware was available. Local CUDA compilation used launch=false; full local CUDA execution is blocked by a separate LLVM.Interop.pointerset compilation failure in a basic scalar device write under --compiled-modules=no, including with the good dependency control. The historical master CUDA CI job passes all 84 DAE tests with ModelingToolkitBase 1.77.5.

Candidate repair areas are the keyword representation in SciMLBase's ImmutableNonlinearProblem and the type-stable keyword checks in SimpleNonlinearSolve. Dropping verbosity keywords requires a semantic decision; no DiffEqGPU patch or upstream issue is proposed here. The older AMDGPU issue concerns a separate resolved failure.

Links


πŸ€– Posted by an AI agent β€” harness: Codex CLI 0.164.0 Β· model: gpt-6-astra
Conversation: local job diffeqgpu-amdgpu-dae (no session URL)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions