Fix dialect registration in neura interpreter#317
Open
TimJZ wants to merge 2 commits into
Open
Conversation
tancheng
reviewed
May 27, 2026
tancheng
left a comment
Contributor
There was a problem hiding this comment.
Can you add
// WIP: https://github.com/coredac/neura/issues/5
// RN: neura-interpreter %t-neura.mlir >> %t-dumped_output.txt
into a e2e test you wanna enable interpreter?
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
Author
|
Added |
tancheng
approved these changes
Jun 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes a dialect registration issue in
neura-interpreter.Previously,
neura-interpretercould not parse Neura MLIR files generated from the normal LLVM-import/e2e flow because the imported module may containdlti.dl_specmetadata. This caused the interpreter to fail before it could execute the Neura dataflow IR.The failure looked like:
After this fix,
neura-interpretercan parse the mapped ReLU IR generated by the existingmlir-neura-optpipeline and proceed into dataflow execution.Testing
Tested manually on the ReLU e2e lowering flow.
1. Rebuild the updated tools
2. Generate LLVM IR for the ReLU kernel
3. Extract the kernel function and import it into MLIR
llvm-extract --rfunc=".*kernel.*" \ relu_kernel_full.ll \ -o relu_kernel_only.ll mlir-translate --import-llvm \ relu_kernel_only.ll \ -o relu_kernel_imported.mlirmlir-translatemay print warnings such as:These warnings are not fatal;
relu_kernel_imported.mliris still generated.4. Lower and map the imported MLIR to Neura IR
Confirmed that the mapped IR was generated:
Observed:
5. Verify the interpreter behavior
Before this fix, running the interpreter on the mapped ReLU IR failed during parsing:
Previous error:
After this fix, the interpreter successfully parses the mapped ReLU IR and begins dataflow execution:
Observed output includes:
This confirms that the dialect registration issue is fixed.
The interpreter now proceeds past MLIR parsing and exposes the next execution-level issue:
That
neura.yieldhandling is a separate follow-up issue and is not addressed by this PR.