# US 2025/0370802 A1 · Electronic device and controlling method thereof

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

- Number: US 2025/0370802 A1
- Document ID: US20250370802A1
- Status: Published application
- Kind: A1
- Application number: 19/215,839
- Filed: 2025-05-22
- Published: 2025-12-04
- Earliest claimed: 2024-05-31
- Assignees: Samsung Electronics Co., Ltd.
- Applicants: Samsung Electronics Co., Ltd.
- Inventors: Minyoung KANG; Taegeon UM; Byungsoo OH; Wooyeon LEE
- Web page: https://patentgrep.com/patent/US20250370802A1

## CPC

- G06F 9/5016: {the resource being the memory}
- G06F 9/3867: {using instruction pipelines}
- G06F 9/5027: {the resource being a machine, e.g. CPUs, Servers, Terminals}
- G06F 9/5038: {considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration (scheduling strategies G06F9/4881 and subgroups)}
- G06F 9/505: {considering the load}
- G06F 9/5066: {Algorithms for mapping a plurality of inter-dependent sub-tasks onto a plurality of physical CPUs (mappping at compile time, see G06F8/451)}
- G06F 9/5083: {Techniques for rebalancing the load in a distributed system}
- G06F 2209/5017: Task decomposition
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

An electronic device and a controlling method thereof are provided. The electronic device includes memory, comprising one or more storage media, storing instructions and configured to store information on a neural network model and information on a plurality of resources for performing distributed learning on the neural network model, and a processor communicatively coupled to the memory and configured to perform a parallelism process including pipeline parallelism, data parallelism, and tensor parallelism based on the information on the neural network model and the information on the plurality of resources, wherein the instructions, when executed by the processor, cause the electronic device to acquire a first computation amount when performing the distributed learning from a time when a change in the plurality of resources is detected to a next checkpoint using the plurality of resources before the change, if the change is detected while performing the distributed learning according to a result of performing the parallelism process, perform the parallelism process again based on the information on the plurality of changed resources, acquire a second computation amount when performing the distributed learning from the time when the change is detected to the next checkpoint using the plurality of changed resources, as the result of the parallelism performed again, and perform the distributed learning by a method corresponding to a smaller computation amount of the first computation amount and the second computation amount.

## Claims

### Claim 1

An electronic device comprising:
memory, comprising one or more storage media, storing instructions and configured to store information on a neural network model and information on a plurality of resources for performing distributed learning on the neural network model; and
a processor communicatively coupled to the memory and configured to perform a parallelism process including pipeline parallelism, data parallelism, and tensor parallelism based on the information on the neural network model and the information on the plurality of resources,
wherein the instructions, when executed by the processor, cause the electronic device to:
acquire a first computation amount when performing the distributed learning from a time when a change in the plurality of resources is detected to a next checkpoint using the plurality of resources before the change, if the change is detected while performing the distributed learning according to a result of performing the parallelism process,
perform the parallelism process again based on the information on the plurality of changed resources,
acquire a second computation amount when performing the distributed learning from the time when the change is detected to the next checkpoint using the plurality of changed resources, as the result of the parallelism process performed again, and
perform the distributed learning by a method corresponding to a smaller computation amount of the first computation amount and the second computation amount.

### Claim 2 (depends on 1)

The electronic device of claim 1, wherein the instructions, when executed by the processor, further cause the electronic device to:
acquire a third computation amount when performing the distributed learning from a checkpoint before the time when the change is detected to the next checkpoint using the plurality of changed resources, as the result of the parallelism process performed again, and
perform the distributed learning by a method corresponding to a smallest computation amount among a sum of a fourth computation amount and the first computation amount, a sum of the fourth computation amount and the second computation amount, and the third computation amount from a previous checkpoint to the time when the change is detected.

### Claim 3 (depends on 1)

The electronic device of claim 1, wherein the instructions, when executed by the processor, further cause the electronic device to:
perform the pipeline parallelism to identify a plurality of combinations that allocate the plurality of resources to a plurality of stages that divide layers included in the neural network model,
determine at least one resource performing the data parallelism and at least one resource performing the tensor parallelism among the plurality of resources so that a ratio of the data parallelism is maximized to determine each candidate parallelism method of each of the plurality of combinations,
identify an optimal parallelism method among the candidate parallelism methods as a result of performing the parallelism process based on an execution time of the distributed learning according to each of the candidate parallelism methods identified for each of the plurality of combinations, and
perform the distributed learning on the neural network model based on the optimal parallelism method.

### Claim 4 (depends on 3)

The electronic device of claim 3, wherein the instructions, when executed by the processor, further cause the electronic device to:
identify whether there is a resource exceeding memory usage among the plurality of resources when performing the distributed learning according to a first parallelism method in which the ratio of the data parallelism is maximized, and
determine the first parallelism method as the candidate parallelism method when it is identified that there is no resource exceeding the memory usage.

### Claim 5 (depends on 4)

The electronic device of claim 4, wherein the instructions, when executed by the processor, further cause the electronic device to:
determine a second parallelism method in which the first parallelism method is changed by reallocating the layers to the plurality of resources so that the memory usage does not exceed when it is identified that there is the resource exceeding the memory usage, and
determine the second parallelism method as the candidate parallelism method.

### Claim 6 (depends on 5)

The electronic device of claim 5, wherein the instructions, when executed by the processor, further cause the electronic device to:
determine a third parallelism method having a ratio of the data parallelism that is next higher than that of the first parallelism method when it is identified that there is the resource exceeding the memory usage, and
determine the third parallelism method as the candidate parallelism method.

### Claim 7 (depends on 6)

