Patent ID: 11941724
Assignee: HUAWEI TECHNOLOGIES CO., LTD.
Field: Computer technology (Electrical engineering)
Classification: CPC G  Y | IPC G

Claim 16:
17. A model inference apparatus based on a graphics rendering pipeline, comprising at least one processor, wherein the at least one processor is configured to:
obtain an instruction stream in a render thread;
extract and save texture data information from the instruction stream, wherein the texture data information comprises texture data; and
input the texture data information to a graphics processing unit (GPU) rendering pipeline, wherein the GPU rendering pipeline performs GPU model-based inference on the texture data based on a GPU model to obtain an inference result of the texture data, and the GPU model is a model running in a GPU,
wherein the at least one processor is further configured to load the GPU model to a memory;
wherein the loading of the GPU model comprises:
obtaining a layered structure of a training model and parameters of each layer in the render thread;
generating, based on the layered structure and the parameters of each layer, a fragment shader corresponding to each layer in the layered structure; and
loading the fragment shader to the memory, and

wherein the texture data information further comprises a texture ID of the texture data in a GPU memory, and the at least one processor is further configured to determine an input data position and an output data position of the fragment shader corresponding to each layer based on the texture ID and the GPU model, wherein the GPU rendering pipeline sequentially executes the fragment shader corresponding to each layer based on the input data position and the output data position of the fragment shader corresponding to each layer.