The patch extends the yaml code generation to support the following new OpDSL constructs:
- captures
- constants
- iteration index accesses
- predefined types
These changes have been introduced by revision
https://reviews.llvm.org/D101364.
Paths
| Differential D102075
[mir][Python][linalg] Support OpDSL extensions in C++. ClosedPublic Authored by gysit on May 7 2021, 8:14 AM.
Details Summary The patch extends the yaml code generation to support the following new OpDSL constructs:
These changes have been introduced by revision
Diff Detail
Event TimelineHerald added subscribers: shabalin, dcaballe, cota and 18 others. · View Herald TranscriptMay 7 2021, 8:14 AM Comment Actions I decided to add the following tests:
Comment Actions This has come along nicely since we looked at it together - thank you for spending the time on adding an additional layer of testing. Code lgtm - I'll leave to Nicolas wrt details of Linalg parse/print/etc.
This revision is now accepted and ready to land.May 9 2021, 11:57 PM
Comment Actions This revision does a little too much for my taste. Still, I think at least the captures should be separated out because it does increase the semantic power of linalg ops irrespective of opdsl. In any case let's iterate Monday on VC. Thanks!
This revision was landed with ongoing or failed builds.May 19 2021, 6:37 AM Closed by commit rG9a2769db801d: [mir][Python][linalg] Support OpDSL extensions in C++. (authored by gysit). · Explain Why This revision was automatically updated to reflect the committed changes. Comment Actions I believe this change causes the assert on the attribute SmallVector (for size >256) to hit when the size isn't specified on Windows debug builds. [4242/5334] Building CXX object tools\mlir\tools\mlir-linalg-ods-gen\CMakeFiles\mlir-linalg-ods-yaml-gen.dir\mlir-linalg-ods-yaml-gen.cpp.obj FAILED: tools/mlir/tools/mlir-linalg-ods-gen/CMakeFiles/mlir-linalg-ods-yaml-gen.dir/mlir-linalg-ods-yaml-gen.cpp.obj C:\PROGRA~2\MICROS~3\2019\COMMUN~1\VC\Tools\MSVC\1428~1.299\bin\Hostx64\x64\cl.exe /nologo /TP -DGTEST_HAS_RTTI=0 -DMLIR_CUDA_CONVERSIONS_ENABLED=0 -DMLIR_ROCM_CONVERSIONS_ENABLED=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\mlir\tools\mlir-linalg-ods-gen -IC:\vsts-agent\_work\13\s\mlir\tools\mlir-linalg-ods-gen -Iinclude -IC:\vsts-agent\_work\13\s\llvm\include -IC:\vsts-agent\_work\13\s\mlir\include -Itools\mlir\include /DWIN32 /D_WINDOWS /Zc:inline /Zc:__cplusplus /Zc:strictStrings /Oi /Zc:rvalueCast /bigobj /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd4324 -w14062 -we4238 /MDd /Zi /Ob0 /Od /RTC1 /EHs-c- /GR- /EHs-c- /GR- -std:c++14 /showIncludes /Fotools\mlir\tools\mlir-linalg-ods-gen\CMakeFiles\mlir-linalg-ods-yaml-gen.dir\mlir-linalg-ods-yaml-gen.cpp.obj /Fdtools\mlir\tools\mlir-linalg-ods-gen\CMakeFiles\mlir-linalg-ods-yaml-gen.dir\ /FS -c C:\vsts-agent\_work\13\s\mlir\tools\mlir-linalg-ods-gen\mlir-linalg-ods-yaml-gen.cpp C:\vsts-agent\_work\13\s\llvm\include\llvm/ADT/SmallVector.h(1135): error C2338: You are trying to use a default number of inlined elements for `SmallVector<T>` but `sizeof(T)` is really big! Please use an explicit number of inlined elements with `SmallVector<T, N>` to make sure you really want that much inline storage. C:\vsts-agent\_work\13\s\mlir\tools\mlir-linalg-ods-gen\mlir-linalg-ods-yaml-gen.cpp(120): note: see reference to class template instantiation 'llvm::CalculateSmallVectorDefaultInlinedElements<T>' being compiled with [ T=`anonymous-namespace'::ScalarAssign ] C:\vsts-agent\_work\13\s\mlir\tools\mlir-linalg-ods-gen\mlir-linalg-ods-yaml-gen.cpp(120): error C2976: 'llvm::SmallVector': too few template arguments C:\vsts-agent\_work\13\s\llvm\include\llvm/ADT/SmallVector.h(1168): note: see declaration of 'llvm::SmallVector' Comment Actions @NathanielMcVicar Thanks for reporting this. I hope https://reviews.llvm.org/D102827 fixes your issue?
Revision Contents
Diff 346153 mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml
mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
mlir/python/mlir/dialects/linalg/opdsl/lang/comprehension.py
mlir/python/mlir/dialects/linalg/opdsl/lang/config.py
mlir/python/mlir/dialects/linalg/opdsl/lang/emitter.py
mlir/python/mlir/dialects/linalg/opdsl/lang/scalar_expr.py
mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py
mlir/test/CMakeLists.txt
mlir/test/Dialect/Linalg/generalize-named-polymorphic-ops.mlir
mlir/test/lit.cfg.py
mlir/test/mlir-linalg-ods-gen/test-linalg-ods-yaml-gen.yaml
mlir/test/python/dialects/linalg/opdsl/arguments.py
mlir/test/python/dialects/linalg/opdsl/assignments.pymlir/test/python/dialects/linalg/opdsl/emit_structured_generic.py
mlir/test/python/dialects/linalg/opsrun.py
mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp
|
nit: NL