The electronic device of claim 6, wherein the instructions, when executed by the processor, further cause the electronic device to determine the candidate parallelism method among the second parallelism method and the third parallelism method based on the execution time of the distributed learning according to each of the second parallelism method and the third parallelism method.

### Claim 8 (depends on 3)

The electronic device of claim 3, wherein, when there is a stage including two or more resources having different performance among a plurality of stages, the instructions, when executed by the processor, further cause the electronic device to allocate the plurality of resources to the plurality of stages based on performances of the two or more resources.

### Claim 9 (depends on 3)

The electronic device of claim 3, wherein the information on the plurality of resources includes information on processing performance of each of the plurality of resources, a bandwidth between the plurality of resources, and a bandwidth between the plurality of stages.

### Claim 10 (depends on 3)

The electronic device of claim 3, wherein the instructions, when executed by the processor, further cause the electronic device to calculate the execution time by performing the distributed learning on each of candidate parallelism methods for a predetermined time.

### Claim 11

A method of controlling an electronic device, the method comprising:
performing a parallelism process including pipeline parallelism, data parallelism, and tensor parallelism based on information on a neural network model and information on a plurality of resources for performing distributed learning on the neural network model;
acquiring a first computation amount when performing the distributed learning from a time when a change in the plurality of resources is detected to a next checkpoint using the plurality of resources before the change, if the change is detected while performing the distributed learning according to a result of performing the parallelism process;
performing the parallelism process again based on the information on the plurality of changed resources;
acquiring a second computation amount when performing the distributed learning from the time when the change is detected to the next checkpoint using the plurality of changed resources, as the result of the parallelism process performed again; and
performing the distributed learning by a method corresponding to a smaller computation amount of the first computation amount and the second computation amount.

### Claim 12 (depends on 11)

The method of claim 11, further comprising:
calculating a third computation amount when performing the distributed learning from a checkpoint before the time when the change is detected to the next checkpoint using the plurality of changed resources, as the result of the parallelism process performed again; and
performing the distributed learning by a method corresponding to a smallest computation amount among a sum of a fourth computation amount and the first computation amount, a sum of the fourth computation amount and the second computation amount, and the third computation amount from a previous checkpoint to the time when the change is detected.

### Claim 13 (depends on 11)

The method of claim 11, further comprising:
performing the pipeline parallelism to identify a plurality of combinations that allocate the plurality of resources to a plurality of stages that divide layers included in the neural network model;
determining at least one resource performing the data parallelism and at least one resource performing the tensor parallelism among the plurality of resources so that a ratio of the data parallelism is maximized to determine each candidate parallelism method of each of the plurality of combinations;
identifying an optimal parallelism method among the candidate parallelism methods as a result of performing the parallelism process based on an execution time of the distributed learning according to each of the candidate parallelism methods identified for each of the plurality of combinations; and
performing the distributed learning on the neural network model based on the optimal parallelism method.

### Claim 14 (depends on 13)

The method of claim 13, wherein the determining of each of candidate parallelism methods for each of the plurality of combinations includes:
identifying whether there is a resource exceeding memory usage among the plurality of resources when performing the distributed learning according to a first parallelism method in which the ratio of the data parallelism is maximized; and
determining the first parallelism method as the candidate parallelism method when it is identified that there is no resource exceeding the memory usage.

### Claim 15 (depends on 14)

The method of claim 14, wherein the determining of each of the candidate parallelism methods for each of the plurality of combinations includes:
determining a second parallelism method in which the first parallelism method is changed by reallocating the layers to the plurality of resources so that the memory usage does not exceed when it is identified that there is the resource exceeding the memory usage; and
determining the second parallelism method as the candidate parallelism method.

### Claim 16 (depends on 15)

The method of claim 15, further comprising:
determining a third parallelism method having a ratio of the data parallelism that is next higher than that of the first parallelism method when it is identified that there is the resource exceeding the memory usage; and
determining the third parallelism method as the candidate parallelism method.

### Claim 17 (depends on 16)

The method of claim 16, further comprising:
determining the candidate parallelism method among the second parallelism method and the third parallelism method based on the execution time of the distributed learning according to each of the second parallelism method and the third parallelism method.

### Claim 18 (depends on 13)

The method of claim 13, further comprising:
when there is a stage including two or more resources having different performance among a plurality of stages, allocating the plurality of resources to the plurality of stages based on performances of the two or more resources.

### Claim 19

One or more non-transitory computer-readable storage media storing one or more computer programs including computer-executable instructions that, when executed by one or more processors of an electronic device individually or collectively, cause the electronic device to perform operations, the operations comprising:
performing a parallelism process including pipeline parallelism, data parallelism, and tensor parallelism based on information on a neural network model and information on a plurality of resources for performing distributed learning on the neural network model;
acquiring a first computation amount when performing the distributed learning from a time when a change in the plurality of resources is detected to a next checkpoint using the plurality of resources before the change, if the change is detected while performing the distributed learning according to a result of performing the parallelism process;
performing the parallelism process again based on the information on the plurality of changed resources;
acquiring a second computation amount when performing the distributed learning from the time when the change is detected to the next checkpoint using the plurality of changed resources, as the result of the parallelism process performed again; and
performing the distributed learning by a method corresponding to a smaller computation amount of the first computation amount and the second computation amount.

### Claim 20 (depends on 19)

The one or more non-transitory computer-readable storage media of claim 19, the operations further comprising:
calculating a third computation amount when performing the distributed learning from a checkpoint before the time when the change is detected to the next checkpoint using the plurality of changed resources, as the result of the parallelism process performed again; and
performing the distributed learning by a method corresponding to a smallest computation amount among a sum of a fourth computation amount and the first computation amount, a sum of the fourth computation amount and the second computation amount, and the third computation amount from a previous checkpoint to the time when the change is detected.
