First, clone the repo including submodule
git clone --recurse-submodules [email protected]:ArberSephirotheca/gpu-forward-progress-TLAPlus.git
Make sure you've started the docker service
systemctl service docker start
And run earthly bootstrap (this step is only necessary the first time)
earthly bootstrap
Then, run following to see the output
earthly +tlaplus-image --INPUT=<glsl compute file> --OUT=<format>
In our version of GLSL, we add additional syntax to take in TLA+ launch configuration
such as Scheduler, subgroup size, and number of workgroup.
You can check out the file under example_shader_program
for more info.
you can specify the scheduler for TLA+ model in shader program using following syntax:
#pragma scheduler(<scheduler name>)
Currently we only support two scheduler: HSA and OBE
you can specify the subgroup size for TLA+ model in shader program similar to how you specify the workgroup size:
layout(tla_subgroup_size = <num>) in;
num must be a non-zero positive integer
Similarily, you can specify the number of workgroup for TLA+ model in shader program using:
layout(tla_num_workgroups = <num>) in;
num must be a non-zero positive integer.
earthly -i +tlaplus-image --INPUT example_shader_program/producer_consumer.comp --OUT=all
- format: text, dot, all
We also provides part of litmus tests implemented by Tyler Sorensens, available at https://github.com/tyler-utah/AlloyForwardProgress. For convenience, a special command is available to run all the litmus tests:
earthly +tlaplus-image --LITMUS_TESTS TRUE
This command will try to run all the litmus tests in the litmus_tests
directories.
- OpVariable
- OpReturn
- OpLoad
- OpStore
- OpAtomicLoad
- OPAtomicStore
- OpBranch
- OpBranchConditional
- OpSwitch
- OpLabel
- OpLogicalOr
- OpLogicalAnd
- OpLogicalEqual
- OpLogicalNotEqual
- OpLogicalNot
- OpEqual
- OpNotEqual
- OpLess
- OpLessOrEqual
- OpGreater
- GreaterOrEqual
- OpAdd
- OpAtomicAdd
- OpSub
- OpAtomicSub
- OpMul
- OpSelectionMerge
- OpLoopMerge
- OpAtomicExchange
- OpAtomicCompareExchange
- OpGroupAll
- OpGroupAny
- OpGroupNonUniformAll
- OpGroupNonUniformAny
- OpControlBarrier
Note:
- The model treats the following instructions as equivalent:
OpStore
andOpAtomicStore
- Global variables (e.g. Storage Buffer) are assigned to default values if they are not initialized in the function body.
- For
uint
andint
type, the default value is 0. - For
bool
type, the default value is true.
- For
- int
- uint
- bool
The model does not implement any extension to memory semantics, and all SPIR-V instructions
are behaving like SequentiallyConsistent
.