Methods and apparatus to improve operation of a graphics processing unit
Abstract
Methods, apparatus, systems, and articles of manufacture are disclosed to improve operation of a graphics processing unit (GPU). An example apparatus includes an instruction generator to insert profiling instructions into a GPU kernel to generate an instrumented GPU kernel, the instrumented GPU kernel is to be executed by a GPU, a trace analyzer to generate an occupancy map associated with the GPU executing the instrumented GPU kernel, a parameter calculator to determine one or more operating parameters of the GPU based on the occupancy map, and a processor optimizer to invoke a GPU driver to adjust a workload of the GPU based on the one or more operating parameters.
Claims
exact text as granted — not AI-modified1 . (canceled)
2 . An apparatus to improve operation of a graphics processing unit (GPU), the apparatus comprising:
instructions; and at least one processor to execute the instructions to:
populate a trace buffer based on one or more records, corresponding ones of the records having a hardware thread identifier and a timestamp, the one or more records generated in response to an execution of an instrumented GPU kernel by the GPU;
generate one or more sub-traces based on at least some of the hardware thread identifiers;
determine one or more timelines associated with the timestamps of the one or more sub-traces;
generate an occupancy map associated with the GPU based on the one or more timelines; and
adjust a workload of the GPU based on the occupancy map.
3 . The apparatus of claim 2 , wherein the one or more records include a first record having a first index, the one or more sub-traces include a first sub-trace including the first record, and the at least one processor is to assign a second index to the first record in response to a determination the first sub-trace includes more than one of the one or more records.
4 . The apparatus of claim 2 , wherein the instructions are first instructions, and the at least one processor is to insert profiling instructions into a GPU kernel to generate the instrumented GPU kernel, the instrumented GPU kernel to be executed by a GPU.
5 . The apparatus of claim 4 , wherein the at least one processor is to insert the profiling instructions by inserting a first subset of the profiling instructions at a first address of the GPU kernel and inserting a second subset of the profiling instructions at a second address of the GPU kernel, the first address different from the second address.
6 . The apparatus of claim 2 , wherein the at least one processor is to map the one or more timelines to the occupancy map by representing first time durations of the occupancy map corresponding to the timelines as busy and representing second time durations of the occupancy map as idle, the second time durations corresponding to time periods not included in the timelines.
7 . The apparatus of claim 2 , wherein the at least one processor is to determine one or more operating parameters of the GPU based on the occupancy map, the workload of the GPU to be adjusted based on the one or more operating parameters.
8 . The apparatus of claim 7 , wherein the one or more operating parameters include at least one of a busy time parameter, an idle time parameter, an occupancy time parameter, or a utilization parameter.
9 . A non-transitory computer readable storage medium comprising instructions that, when executed, cause at least one processor to at least:
populate a trace buffer based on one or more records, corresponding ones of the records having a hardware thread identifier and a timestamp, the one or more records generated in response to an execution of an instrumented graphics processing unit (GPU) kernel by a GPU; generate one or more sub-traces based on at least some of the hardware thread identifiers; determine one or more timelines associated with the timestamps of the one or more sub-traces; generate an occupancy map associated with the GPU based on the one or more timelines; and adjust a workload of the GPU based on the occupancy map.
10 . The non-transitory computer readable storage medium of claim 9 , wherein the one or more records include a first record having a first index, the one or more sub-traces include a first sub-trace including the first record, and the instructions, when executed, cause the at least one processor to assign a second index to the first record in response to a determination the first sub-trace includes more than one of the one or more records.
11 . The non-transitory computer readable storage medium of claim 9 , wherein the instructions are first instructions and, when executed, the first instructions cause the at least one processor to insert profiling instructions into a GPU kernel to generate the instrumented GPU kernel, the instrumented GPU kernel to be executed by a GPU.
12 . The non-transitory computer readable storage medium of claim 11 , wherein the first instructions, when executed, cause the at least one processor to insert the profiling instructions by inserting a first subset of the profiling instructions at a first address of the GPU kernel and inserting a second subset of the profiling instructions at a second address of the GPU kernel, the first address different from the second address.
13 . The non-transitory computer readable storage medium of claim 9 , wherein the instructions, when executed, cause the at least one processor to map the one or more timelines to the occupancy map by representing first time durations of the occupancy map corresponding to the timelines as busy and representing second time durations of the occupancy map as idle, the second time durations corresponding to time periods not included in the timelines.
14 . The non-transitory computer readable storage medium of claim 9 , wherein the instructions, when executed, cause the at least one processor to determine one or more operating parameters of the GPU based on the occupancy map, the workload of the GPU to be adjusted based on the one or more operating parameters.
15 . The non-transitory computer readable storage medium of claim 14 , wherein the one or more operating parameters include at least one of a busy time parameter, an idle time parameter, an occupancy time parameter, or a utilization parameter.
16 . A method to improve operation of a graphics processing unit (GPU), the method comprising:
populating a trace buffer based on one or more records in response to an execution of an instrumented GPU kernel by the GPU, corresponding ones of the records having a hardware thread identifier and a timestamp; generating one or more sub-traces based on at least some of the hardware thread identifiers; determining one or more timelines associated with the timestamps of the one or more sub-traces; generating an occupancy map associated with the GPU based on the one or more timelines; and adjusting a workload of the GPU based on the occupancy map.
17 . The method of claim 16 , wherein the one or more records include a first record having a first index, the one or more sub-traces include a first sub-trace including the first record, and further including assigning a second index to the first record in response to a determination the first sub-trace includes more than one of the one or more records.
18 . The method of claim 16 , further including inserting profiling instructions into a GPU kernel to generate the instrumented GPU kernel.
19 . The method of claim 18 , further including inserting the profiling instructions by inserting a first subset of the profiling instructions at a first address of the GPU kernel and inserting a second subset of the profiling instructions at a second address of the GPU kernel, the first address different from the second address.
20 . The method of claim 16 , further including mapping the one or more timelines to the occupancy map by representing first time durations of the occupancy map corresponding to the timelines as busy and representing second time durations of the occupancy map as idle, the second time durations corresponding to time periods not included in the timelines.
21 . The method of claim 16 , further including determining one or more operating parameters of the GPU based on the occupancy map, the workload of the GPU to be adjusted based on the one or more operating parameters.Join the waitlist — get patent alerts
Track US2021192674A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.