Fine-grained conditional dispatching
Techniques for executing workgroups are provided. The techniques include executing, for a first workgroup of a first kernel dispatch, a workgroup dependency instruction that includes an indication to prioritize execution of a second workgroup of a second kernel dispatch, and in response to the workgroup dependency instruction, dispatching the second workgroup of the second kernel dispatch prior to dispatching a third workgroup of the second kernel dispatch, wherein no workgroup dependency instruction including an indication to prioritize execution of the third workgroup has been executed.
1. A method for executing workgroups, the method comprising:
executing, for a first workgroup of a first kernel dispatch derived from a first software queue, a workgroup dependency instruction that includes an indication to prioritize execution of a second workgroup of a second kernel dispatch derived from the first software queue; and
in response to the workgroup dependency instruction, dispatching the second workgroup of the second kernel dispatch prior to dispatching a third workgroup of the second kernel dispatch,
wherein no workgroup dependency instruction including an indication to prioritize execution of the third workgroup has been executed.
2. The method of claim 1 , wherein:
the executing occurs in response to all wavefronts of the first workgroup completing execution.
3. The method of claim 1 , wherein the second kernel dispatch is dependent on the first kernel dispatch.
4. The method of claim 3 , wherein a barrier packet indicates that the second kernel dispatch is dependent on the first kernel dispatch.
5. The method of claim 1 , wherein dispatching the second workgroup occurs prior to dispatching any workgroup of the second kernel dispatch for which no workgroup dependency instruction has been executed.
6. The method of claim 1 , further comprising:
setting, at runtime, a workgroup identifier specifying the second workgroup, by the first workgroup.
7. The method of claim 1 , wherein:
the first kernel dispatch is derived from a first software queue and the second kernel dispatch is derived from a second software queue.
8. A method for executing workgroups, the method comprising:
executing, for a first workgroup of a first kernel dispatch, a workgroup dependency instruction that includes an indication to prioritize execution of a second workgroup of a second kernel dispatch, wherein the second kernel dispatch is dependent on the first kernel dispatch and a third kernel dispatch; and
in response to the workgroup dependency instruction, dispatching the second workgroup of the second kernel dispatch prior to dispatching a third workgroup of the second kernel dispatch,
wherein no workgroup dependency instruction including an indication to prioritize execution of the third workgroup has been executed.
9. A device, comprising:
a compute unit circuitry; and
a dispatcher circuitry;
wherein the compute unit circuitry is configured to execute, for a first workgroup of a first kernel dispatch derived from a first software queue, a workgroup dependency instruction that includes an indication to prioritize execution of a second workgroup of a second kernel dispatch derived from the first software queue; and
wherein the dispatcher circuitry is configured to, in response to the workgroup dependency instruction, dispatch the second workgroup of the second kernel dispatch prior to dispatching a third workgroup of the second kernel dispatch,
wherein no workgroup dependency instruction including an indication to prioritize execution of the third workgroup has been executed.
10. The device of claim 9 , wherein:
the executing occurs in response to all wavefronts of the first workgroup completing execution.
11. The device of claim 9 , wherein the second kernel dispatch is dependent on the first kernel dispatch.
12. The device of claim 11 , wherein a barrier packet indicates that the second kernel dispatch is dependent on the first kernel dispatch.
13. The device of claim 9 , wherein dispatching the second workgroup occurs prior to dispatching any workgroup of the second kernel dispatch for which no workgroup dependency instruction has been executed.
14. The device of claim 9 , wherein the compute unit circuitry is configured to:
set, at runtime, a workgroup identifier specifying the second workgroup, by the first workgroup.
15. The device of claim 9 , wherein:
the first kernel dispatch is derived from a first software queue and the second kernel dispatch is derived from a second software queue.
16. A device, comprising:
a compute unit circuitry; and
a dispatcher circuitry;
wherein the compute unit circuitry is configured to execute, for a first workgroup of a first kernel dispatch, a workgroup dependency instruction that includes an indication to prioritize execution of a second workgroup of a second kernel dispatch, wherein the second kernel dispatch is dependent on the first kernel dispatch and a third kernel dispatch; and
wherein the dispatcher circuitry is configured to, in response to the workgroup dependency instruction, dispatch the second workgroup of the second kernel dispatch prior to dispatching a third workgroup of the second kernel dispatch,
wherein no workgroup dependency instruction including an indication to prioritize execution of the third workgroup has been executed.