Accfg
accfg
ACCFG = Dialect('accfg', [AcceleratorOp, AwaitOp, LaunchOp, ResetOp, SetupOp], [EffectsAttr, StateType, TokenType])
module-attribute
EffectsEnum
Bases: Enum
Specify to explicitly say: * NONE: There are no accfg side-effects to this operation * FULL: There are accfg side-effects to this operation
Source code in xdsl/dialects/accfg.py
43 44 45 46 47 48 49 50 51 | |
NONE = 'none'
class-attribute
instance-attribute
FULL = 'full'
class-attribute
instance-attribute
EffectsAttr
dataclass
Bases: Data[EffectsEnum]
An Attribute specifying if the marked operation has any effects on accelerator states.
Source code in xdsl/dialects/accfg.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
name = 'accfg.effects'
class-attribute
instance-attribute
parse_parameter(parser: AttrParser) -> EffectsEnum
classmethod
Source code in xdsl/dialects/accfg.py
61 62 63 64 65 66 67 68 | |
print_parameter(printer: Printer) -> None
Source code in xdsl/dialects/accfg.py
70 71 72 | |
TokenType
Bases: ParametrizedAttribute, TypeAttribute
Async token type for launched accelerator requests.
Source code in xdsl/dialects/accfg.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 | |
name = 'accfg.token'
class-attribute
instance-attribute
accelerator: StringAttr
instance-attribute
__init__(accelerator: str | StringAttr)
Source code in xdsl/dialects/accfg.py
85 86 87 88 | |
StateType
Bases: ParametrizedAttribute, TypeAttribute
Used to trace an accelerators CSR state through def-use chain
Source code in xdsl/dialects/accfg.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 | |
name = 'accfg.state'
class-attribute
instance-attribute
accelerator: StringAttr
instance-attribute
__init__(accelerator: str | StringAttr)
Source code in xdsl/dialects/accfg.py
101 102 103 104 | |
LaunchOp
Bases: IRDLOperation
Launch an accelerator. This acts as a barrier for CSR values, meaning CSRs can be safely modified after a launch op without interfering with the Accelerator.
Source code in xdsl/dialects/accfg.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | |
name = 'accfg.launch'
class-attribute
instance-attribute
values = var_operand_def(Attribute)
class-attribute
instance-attribute
The actual values used to set up registers linked to launch
state = operand_def(StateType)
class-attribute
instance-attribute
param_names = prop_def(ArrayAttr[StringAttr])
class-attribute
instance-attribute
Maps the SSA values in values to accelerator launch parameters
accelerator = prop_def(StringAttr)
class-attribute
instance-attribute
token = result_def()
class-attribute
instance-attribute
__init__(vals: Sequence[SSAValue | Operation], param_names: Iterable[str] | Iterable[StringAttr], state: SSAValue | Operation)
Source code in xdsl/dialects/accfg.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | |
iter_params() -> Iterable[tuple[str, SSAValue]]
Source code in xdsl/dialects/accfg.py
153 154 | |
verify_() -> None
Source code in xdsl/dialects/accfg.py
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | |
AwaitOp
Bases: IRDLOperation
Blocks until the launched operation finishes.
Source code in xdsl/dialects/accfg.py
182 183 184 185 186 187 188 189 190 191 192 193 | |
name = 'accfg.await'
class-attribute
instance-attribute
token = operand_def(TokenType)
class-attribute
instance-attribute
__init__(token: SSAValue | Operation)
Source code in xdsl/dialects/accfg.py
192 193 | |
SetupOp
Bases: IRDLOperation
accfg.setup writes values to a specific accelerators configuration and returns a value representing the currently known state of that accelerator's config.
If accfg.setup is called without any parameters, the resulting state is the "empty" state, that represents a state without known values.
Source code in xdsl/dialects/accfg.py
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 | |
name = 'accfg.setup'
class-attribute
instance-attribute
values = var_operand_def(Attribute)
class-attribute
instance-attribute
The actual values used to set up the CSRs
in_state = opt_operand_def(StateType)
class-attribute
instance-attribute
The state produced by a previous accfg.setup
out_state = result_def(StateType)
class-attribute
instance-attribute
The CSR state after the setup op modified it.
param_names = prop_def(ArrayAttr[StringAttr])
class-attribute
instance-attribute
Maps the SSA values in values to accelerator parameter names
accelerator = prop_def(StringAttr)
class-attribute
instance-attribute
Name of the accelerator this setup is for
irdl_options = (AttrSizedOperandSegments(as_property=True),)
class-attribute
instance-attribute
__init__(vals: Sequence[SSAValue | Operation], param_names: Sequence[str] | Sequence[StringAttr], accelerator: str | StringAttr, in_state: SSAValue | Operation | None = None)
Source code in xdsl/dialects/accfg.py
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 | |
iter_params() -> Iterable[tuple[str, SSAValue]]
Source code in xdsl/dialects/accfg.py
258 259 | |
verify_() -> None
Source code in xdsl/dialects/accfg.py
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 | |
print(printer: Printer)
Source code in xdsl/dialects/accfg.py
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | |
parse(parser: Parser) -> SetupOp
classmethod
Source code in xdsl/dialects/accfg.py
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 | |
AcceleratorSymbolOpTrait
dataclass
Bases: SymbolOpInterface
Source code in xdsl/dialects/accfg.py
355 356 357 358 | |
get_sym_attr_name(op: Operation) -> StringAttr | None
Source code in xdsl/dialects/accfg.py
356 357 358 | |
AcceleratorOp
Bases: IRDLOperation
Declares an accelerator that can be configured, launched, etc.
fields is a dictionary mapping accelerator configuration names to
CSR addresses.
Source code in xdsl/dialects/accfg.py
361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 | |
name = 'accfg.accelerator'
class-attribute
instance-attribute
traits = traits_def(AcceleratorSymbolOpTrait())
class-attribute
instance-attribute
name_prop = prop_def(SymbolRefAttr, prop_name='name')
class-attribute
instance-attribute
fields = prop_def(DictionaryAttr)
class-attribute
instance-attribute
launch_fields = prop_def(DictionaryAttr)
class-attribute
instance-attribute
barrier = prop_def(IntegerAttr[IntegerType])
class-attribute
instance-attribute
__init__(name: str | StringAttr | SymbolRefAttr, fields: dict[str, int] | DictionaryAttr, launch_fields: dict[str, int] | DictionaryAttr, barrier: int | IntegerAttr[IntegerType])
Source code in xdsl/dialects/accfg.py
383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 | |
verify_() -> None
Source code in xdsl/dialects/accfg.py
415 416 417 418 | |
field_names() -> tuple[str, ...]
Source code in xdsl/dialects/accfg.py
420 421 | |
field_items() -> Iterable[tuple[str, IntegerAttr]]
Source code in xdsl/dialects/accfg.py
423 424 425 | |
launch_field_names() -> tuple[str, ...]
Source code in xdsl/dialects/accfg.py
427 428 | |
launch_field_items() -> Iterable[tuple[str, IntegerAttr]]
Source code in xdsl/dialects/accfg.py
430 431 432 | |
ResetOp
Bases: IRDLOperation
Source code in xdsl/dialects/accfg.py
435 436 437 438 439 440 441 442 443 444 | |
name = 'accfg.reset'
class-attribute
instance-attribute
in_state = operand_def(StateType)
class-attribute
instance-attribute
assembly_format = '$in_state attr-dict `:` type($in_state)'
class-attribute
instance-attribute
__init__(in_state: Operation | SSAValue)
Source code in xdsl/dialects/accfg.py
443 444 | |