Skip to content

change to dialect generator#691

Open
glou-nes wants to merge 29 commits into
EnzymeAD:mainfrom
glou-nes:MLIRgen
Open

change to dialect generator#691
glou-nes wants to merge 29 commits into
EnzymeAD:mainfrom
glou-nes:MLIRgen

Conversation

@glou-nes

@glou-nes glou-nes commented Feb 5, 2025

Copy link
Copy Markdown
Contributor

rebase #660 & #447. @mofeing I messed up #660 so I open a new PR.

Several modifications:

  • renaming result_ to result
  • apply the typing defining in args, for instance: result_layouts=nothing::Union{Attribute, Nothing} doesn't constraint result_layouts so change to : result_layouts::Union{Attribute, Nothing} =nothing
  • create Julia enum for EnumAttr : using Attr parsing (MLIR doesn't expose methods in C to easily construct arbitrary attribute) and discriminant.
  • typing Attribute and use Julia type for easy ones (Int, Float, Vector).
  • more complex Attributes ("struct" layout) such as conv
  • add an AbstractAttributes type

Comment thread src/mlir/MLIR.jl
Comment thread deps/ReactantExtra/tblgen/jl-generators.cc
@codecov

codecov Bot commented Feb 7, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 21.94444% with 562 lines in your changes missing coverage. Please review.

Project coverage is 38.03%. Comparing base (b6ffc96) to head (ae0149e).
Report is 435 commits behind head on main.

Files with missing lines Patch % Lines
src/mlir/Dialects/Nvvm.jl 0.00% 149 Missing ⚠️
src/mlir/Dialects/VHLO.jl 0.00% 58 Missing ⚠️
src/mlir/IR/Attribute.jl 39.78% 56 Missing ⚠️
src/mlir/Dialects/StableHLO.jl 54.28% 48 Missing ⚠️
src/mlir/Dialects/TPU.jl 0.00% 46 Missing ⚠️
src/mlir/Dialects/Llvm.jl 4.76% 40 Missing ⚠️
src/mlir/Dialects/CHLO.jl 28.26% 33 Missing ⚠️
src/mlir/Dialects/Gpu.jl 0.00% 33 Missing ⚠️
src/mlir/Dialects/Triton.jl 0.00% 32 Missing ⚠️
src/mlir/Dialects/Arith.jl 0.00% 19 Missing ⚠️
... and 10 more
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #691       +/-   ##
===========================================
+ Coverage   21.66%   38.03%   +16.36%     
===========================================
  Files          46       85       +39     
  Lines        8048    15896     +7848     
===========================================
+ Hits         1744     6046     +4302     
- Misses       6304     9850     +3546     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment thread src/mlir/Dialects/MPI.jl

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, there are still a few files with changes in permissions.

@glou-nes glou-nes Feb 12, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx, each time I format I have to change them. It seems some are 644 and some are 755. Now, all dialects files are 755. I don't know how CI set the permission.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh right that's probably from

- name: Make generated files writable
run: |
chmod -R u+rw ./src/mlir/Dialects/
chmod u+rw ./src/mlir/libMLIR_h.jl
git config core.fileMode false

Comment thread deps/ReactantExtra/tblgen/jl-generators.cc Outdated
@glou-nes

Copy link
Copy Markdown
Contributor Author

@wsmoses this seems to be alright! CI failure seems unrelated.

@mofeing mofeing added the MLIR.jl backport Should be backported to upstream MLIR.jl label Feb 15, 2025
@giordano

Copy link
Copy Markdown
Member

https://github.com/EnzymeAD/Reactant.jl/actions/runs/13371624570/job/37341205434?pr=691#step:7:168

┌ Error: 73 docstrings not included in the manual:
│ 
│     Reactant.MLIR.Dialects.llvm.UnnamedAddr
│     Reactant.MLIR.Dialects.chlo.Precision
│     Reactant.MLIR.Dialects.nvvm.ShflKind
│     Reactant.MLIR.Dialects.stablehlo.Precision
│     Reactant.MLIR.Dialects.tpu.CoreType
│     Reactant.MLIR.Dialects.gpu.MMAElementwiseOp
│     Reactant.MLIR.Dialects.llvm.Visibility
│     Reactant.MLIR.Dialects.tpu.PackFormat
│     Reactant.MLIR.Dialects.arith.FastMathFlags
│     Reactant.MLIR.Dialects.stablehlo.FftType
│     Reactant.MLIR.Dialects.llvm.Comdat
│     Reactant.MLIR.Dialects.tt.EvictionPolicy
│     Reactant.MLIR.Dialects.gpu.AllReduceOperation
│     Reactant.MLIR.Dialects.gpu.SpGEMMWorkEstimationOrComputeKind
│     Reactant.MLIR.Dialects.nvvm.MemScopeKind
│     Reactant.MLIR.Dialects.llvm.AtomicOrdering
│     Reactant.MLIR.Dialects.tt.RoundingMode
│     Reactant.MLIR.Dialects.tpu.RoundingMode
│     Reactant.MLIR.Dialects.nvvm.FPRoundingMode
│     Reactant.MLIR.Dialects.nvvm.WGMMATypes
│     Reactant.MLIR.Dialects.nvvm.ReduxKind
│     Reactant.MLIR.Dialects.nvvm.LoadCacheModifierKind
│     Reactant.MLIR.Dialects.tt.MemSyncScope
│     Reactant.MLIR.Dialects.affine.AtomicRMWKind
│     Reactant.MLIR.Dialects.tpu.ReductionKind
│     Reactant.MLIR.Dialects.nvvm.TMAReduxKind
│     Reactant.MLIR.Dialects.tt.ScaleDotElemType
│     Reactant.MLIR.Dialects.llvm.FCmpPredicate
│     Reactant.MLIR.Dialects.nvvm.WGMMAScaleOut
│     Reactant.MLIR.Dialects.nvvm.MMAB1Op
│     Reactant.MLIR.Dialects.chlo.ComparisonType
│     Reactant.MLIR.Dialects.gpu.ShuffleMode
│     Reactant.MLIR.Dialects.stablehlo.CustomCallApiVersion
│     Reactant.MLIR.Dialects.sdy.PropagationDirection
│     Reactant.MLIR.Dialects.nvvm.MMAIntOverflow
│     Reactant.MLIR.Dialects.tt.ProgramIDDim
│     Reactant.MLIR.Dialects.arith.RoundingMode
│     Reactant.MLIR.Dialects.nvvm.SaturationMode
│     Reactant.MLIR.Dialects.nvvm.SharedSpace
│     Reactant.MLIR.Dialects.tt.RMWOp
│     Reactant.MLIR.Dialects.mpi.MPI_OpClassEnum
│     Reactant.MLIR.Dialects.gpu.Dimension
│     Reactant.MLIR.Dialects.enzyme.Activity
│     Reactant.MLIR.Dialects.stablehlo.RngAlgorithm
│     Reactant.MLIR.Dialects.nvvm.WGMMAScaleIn
│     Reactant.MLIR.Dialects.tt.PaddingOption
│     Reactant.MLIR.Dialects.nvvm.SetMaxRegisterAction
│     Reactant.MLIR.Dialects.llvm.AsmDialect
│     Reactant.MLIR.Dialects.nvvm.ProxyKind
│     Reactant.MLIR.Dialects.tt.PropagateNan
│     Reactant.MLIR.Dialects.gpu.Prune2To4SpMatFlag
│     Reactant.MLIR.Dialects.nvvm.TMAStoreMode
│     Reactant.MLIR.Dialects.chlo.ComparisonDirection
│     Reactant.MLIR.Dialects.tt.CacheModifier
│     Reactant.MLIR.Dialects.arith.CmpIPredicate
│     Reactant.MLIR.Dialects.mpi.MPI_ErrorClassEnum
│     Reactant.MLIR.Dialects.tt.MemSemantic
│     Reactant.MLIR.Dialects.stablehlo.RngDistribution
│     Reactant.MLIR.Dialects.nvvm.MMATypes
│     Reactant.MLIR.Dialects.llvm.ICmpPredicate
│     Reactant.MLIR.Dialects.stablehlo.Transpose
│     Reactant.MLIR.Dialects.arith.IntegerOverflowFlags
│     Reactant.MLIR.Dialects.stablehlo.ComparisonDirection
│     Reactant.MLIR.Dialects.arith.CmpFPredicate
│     Reactant.MLIR.Dialects.llvm.FastmathFlags
│     Reactant.MLIR.Dialects.nvvm.MMALayout
│     Reactant.MLIR.Dialects.tpu.ContractPrecision
│     Reactant.MLIR.Dialects.tt.InputPrecision
│     Reactant.MLIR.Dialects.nvvm.MMAFrag
│     Reactant.MLIR.Dialects.llvm.AtomicBinOp
│     Reactant.MLIR.Dialects.stablehlo.ComparisonType
│     Reactant.MLIR.Dialects.gpu.TransposeMode
│     Reactant.MLIR.Dialects.nvvm.Tcgen05GroupKind
│ 
│ These are docstrings in the checked modules (configured with the modules keyword)
│ that are not included in canonical @docs or @autodocs blocks.
└ @ Documenter ~/.julia/packages/Documenter/iwb7N/src/utilities/utilities.jl:44

@glou-nes

Copy link
Copy Markdown
Contributor Author

that are not included in canonical @docs or @autodocs blocks.

@giordano I don't know documenter too much. Is there a way to ignore them?

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

Labels

MLIR.jl backport Should be backported to upstream MLIR.jl

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants