-
Notifications
You must be signed in to change notification settings - Fork 70
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
dialect,backend: Experimental CSL dialect and printer #2592
Conversation
Added return type printing to the CSL function printer
Unlike `func.call`, `csl.call` can only have one result.
Reusing the same logic as MemberCallOp
Operations to represent CSL tasks. All three task kinds are represented by the same op. Control tasks not yet supported.
Most of the functionality is shared with FuncOp printer. Tasks are immediately bound to their IDs when they are printed.
For now only local and data tasks are tested, because control tasks are not yet implemented.
Moved the shared parts of FuncOp and TaskOp into a common superclass.
Where the name of the op needs to be mentioned in an error message, use the `name` field instead.
Rather than `Data[EnumType]`.
Added `SpacedOpaqueSyntaxAttribute` as a base class.
Now printing the properties as well.
This module is nested within the top level builtin ModuleOp and is used to differentiate between the layout module and the program module. The same op is used for both, they are differentiated with the `kind` attribute.
This script takes the output of xdsl-opt using the csl printer and splits it into a layout program files.
Just a container for operations to delimit them from global operations.
Now `scf.for` with arguments and results work by using mutable variables.
This is a port of gemv-01-complete-program from https://github.com/Cerebras/csl-examples/ to MLIR.
Removed AttrSizedOperandSegments option from MemberCallOp and CallOp.
Verifying that `var_name` is set when `value` is set.
Fixed the printer after call and member_call were updated.
`sym_name` should be used for the name of the symbol, even if `var_name` is provided.
Added a filecheck test which utilises all features implemented so far.
} | ||
} | ||
|
||
// CHECK-NEXT: param memcpy_params : comptime_struct; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is missing the struct body, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a param declaration with no default. It corresponds to this csl.param
op.
// CHECK-NEXT: comptime { | ||
// CHECK-NEXT: @rpc(@get_data_task_id(LAUNCH)); | ||
// CHECK-NEXT: } | ||
// CHECK-NEXT: // >>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<< // |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh, so this is the "boundary" between layout and program module?
This PR is first in a series trying to split #2592 into more reviewable chunks. Adding basic CSL type representations to the dialect.
… builtins (#2684) This PR adds * Types + `csl.color` * Attributes + Boolean attribute + String attribute * Operations + `csl.param` + `csl.const_struct` + `csl.set_tile_code` + `csl.set_rectangle` + `csl.get_color` + `csl.rpc` It adds the last changes made in #2592, which can be closed when this is merged.
@dk949 is everything from this merged now? |
@AntonLydike All except the csl-file-adapter. Frankly, this was just a hack to get something compiling with cslc. Better suggestions for how to split the resulting CSL code into two files is welcome. |
What's the purpose of this PR? Is it to track ongoing work and unimplemented features in the csl dialect? |
It was used as a reference for early work on the CSL dialect. All features in here have been merged/substantially modified by other PRs. I think it can be closed now. |
An experimental implementation of the CSL dialect modeling the CSL language used by the Cerebras WSE based systems.
Also includes a backend generating the CSL language and a tool to split output of the backend into the files consumable by cslc.
Files will need to be moved to the experimental directory before merging
Currently implemented features:
Types
csl.ptr
csl.comptime_struct
csl.color
csl.string
csl.type
Attributes
csl.module_kind
csl.task_kind
csl.ptr_kind
csl.ptr_const
Ops
csl.module
csl.layout
csl.param
csl.import_module
csl.member_access
csl.member_call
csl.addressof
csl.func
csl.task
csl.call
csl.return
csl.export
csl.set_rectangle
csl.set_tile_code
csl.rpc
csl.get_color
csl.const_struct
csl.const_str
csl.const_type
Non-CSL ops supported by the printer
arith.Addf
arith.Addi
arith.Constant
arith.ExtFOp
arith.ExtSIOp
arith.ExtUIOp
arith.FPToSIOp
arith.IndexCastOp
arith.Mulf
arith.Muli
arith.SIToFPOp
arith.TruncFOp
arith.TruncIOp
memref.GetGlobal
memref.Global
memref.Load
memref.Store
scf.Yield
Previously discussed with @AntonLydike and @n-io