Skip to content
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

Add example of loading standalone dialect #49

Draft
wants to merge 1 commit into
base: vc/show
Choose a base branch
from

Conversation

vchuravy
Copy link
Member

@vchuravy vchuravy commented Jan 21, 2024

Using an assertion build of Julia 1.10

LLVM_ASSERTIONS=1
FORCE_ASSERTIONS=1

override JULIA_BUILD_MODE=debug

The goal is to see if we can dynamically load extension dialects.

cd test/standalone
julia --project=. build_local.jl
julia --project=Standalone
(Standalone) pkg> dev ../..
(Standalone) pkg> test

Currently fails with:

     Testing Running tests...
ERROR: LoadError: LLVM error: can't create Attribute 'mlir::StringAttr' because storage uniquer isn't initialized: the dialect was likely not loaded, or the attribute wasn't added with addAttributes<...>() in the Dialect::initialize() method.
Stacktrace:
 [1] handle_error(reason::Cstring)
   @ LLVM ~/.julia/packages/LLVM/5aiiG/src/core/context.jl:118
 [2] mlirDialectHandleLoadDialect
   @ MLIR.API ~/src/MLIR/src/API/15/libMLIR_h.jl:469 [inlined]
 [3] load_dialect(ctx::MLIR.IR.Context)
   @ Standalone ~/src/MLIR/test/standalone/Standalone/src/Standalone.jl:21
 [4] (::var"#1#2")()
   @ Main ~/src/MLIR/test/standalone/Standalone/test/runtests.jl:8
 [5] context!(f::var"#1#2", ctx::MLIR.IR.Context)
   @ MLIR.IR ~/src/MLIR/src/IR/state.jl:37
 [6] top-level scope
   @ ~/src/MLIR/test/standalone/Standalone/test/runtests.jl:4
 [7] include(fname::String)
   @ Base.MainInclude ./client.jl:489
 [8] top-level scope
   @ none:6
in expression starting at /home/vchuravy/src/MLIR/test/standalone/Standalone/test/runtests.jl:4
ERROR: Package Standalone errored during testing

@vchuravy
Copy link
Member Author

@wsmoses @stephenneuendorffer any ideas on the error? I am trying to reproduce how the python extensions are handled.
The big difference I am able to ascertain is that they use one big C library for all extensions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant