# US 2024/0005446 A1 · Methods, systems, and non-transitory storage media for graphics memory allocation

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2024/0005446 A1
- Document ID: US20240005446A1
- Status: Published application
- Kind: A1
- Application number: 18/344,500
- Filed: 2023-06-29
- Published: 2024-01-04
- Earliest claimed: 2022-06-29
- Assignees: Alipay (Hangzhou) Information Technology Co., Ltd.
- Applicants: Alipay (Hangzhou) Information Technology Co., Ltd.
- Inventors: Xiaofeng Mei; Yao Zhang; Junping Zhao
- Web page: https://patentgrep.com/patent/US20240005446A1

## CPC

- G06T 1/60: Memory management
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL

## Abstract

In response to a graphics memory allocation request generated during the running of a target task and for graphics memory needed during running of the target task, target data generated during running of each sub-task of multiple sub-tasks is classified, where a type of the target data comprises at least first data, and where the first data is not used by a subsequent sub-task. Multiple target graphics memory pools are allocated to the multiple sub-tasks. Each target graphics memory pool of the multiple target graphics memory pools is divided into at least one graphics memory block based on a type of the target data, where the at least one graphics memory block includes at least a first graphics memory block corresponding to the first data, and where multiple first graphics memory blocks corresponding to the multiple sub-tasks are mapped to a same target physical memory address.

## Claims

### Claim 1

A computer-implemented method for graphics memory allocation, comprising:
in response to a graphics memory allocation request for graphics memory needed during running of a target task, classifying target data generated during running of each sub-task of multiple sub-tasks, wherein the target task comprises multiple serial sub-tasks, wherein the graphics memory allocation request is generated during the running of the target task, wherein a type of the target data comprises at least first data, and wherein the first data is not used by a subsequent sub-task;
allocating multiple target graphics memory pools to the multiple sub-tasks; and
dividing each target graphics memory pool of the multiple target graphics memory pools into at least one graphics memory block based on a type of the target data, wherein the at least one graphics memory block comprises at least a first graphics memory block corresponding to the first data, and wherein multiple first graphics memory blocks corresponding to the multiple sub-tasks are mapped to a same target physical memory address.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, further comprising:
during running of each sub-task of multiple sub-tasks:
storing the target data in a corresponding graphics memory block based on the type of the target data; and
releasing graphics memory space corresponding to the same target physical memory address to the first data of a next sub-task after the running of a current sub-task ends.

### Claim 3 (depends on 1)

The computer-implemented method of claim 1, wherein classifying target data generated during running of each sub-task of multiple sub-tasks, comprises:
adding a type label to the target data based on the type of the target data, wherein the type label comprises at least a first label corresponding to the first data.

### Claim 4 (depends on 3)

The computer-implemented method of claim 3, wherein dividing each target graphics memory pool of the multiple target graphics memory pools into at least one graphics memory block based on a type of the target data, comprises:
dividing at least a part of graphics memory space of each target graphics memory pool into the first graphics memory block;
allocating the first graphics memory block to the first data; and
mapping the multiple first graphics memory blocks to the same target physical memory address.

### Claim 5 (depends on 4)

The computer-implemented method of claim 4, wherein:
the multiple first graphics memory blocks are virtual graphics memories, and
mapping the multiple first graphics memory blocks to the same target physical memory address, comprises:
mapping the multiple first graphics memory blocks to multiple virtual graphics memories based on a singleton pattern;
mapping the multiple virtual graphics memories to the same target physical memory address; and
feeding back multiple virtual graphics memory pointers, wherein each virtual graphic memory pointer of the multiple virtual graphics memory pointers comprises a same target physical memory address and a capacity of the first graphics memory block corresponding to each virtual graphics memory pointer.

### Claim 6 (depends on 4)

The computer-implemented method of claim 4, wherein:
the type of the target data comprises second data;
the second data is used by a subsequent sub-task;
the type label comprises a second label corresponding to the second data;
the at least one graphics memory block comprises a second graphics memory block corresponding to the second data; and
dividing each target graphics memory pool of the multiple target graphics memory pools into at least one graphics memory block based on a type of the target data, comprises:
dividing at least a part of graphics memory space of each target graphics memory pool into the second graphics memory block; and
allocating the second graphics memory block to the second data.

### Claim 7 (depends on 6)

The computer-implemented method of claim 6, wherein the second data comprises input data, output data, and default data;
the second label comprises the following:
an input data label, corresponding to the input data;
an output data label, corresponding to the output data; and
a default data label, corresponding to the default data; and
the second graphics memory block comprises the following:
an input/output graphics memory block, corresponding to the input data and the output data; and
a default graphics memory block, corresponding to the default data.

### Claim 8 (depends on 4)

The computer-implemented method of claim 4, wherein the first data comprises activation value data and workspace data;
the first label comprises the following:
an activation value data label, corresponding to the activation value data; and
a workspace data label, corresponding to the workspace data; and
the first graphics memory block comprises the following:
an activation value graphics memory block, corresponding to the activation value data; and
a workspace graphics memory block, corresponding to the workspace data.

### Claim 9

A non-transitory, computer-readable medium storing one or more instructions executable by a computer system to perform one or more operations, comprising:
in response to a graphics memory allocation request for graphics memory needed during running of a target task, classifying target data generated during running of each sub-task of multiple sub-tasks, wherein the target task comprises multiple serial sub-tasks, wherein the graphics memory allocation request is generated during the running of the target task, wherein a type of the target data comprises at least first data, and wherein the first data is not used by a subsequent sub-task;
allocating multiple target graphics memory pools to the multiple sub-tasks; and
dividing each target graphics memory pool of the multiple target graphics memory pools into at least one graphics memory block based on a type of the target data, wherein the at least one graphics memory block comprises at least a first graphics memory block corresponding to the first data, and wherein multiple first graphics memory blocks corresponding to the multiple sub-tasks are mapped to a same target physical memory address.

### Claim 10 (depends on 9)

The non-transitory, computer-readable medium of claim 9, further comprising:
during running of each sub-task of multiple sub-tasks:
storing the target data in a corresponding graphics memory block based on the type of the target data; and
releasing graphics memory space corresponding to the same target physical memory address to the first data of a next sub-task after the running of a current sub-task ends.

### Claim 11 (depends on 9)

The non-transitory, computer-readable medium of claim 9, wherein classifying target data generated during running of each sub-task of multiple sub-tasks, comprises:
adding a type label to the target data based on the type of the target data, wherein the type label comprises at least a first label corresponding to the first data.

### Claim 12 (depends on 11)

The non-transitory, computer-readable medium of claim 11, wherein dividing each target graphics memory pool of the multiple target graphics memory pools into at least one graphics memory block based on a type of the target data, comprises:
dividing at least a part of graphics memory space of each target graphics memory pool into the first graphics memory block;
allocating the first graphics memory block to the first data; and
mapping the multiple first graphics memory blocks to the same target physical memory address.

### Claim 13 (depends on 12)

The non-transitory, computer-readable medium of claim 12, wherein:
the multiple first graphics memory blocks are virtual graphics memories, and
mapping the multiple first graphics memory blocks to the same target physical memory address, comprises:
mapping the multiple first graphics memory blocks to multiple virtual graphics memories based on a singleton pattern;
mapping the multiple virtual graphics memories to the same target physical memory address; and
feeding back multiple virtual graphics memory pointers, wherein each virtual graphic memory pointer of the multiple virtual graphics memory pointers comprises a same target physical memory address and a capacity of the first graphics memory block corresponding to each virtual graphics memory pointer.

### Claim 14 (depends on 12)

The non-transitory, computer-readable medium of claim 12, wherein:
the type of the target data comprises second data;
the second data is used by a subsequent sub-task;
the type label comprises a second label corresponding to the second data;
the at least one graphics memory block comprises a second graphics memory block corresponding to the second data; and
dividing each target graphics memory pool of the multiple target graphics memory pools into at least one graphics memory block based on a type of the target data, comprises:
dividing at least a part of graphics memory space of each target graphics memory pool into the second graphics memory block; and
allocating the second graphics memory block to the second data.

### Claim 15 (depends on 14)

The non-transitory, computer-readable medium of claim 14, wherein the second data comprises input data, output data, and default data;
the second label comprises the following:
an input data label, corresponding to the input data;
an output data label, corresponding to the output data; and
a default data label, corresponding to the default data; and
the second graphics memory block comprises the following:
an input/output graphics memory block, corresponding to the input data and the output data; and
a default graphics memory block, corresponding to the default data.

### Claim 16 (depends on 12)

The non-transitory, computer-readable medium of claim 12, wherein the first data comprises activation value data and workspace data;
the first label comprises the following:
an activation value data label, corresponding to the activation value data; and
a workspace data label, corresponding to the workspace data; and
the first graphics memory block comprises the following:
an activation value graphics memory block, corresponding to the activation value data; and
a workspace graphics memory block, corresponding to the workspace data.

### Claim 17

A computer-implemented system, comprising:
one or more computers; and
one or more computer memory devices interoperably coupled with the one or more computers and having tangible, non-transitory, machine-readable media storing one or more instructions that, when executed by the one or more computers, perform one or more operations, comprising:
in response to a graphics memory allocation request for graphics memory needed during running of a target task, classifying target data generated during running of each sub-task of multiple sub-tasks, wherein the target task comprises multiple serial sub-tasks, wherein the graphics memory allocation request is generated during the running of the target task, wherein a type of the target data comprises at least first data, and wherein the first data is not used by a subsequent sub-task;
allocating multiple target graphics memory pools to the multiple sub-tasks; and
dividing each target graphics memory pool of the multiple target graphics memory pools into at least one graphics memory block based on a type of the target data, wherein the at least one graphics memory block comprises at least a first graphics memory block corresponding to the first data, and wherein multiple first graphics memory blocks corresponding to the multiple sub-tasks are mapped to a same target physical memory address.

### Claim 18 (depends on 17)

The non-transitory, computer-readable medium of claim 17, further comprising:
during running of each sub-task of multiple sub-tasks:
storing the target data in a corresponding graphics memory block based on the type of the target data; and
releasing graphics memory space corresponding to the same target physical memory address to the first data of a next sub-task after the running of a current sub-task ends.

### Claim 19 (depends on 17)

The computer-implemented system of claim 17, wherein classifying target data generated during running of each sub-task of multiple sub-tasks, comprises:
adding a type label to the target data based on the type of the target data, wherein the type label comprises at least a first label corresponding to the first data.

### Claim 20 (depends on 19)

The computer-implemented system of claim 19, wherein dividing each target graphics memory pool of the multiple target graphics memory pools into at least one graphics memory block based on a type of the target data, comprises:
dividing at least a part of graphics memory space of each target graphics memory pool into the first graphics memory block;
allocating the first graphics memory block to the first data; and
mapping the multiple first graphics memory blocks to the same target physical memory address.
