Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

[Draft][WIP] Relax language specification #273

Closed
wants to merge 30 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4eab6fc
Initial spec
slyubomirsky Oct 20, 2022
1c570e1
call_dps_packed is not yet implemented
slyubomirsky Oct 25, 2022
3946c2a
Many shape mechanics are still unimplemented
slyubomirsky Oct 25, 2022
a914e28
Indicate datatype in AST diagram
slyubomirsky Oct 25, 2022
b9aa684
Add text about variable shadowing
slyubomirsky Oct 25, 2022
548adc5
Discuss differences from Relay
slyubomirsky Nov 23, 2022
ca3b792
Correct typo
slyubomirsky Nov 23, 2022
928533c
Add description of PackedFuncType
slyubomirsky Dec 2, 2022
c710e60
Add a couple of missed references to PackedFuncType
slyubomirsky Dec 7, 2022
c92b301
Add forward pointer to the type-checking rule for local functions
slyubomirsky Dec 7, 2022
be02660
Describe normal form in the spec
slyubomirsky Dec 15, 2022
e4ad832
Specify consolidating empty binding blocks
slyubomirsky Dec 21, 2022
1075ce6
Add ndim parameter to ShapeType
slyubomirsky Jan 5, 2023
8fd4008
StructInfo update
slyubomirsky Jan 8, 2023
0d89b8f
Further StructInfo revisions
slyubomirsky Jan 8, 2023
76cb10c
Make PackedFunc first-class
slyubomirsky Jan 8, 2023
3f368a0
erase_to_well_defined should handle unbound shape vars in FuncStructInfo
slyubomirsky Jan 9, 2023
8387ef0
Include `sinfo_args`, greatly condense discussion of types
slyubomirsky Feb 1, 2023
6272880
First draft of PrimValues
slyubomirsky Feb 1, 2023
b88ce9e
Example of what DataTypeImm is used for
slyubomirsky Feb 1, 2023
1d219e5
Restrictions on PrimValue and PrimStructInfo
slyubomirsky Feb 1, 2023
eae9f7d
Unify the notation used for TIR dtypes and Relax dtypes
slyubomirsky Feb 1, 2023
17cdd29
Note immutability of tuples and shapes and possibility of interning
slyubomirsky Feb 1, 2023
7c87f32
Fix numbering in expression summary
slyubomirsky Feb 1, 2023
491ba4a
Update the description of call_tir
slyubomirsky Feb 2, 2023
47ab40b
Specify invariants for TensorStructInfo
slyubomirsky Feb 6, 2023
2336452
PrimValue, StringImm, DataTypeImm are leaf nodes
slyubomirsky Feb 10, 2023
613b840
Tuples are represented using Arrays, not ADTs now
slyubomirsky Feb 10, 2023
7ebc082
Fix typo
slyubomirsky Feb 13, 2023
4071b9b
Add mention of null value
slyubomirsky Feb 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Restrictions on PrimValue and PrimStructInfo
slyubomirsky committed Feb 13, 2023
commit 1d219e50fe5697703274fc9f4261a735c249148a
2 changes: 2 additions & 0 deletions relax_spec.md
Original file line number Diff line number Diff line change
@@ -280,6 +280,8 @@ The following criteria apply to all programs (including before normalization):
13. If the `shape` field of a `TensorStructInfo` in any structural annotation is given, the only permissible expressions are `Var` (the variable must be in scope at the location of the annotation) or `ShapeExpr` (in which any shape variables used must already be in scope, unless the `TensorStructInfo` is the `struct_info` field of a `MatchCast`, in which case a new shape variable is allowed to appear in a dimension by itself). Additionally, if the `shape` field is a `ShapeExpr`, the number of dimensions must match the `ndim` field.
14. If the `values` field of a `ShapeStructInfo` in any structural annotation is given, any shape variables used in it must already be in scope, unless the `ShapeStructInfo` is the `struct_info` field of a `MatchCast`, in which case a new shape variable is allowed to appear by itself as a member of `values`. Additionally, the `ndim` field must match the length of `values`.
15. The `params` and `derive_func` field may not be simultaneously defined in a `FuncStructInfo` annotation; that is, if one is defined, the other must not be defined. Additionally, at least one of `params` and `derive_func` _must_ be defined for each `FuncStructInfo` in an annotation.
16. `PrimValue` nodes are intended only to be used with `value`s consisting of TIR `IntImm`s and `FloatImm`s.
17. `PrimStructInfo` annotations should use only the `Int` and `Float` datatypes for their `dtype` fields.

Additionally, the criteria for normal form listed in the previous section must apply to any program that has been normalized.