WO2023068489A1 - 상이한 데이터 타입들을 지원하는 npu를 포함하는 전자 장치 및 그 제어 방법 - Google Patents

상이한 데이터 타입들을 지원하는 npu를 포함하는 전자 장치 및 그 제어 방법 Download PDF

Info

Publication number
WO2023068489A1
WO2023068489A1 PCT/KR2022/009974 KR2022009974W WO2023068489A1 WO 2023068489 A1 WO2023068489 A1 WO 2023068489A1 KR 2022009974 W KR2022009974 W KR 2022009974W WO 2023068489 A1 WO2023068489 A1 WO 2023068489A1
Authority
WO
WIPO (PCT)
Prior art keywords
integer
bits
port
electronic device
representing
Prior art date
Application number
PCT/KR2022/009974
Other languages
English (en)
French (fr)
Inventor
웬두이탄
최진
Original Assignee
삼성전자 주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from KR1020210164971A external-priority patent/KR20230055315A/ko
Application filed by 삼성전자 주식회사 filed Critical 삼성전자 주식회사
Priority to EP22883719.1A priority Critical patent/EP4390661A1/en
Priority to US17/877,149 priority patent/US20230123312A1/en
Publication of WO2023068489A1 publication Critical patent/WO2023068489A1/ko

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F5/00Methods or arrangements for data conversion without changing the order or content of the data handled
    • G06F5/01Methods or arrangements for data conversion without changing the order or content of the data handled for shifting, e.g. justifying, scaling, normalising
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F5/00Methods or arrangements for data conversion without changing the order or content of the data handled
    • G06F5/06Methods or arrangements for data conversion without changing the order or content of the data handled for changing the speed of data flow, i.e. speed regularising or timing, e.g. delay lines, FIFO buffers; over- or underrun control therefor
    • G06F5/08Methods or arrangements for data conversion without changing the order or content of the data handled for changing the speed of data flow, i.e. speed regularising or timing, e.g. delay lines, FIFO buffers; over- or underrun control therefor having a sequence of storage locations, the intermediate ones not being accessible for either enqueue or dequeue operations, e.g. using a shift register
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/491Computations with decimal numbers radix 12 or 20.
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/491Computations with decimal numbers radix 12 or 20.
    • G06F7/498Computations with decimal numbers radix 12 or 20. using counter-type accumulators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/544Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices for evaluating functions by calculation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/06Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
    • G06N3/063Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons using electronic means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • the descriptions below relate to an electronic device including an NPU supporting different data types and a control method thereof.
  • An electronic device to which artificial intelligence technology is applied can self-learn and determine a surrounding situation independently of updating instructions by an external signal.
  • an electronic device applied with artificial intelligence technology actively learns and determines a surrounding situation, it may be possible to automatically respond to a situation requiring human judgment based on the electronic device.
  • hardware components for performing calculations specialized for artificial intelligence are being studied.
  • a method for enabling an electronic device to more efficiently perform an operation related to artificial intelligence may be required.
  • An electronic device may include an arithmetic circuit.
  • the operation circuit is different from a first data type for representing a floating point number, and a multiplication operation based on a plurality of integer numbers of a second data type for representing an integer.
  • a combiner for combining a first integer and a second integer among the plurality of integers may be included.
  • the operation circuit may include a multiplier for obtaining a product of bits corresponding to mantissas of the floating-point number distinguished by the first data type, a third integer among the plurality of integers, A fourth integer input to a first port of a multiplier and representing a combination of the first integer and the second integer by the combiner is input to a second port of the multiplier.
  • the arithmetic circuit in response to identifying a fifth integer representative of a product of the third integer and the fourth integer, from a third port different from the first port and the second port of the multiplier, the arithmetic circuit performs the identified second integer.
  • An arithmetic circuit comprising a converter outputting a sixth integer representing a product of the first integer and the third integer, and a seventh integer representing a product of the second integer and the third integer, based on 5 integers can include
  • a request to perform a multiplication operation based on a plurality of integers of a second data type representing an integer and different from a first data type representing a floating point number is received.
  • combining a first integer and a second integer among the plurality of integers may be included.
  • the method is a first port of a multiplier for obtaining a product of bits corresponding to the mantissas of the floating-point number distinguished by the first data type, and the mantissa based on the number of bits of the mantissa.
  • An operation of transmitting a third integer among a plurality of integers may be included.
  • a fourth integer representing a combination of the first integer and the second integer is transmitted to a second port distinct from the first port of the multiplier. It may include an operation of transmitting.
  • the method comprises the obtained fifth integer. and obtaining, based on the integers, a sixth integer representing a product of the first integer and the third integer and a seventh integer representing a product of the second integer and the third integer.
  • An electronic device performs a multiplication operation based on a plurality of integers of a second data type that is different from a first data type for representing a floating point number and represents an integer.
  • a first combiner for combining a first integer and a second integer among the plurality of integers may be included.
  • the electronic device may include a second combiner that combines a third integer and a fourth integer among the plurality of integers in response to receiving the request.
  • the electronic device may include a multiplier for obtaining a product of bits corresponding to mantissas of the floating-point number distinguished by the first data type, and indicating a combination of the first integer and the second integer of the first combiner.
  • a fifth integer is input to the first port of the multiplier, and a sixth integer representing a combination of the third integer and the fourth integer of the second combiner is input to the second port of the multiplier.
  • the electronic device in response to identifying a seventh integer representing a product of the fifth integer and the sixth integer, from a third port different from the first port and the second port of the multiplier, the identified second integer Based on 7 integers, a converter for obtaining products of a combination of any one of the first integer or the second integer and any one of the third integer or the fourth integer may be obtained.
  • a method of an electronic device includes a request for performing a multiplication operation based on a plurality of integers of a second data type representing an integer and different from a first data type representing a floating point number. It may include an operation of combining a first integer and a second integer among the plurality of integers in response to receiving. The method may include combining a third integer and a fourth integer from among the plurality of integers in response to receiving the integer. In the method, a fifth integer representing a combination of the first integer and the second integer and a sixth integer representing a combination of the third integer and the fourth integer are distinguished by the first data type.
  • the method is responsive to identifying, from a third port different from the first port and the second port of the multiplier, a seventh integer representing a product of the fifth integer and the sixth integer, the identified seventh integer. Based on the integers, an operation of obtaining products of a combination of any one of the first integer or the second integer and any one of the third integer or the fourth integer may be obtained.
  • an electronic device includes a neural processing unit (NPU) including a processor, a memory, and a neural engine for training a neural network having a plurality of layers, wherein the neural engine includes an accumulation circuit. circuit), and an arithmetic circuit including a combiner, a multiplier, an adder, and a converter, the converter including a bit selector, a bit adjuster, a switch, and a shift register, and a controller that accumulates and stores.
  • the controller may accumulate, and store, in the accumulation circuit, numerical values output from different channels of the calculation circuit to calculate a weighted sum corresponding to nodes included in a specific layer of the neural network.
  • the controller can selectively activate at least one of the combiner, the adder, the bit selector, or the bit adjuster based at least in part on an operating state.
  • An electronic device may more efficiently perform an operation related to artificial intelligence.
  • FIG. 1 is a block diagram of an electronic device in a network environment, according to various embodiments.
  • FIG. 2 is a block diagram illustrating one or more processors included in an electronic device according to an exemplary embodiment.
  • FIG. 3 is an exemplary diagram for describing a neural network executed in an electronic device according to an exemplary embodiment.
  • 4A to 4B are exemplary block diagrams for explaining the structure of a circuit for performing an operation related to a neural network by an electronic device according to an exemplary embodiment.
  • FIG. 5 is a block diagram illustrating an example of an arithmetic circuit of an electronic device according to an exemplary embodiment.
  • 6A to 6C are diagrams for explaining different states of the arithmetic circuit of FIG. 5 .
  • FIG. 7 is a diagram for explaining an operation of performing a multiplication operation of integers using a multiplier related to a mantissa of a floating point number in the calculation circuit of FIG. 5 .
  • FIG. 8 is a block diagram illustrating another example of an arithmetic circuit of an electronic device according to an exemplary embodiment.
  • 9A to 9D are diagrams for explaining different states of the arithmetic circuit of FIG. 5 .
  • FIG. 10 is a diagram for explaining an operation of performing a multiplication operation of integers using a multiplier related to a mantissa of a floating-point number in the calculation circuit of FIG. 8 .
  • FIG. 11 is a flowchart illustrating an operation of processing input data based on a neural network by an electronic device according to an exemplary embodiment.
  • FIG. 12 is a flowchart illustrating an operation of controlling one or more neural engines by an electronic device according to an exemplary embodiment.
  • FIG. 13 is a flowchart illustrating an operation of performing an operation based on different data types by an electronic device according to an exemplary embodiment.
  • FIG. 14 is a flowchart illustrating an operation performed by an electronic device to obtain one or more integers to be input to a multiplier related to a mantissa of a floating-point number according to an embodiment.
  • 15 is a flowchart illustrating an operation performed by an electronic device based on bits output from a multiplier of an arithmetic circuit according to an embodiment.
  • the components are not limited.
  • a (e.g., first) element is referred to as being "(functionally or communicatively) coupled to" or “connected to” another (e.g., second) element, that element refers to the other (e.g., second) element. It may be directly connected to the component or connected through another component (eg, a third component).
  • module used in this document includes a unit composed of hardware, software, or firmware, and may be used interchangeably with terms such as logic, logic block, component, or circuit, for example.
  • a module may be an integral part or a minimum unit or part thereof that performs one or more functions.
  • the module may be composed of an application-specific integrated circuit (ASIC).
  • ASIC application-specific integrated circuit
  • FIG. 1 is a block diagram of an electronic device 101 within a network environment 100, according to various embodiments.
  • an electronic device 101 communicates with an electronic device 102 through a first network 198 (eg, a short-range wireless communication network) or through a second network 199. It is possible to communicate with at least one of the electronic device 104 or the server 108 through (eg, a long-distance wireless communication network). According to one embodiment, the electronic device 101 may communicate with the electronic device 104 through the server 108 .
  • a first network 198 eg, a short-range wireless communication network
  • the server 108 e.g, a long-distance wireless communication network
  • the electronic device 101 includes a processor 120, a memory 130, an input module 150, an audio output module 155, a display module 160, an audio module 170, a sensor module ( 176), interface 177, connection terminal 178, haptic module 179, camera module 180, power management module 188, battery 189, communication module 190, subscriber identification module 196 , or the antenna module 197 may be included.
  • at least one of these components eg, the connection terminal 178) may be omitted or one or more other components may be added.
  • some of these components eg, sensor module 176, camera module 180, or antenna module 197) are integrated into a single component (eg, display module 160). It can be.
  • the processor 120 for example, executes software (eg, the program 140) to cause at least one other component (eg, hardware or software component) of the electronic device 101 connected to the processor 120. It can control and perform various data processing or calculations. According to one embodiment, as at least part of data processing or operation, the processor 120 transfers instructions or data received from other components (e.g., sensor module 176 or communication module 190) to volatile memory 132. , processing commands or data stored in the volatile memory 132 , and storing resultant data in the non-volatile memory 134 .
  • software eg, the program 140
  • the processor 120 transfers instructions or data received from other components (e.g., sensor module 176 or communication module 190) to volatile memory 132. , processing commands or data stored in the volatile memory 132 , and storing resultant data in the non-volatile memory 134 .
  • the processor 120 may include a main processor 121 (eg, a central processing unit or an application processor) or a secondary processor 123 (eg, a graphic processing unit, a neural network processing unit ( NPU: neural processing unit (NPU), image signal processor, sensor hub processor, or communication processor).
  • a main processor 121 eg, a central processing unit or an application processor
  • a secondary processor 123 eg, a graphic processing unit, a neural network processing unit ( NPU: neural processing unit (NPU), image signal processor, sensor hub processor, or communication processor.
  • NPU neural network processing unit
  • the secondary processor 123 may be implemented separately from or as part of the main processor 121 .
  • the secondary processor 123 may, for example, take the place of the main processor 121 while the main processor 121 is in an inactive (eg, sleep) state, or the main processor 121 is active (eg, running an application). ) state, together with the main processor 121, at least one of the components of the electronic device 101 (eg, the display module 160, the sensor module 176, or the communication module 190) It is possible to control at least some of the related functions or states.
  • the auxiliary processor 123 eg, image signal processor or communication processor
  • the auxiliary processor 123 may include a hardware structure specialized for processing an artificial intelligence model.
  • AI models can be created through machine learning. Such learning may be performed, for example, in the electronic device 101 itself where the artificial intelligence model is performed, or may be performed through a separate server (eg, the server 108).
  • the learning algorithm may include, for example, supervised learning, unsupervised learning, semi-supervised learning or reinforcement learning, but in the above example Not limited.
  • the artificial intelligence model may include a plurality of artificial neural network layers.
  • Artificial neural networks include deep neural networks (DNNs), convolutional neural networks (CNNs), recurrent neural networks (RNNs), restricted boltzmann machines (RBMs), deep belief networks (DBNs), bidirectional recurrent deep neural networks (BRDNNs), It may be one of deep Q-networks or a combination of two or more of the foregoing, but is not limited to the foregoing examples.
  • the artificial intelligence model may include, in addition or alternatively, software structures in addition to hardware structures.
  • the memory 130 may store various data used by at least one component (eg, the processor 120 or the sensor module 176) of the electronic device 101 .
  • the data may include, for example, input data or output data for software (eg, program 140) and commands related thereto.
  • the memory 130 may include volatile memory 132 or non-volatile memory 134 .
  • the program 140 may be stored as software in the memory 130 and may include, for example, an operating system 142 , middleware 144 , or an application 146 .
  • the input module 150 may receive a command or data to be used by a component (eg, the processor 120) of the electronic device 101 from the outside of the electronic device 101 (eg, a user).
  • the input module 150 may include, for example, a microphone, a mouse, a keyboard, a key (eg, a button), or a digital pen (eg, a stylus pen).
  • the sound output module 155 may output sound signals to the outside of the electronic device 101 .
  • the sound output module 155 may include, for example, a speaker or a receiver.
  • the speaker can be used for general purposes such as multimedia playback or recording playback.
  • a receiver may be used to receive an incoming call. According to one embodiment, the receiver may be implemented separately from the speaker or as part of it.
  • the display module 160 may visually provide information to the outside of the electronic device 101 (eg, a user).
  • the display module 160 may include, for example, a display, a hologram device, or a projector and a control circuit for controlling the device.
  • the display module 160 may include a touch sensor set to detect a touch or a pressure sensor set to measure the intensity of force generated by the touch.
  • the audio module 170 may convert sound into an electrical signal or vice versa. According to one embodiment, the audio module 170 acquires sound through the input module 150, the sound output module 155, or an external electronic device connected directly or wirelessly to the electronic device 101 (eg: Sound may be output through the electronic device 102 (eg, a speaker or a headphone).
  • the audio module 170 acquires sound through the input module 150, the sound output module 155, or an external electronic device connected directly or wirelessly to the electronic device 101 (eg: Sound may be output through the electronic device 102 (eg, a speaker or a headphone).
  • the sensor module 176 detects an operating state (eg, power or temperature) of the electronic device 101 or an external environmental state (eg, a user state), and generates an electrical signal or data value corresponding to the detected state. can do.
  • the sensor module 176 may include, for example, a gesture sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a grip sensor, a proximity sensor, a color sensor, an IR (infrared) sensor, a bio sensor, It may include a temperature sensor, humidity sensor, or light sensor.
  • the interface 177 may support one or more designated protocols that may be used to directly or wirelessly connect the electronic device 101 to an external electronic device (eg, the electronic device 102).
  • the interface 177 may include, for example, a high definition multimedia interface (HDMI), a universal serial bus (USB) interface, an SD card interface, or an audio interface.
  • HDMI high definition multimedia interface
  • USB universal serial bus
  • SD card interface Secure Digital Card interface
  • audio interface audio interface
  • connection terminal 178 may include a connector through which the electronic device 101 may be physically connected to an external electronic device (eg, the electronic device 102).
  • the connection terminal 178 may include, for example, an HDMI connector, a USB connector, an SD card connector, or an audio connector (eg, a headphone connector).
  • the haptic module 179 may convert electrical signals into mechanical stimuli (eg, vibration or motion) or electrical stimuli that a user may perceive through tactile or kinesthetic senses.
  • the haptic module 179 may include, for example, a motor, a piezoelectric element, or an electrical stimulation device.
  • the camera module 180 may capture still images and moving images. According to one embodiment, the camera module 180 may include one or more lenses, image sensors, image signal processors, or flashes.
  • the power management module 188 may manage power supplied to the electronic device 101 .
  • the power management module 188 may be implemented as at least part of a power management integrated circuit (PMIC), for example.
  • PMIC power management integrated circuit
  • the battery 189 may supply power to at least one component of the electronic device 101 .
  • the battery 189 may include, for example, a non-rechargeable primary cell, a rechargeable secondary cell, or a fuel cell.
  • the communication module 190 is a direct (eg, wired) communication channel or a wireless communication channel between the electronic device 101 and an external electronic device (eg, the electronic device 102, the electronic device 104, or the server 108). Establishment and communication through the established communication channel may be supported.
  • the communication module 190 may include one or more communication processors that operate independently of the processor 120 (eg, an application processor) and support direct (eg, wired) communication or wireless communication.
  • the communication module 190 is a wireless communication module 192 (eg, a cellular communication module, a short-range wireless communication module, or a global navigation satellite system (GNSS) communication module) or a wired communication module 194 (eg, : a local area network (LAN) communication module or a power line communication module).
  • a wireless communication module 192 eg, a cellular communication module, a short-range wireless communication module, or a global navigation satellite system (GNSS) communication module
  • GNSS global navigation satellite system
  • wired communication module 194 eg, : a local area network (LAN) communication module or a power line communication module.
  • a corresponding communication module is a first network 198 (eg, a short-range communication network such as Bluetooth, wireless fidelity (WiFi) direct, or infrared data association (IrDA)) or a second network 199 (eg, legacy It may communicate with the external electronic device 104 through a cellular network, a 5G network, a next-generation communication network, the Internet, or a telecommunications network such as a computer network (eg, a LAN or a WAN).
  • a telecommunications network such as a computer network (eg, a LAN or a WAN).
  • These various types of communication modules may be integrated as one component (eg, a single chip) or implemented as a plurality of separate components (eg, multiple chips).
  • the wireless communication module 192 uses subscriber information (eg, International Mobile Subscriber Identifier (IMSI)) stored in the subscriber identification module 196 within a communication network such as the first network 198 or the second network 199.
  • subscriber information eg, International Mobile Subscriber Identifier (IMSI)
  • IMSI International Mobile Subscriber Identifier
  • the electronic device 101 may be identified or authenticated.
  • the wireless communication module 192 may support a 5G network after a 4G network and a next-generation communication technology, for example, NR access technology (new radio access technology).
  • NR access technologies include high-speed transmission of high-capacity data (enhanced mobile broadband (eMBB)), minimization of terminal power and access of multiple terminals (massive machine type communications (mMTC)), or high reliability and low latency (ultra-reliable and low latency (URLLC)).
  • eMBB enhanced mobile broadband
  • mMTC massive machine type communications
  • URLLC ultra-reliable and low latency
  • -latency communications can be supported.
  • the wireless communication module 192 may support a high frequency band (eg, mmWave band) to achieve a high data rate, for example.
  • the wireless communication module 192 uses various technologies for securing performance in a high frequency band, such as beamforming, massive multiple-input and multiple-output (MIMO), and full-dimensional multiplexing. Technologies such as input/output (FD-MIMO: full dimensional MIMO), array antenna, analog beam-forming, or large scale antenna may be supported.
  • the wireless communication module 192 may support various requirements defined for the electronic device 101, an external electronic device (eg, the electronic device 104), or a network system (eg, the second network 199).
  • the wireless communication module 192 is a peak data rate for eMBB realization (eg, 20 Gbps or more), a loss coverage for mMTC realization (eg, 164 dB or less), or a U-plane latency for URLLC realization (eg, Example: downlink (DL) and uplink (UL) each of 0.5 ms or less, or round trip 1 ms or less) may be supported.
  • eMBB peak data rate for eMBB realization
  • a loss coverage for mMTC realization eg, 164 dB or less
  • U-plane latency for URLLC realization eg, Example: downlink (DL) and uplink (UL) each of 0.5 ms or less, or round trip 1 ms or less
  • the antenna module 197 may transmit or receive signals or power to the outside (eg, an external electronic device).
  • the antenna module 197 may include an antenna including a radiator formed of a conductor or a conductive pattern formed on a substrate (eg, PCB).
  • the antenna module 197 may include a plurality of antennas (eg, an array antenna). In this case, at least one antenna suitable for a communication method used in a communication network such as the first network 198 or the second network 199 is selected from the plurality of antennas by the communication module 190, for example. can be chosen A signal or power may be transmitted or received between the communication module 190 and an external electronic device through the selected at least one antenna.
  • other components eg, a radio frequency integrated circuit (RFIC) may be additionally formed as a part of the antenna module 197 in addition to the radiator.
  • RFIC radio frequency integrated circuit
  • the antenna module 197 may form a mmWave antenna module.
  • the mmWave antenna module includes a printed circuit board, an RFIC disposed on or adjacent to a first surface (eg, a lower surface) of the printed circuit board and capable of supporting a designated high frequency band (eg, mmWave band); and a plurality of antennas (eg, array antennas) disposed on or adjacent to a second surface (eg, a top surface or a side surface) of the printed circuit board and capable of transmitting or receiving signals of the designated high frequency band. can do.
  • peripheral devices eg, a bus, general purpose input and output (GPIO), serial peripheral interface (SPI), or mobile industry processor interface (MIPI)
  • signal e.g. commands or data
  • commands or data may be transmitted or received between the electronic device 101 and the external electronic device 104 through the server 108 connected to the second network 199 .
  • Each of the external electronic devices 102 or 104 may be the same as or different from the electronic device 101 .
  • all or part of operations executed in the electronic device 101 may be executed in one or more external electronic devices among the external electronic devices 102 , 104 , or 108 .
  • the electronic device 101 when the electronic device 101 needs to perform a certain function or service automatically or in response to a request from a user or another device, the electronic device 101 instead of executing the function or service by itself.
  • one or more external electronic devices may be requested to perform the function or at least part of the service.
  • One or more external electronic devices receiving the request may execute at least a part of the requested function or service or an additional function or service related to the request, and deliver the execution result to the electronic device 101 .
  • the electronic device 101 may provide the result as at least part of a response to the request as it is or additionally processed.
  • cloud computing distributed computing, mobile edge computing (MEC), or client-server computing technology may be used.
  • the electronic device 101 may provide an ultra-low latency service using, for example, distributed computing or mobile edge computing.
  • the external electronic device 104 may include an internet of things (IoT) device.
  • Server 108 may be an intelligent server using machine learning and/or neural networks. According to one embodiment, the external electronic device 104 or server 108 may be included in the second network 199 .
  • the electronic device 101 may be applied to intelligent services (eg, smart home, smart city, smart car, or health care) based on 5G communication technology and IoT-related technology.
  • Electronic devices may be devices of various types.
  • the electronic device may include, for example, a portable communication device (eg, a smart phone), a computer device, a portable multimedia device, a portable medical device, a camera, a wearable device, or a home appliance.
  • a portable communication device eg, a smart phone
  • a computer device e.g., a smart phone
  • a portable multimedia device e.g., a portable medical device
  • a camera e.g., a portable medical device
  • a camera e.g., a portable medical device
  • a camera e.g., a portable medical device
  • a camera e.g., a camera
  • a wearable device e.g., a smart bracelet
  • first, second, or first or secondary may simply be used to distinguish a given component from other corresponding components, and may be used to refer to a given component in another aspect (eg, importance or order) is not limited.
  • a (e.g., first) component is said to be “coupled” or “connected” to another (e.g., second) component, with or without the terms “functionally” or “communicatively.”
  • the certain component may be connected to the other component directly (eg by wire), wirelessly, or through a third component.
  • module used in various embodiments of this document may include a unit implemented in hardware, software, or firmware, and is interchangeable with terms such as, for example, logic, logical blocks, parts, or circuits.
  • a module may be an integrally constructed component or a minimal unit of components or a portion thereof that performs one or more functions.
  • the module may be implemented in the form of an application-specific integrated circuit (ASIC).
  • ASIC application-specific integrated circuit
  • a storage medium eg, internal memory 136 or external memory 138
  • a machine eg, electronic device 101
  • a processor eg, the processor 120
  • a device eg, the electronic device 101
  • the one or more instructions may include code generated by a compiler or code executable by an interpreter.
  • the device-readable storage medium may be provided in the form of a non-transitory storage medium.
  • the storage medium is a tangible device and does not contain a signal (e.g. electromagnetic wave), and this term refers to the case where data is stored semi-permanently in the storage medium. It does not discriminate when it is temporarily stored.
  • a signal e.g. electromagnetic wave
  • the method according to various embodiments disclosed in this document may be included and provided in a computer program product.
  • Computer program products may be traded between sellers and buyers as commodities.
  • a computer program product is distributed in the form of a device-readable storage medium (eg compact disc read only memory (CD-ROM)), or through an application store (eg Play Store) or on two user devices (eg. It can be distributed (eg downloaded or uploaded) online, directly between smart phones.
  • a device-readable storage medium eg compact disc read only memory (CD-ROM)
  • an application store eg Play Store
  • It can be distributed (eg downloaded or uploaded) online, directly between smart phones.
  • at least part of the computer program product may be temporarily stored or temporarily created in a device-readable storage medium such as a manufacturer's server, an application store server, or a relay server's memory.
  • each component (eg, module or program) of the above-described components may include a single object or a plurality of entities, and some of the plurality of entities may be separately disposed in other components. there is.
  • one or more components or operations among the aforementioned corresponding components may be omitted, or one or more other components or operations may be added.
  • a plurality of components eg modules or programs
  • the integrated component may perform one or more functions of each of the plurality of components identically or similarly to those performed by a corresponding component of the plurality of components prior to the integration. .
  • the actions performed by a module, program, or other component are executed sequentially, in parallel, iteratively, or heuristically, or one or more of the actions are executed in a different order, or omitted. or one or more other actions may be added.
  • FIG. 2 is a block diagram illustrating one or more processors included in the electronic device 101 according to an exemplary embodiment.
  • the electronic device 101 of FIG. 2 may correspond to the electronic device 101 of FIG. 1 .
  • an electronic device 101 may include at least one of a processor 120 , an NPU 210 , a GPU 220 , and a memory 130 .
  • Processor 120, NPU 210, GPU 220 and memory 130 may be electrically and/or operatively connected to each other by an electronic component such as a communication bus 230. can be (electronically and/or operably coupled with each other).
  • the type and/or number of hardware components included in the electronic device 101 are not limited to those shown in FIG. 2 .
  • the electronic device 101 includes the display module 160 and the communication module 190 of FIG. 1 . ) may be further included.
  • the processor 120 of the electronic device 101 may include a hardware component for processing data based on one or more instructions.
  • a hardware component for processing data may include, for example, an Arithmetic and Logic Unit (ALU), a Floating Point Unit (FPU), and/or a Field Programmable Gate Array (FPGA).
  • the processor 120 may be referred to as an AP (Application Processor).
  • the number of processors 120 may be one or more.
  • the processor 120 may have a structure of a multi-core processor such as a dual core, quad core, or hexa core.
  • the processor 120 of FIG. 2 may correspond to an example of the processor 120 and/or the main processor 121 of FIG. 1 .
  • the GPU 220 of the electronic device 101 may include one or more pipelines that perform a plurality of operations necessary for executing instructions related to computer graphics.
  • the pipeline of the GPU 220 includes a graphics pipeline or a rendering pipeline for generating a 3D image and generating a 2D raster image from the generated 3D image.
  • the graphics pipeline may be controlled based on code included in a file stored in the memory 130 and written in a shading language. For example, code written in a shading language may be compiled into instructions executable by the GPU 220 by the processor 120 .
  • the NPU 210 of the electronic device 101 may include a hardware component for supporting one or more functions based on a neural network.
  • a neural network is a cognitive model implemented in software or hardware that mimics the computational power of a biological system using a large number of artificial neurons (or nodes).
  • the electronic device 101 may execute functions similar to human cognitive actions or learning processes based on a neural network.
  • one or more functions based on the neural network supported by the NPU 210 include a function of training the neural network, image recognition, voice recognition, and/or handwriting recognition using the trained neural network. It may include a function to perform, a function based on a neural network personalized to the user of the electronic device 101, and a function to control a neural network based on an application using an application programming interface (API).
  • API application programming interface
  • Each of the processor 120, NPU 210, and GPU 220 of FIG. 2 is included as different integrated circuits in the electronic device 101, or a single integrated circuit based on a System on Chip (SoC). (single IC).
  • SoC System on Chip
  • the processor 120 , the NPU 210 , the GPU 220 , or a combination thereof may be included in a single integrated circuit included in the electronic device 101 .
  • the type of processing unit (processing unit) included based on the SoC is not limited to the above example, and for example, other hardware components (eg, communication processor) not shown in FIG. 2 include the processor 120 and the NPU 210 ) and the GPU 220 in a single integrated circuit.
  • the memory 130 of the electronic device 101 is a hardware component for storing data and/or instructions input and/or output to the processor 120, the NPU 210, and/or the GPU 220.
  • the memory 130 may include, for example, a volatile memory such as random-access memory (RAM) 132 and/or a non-volatile memory such as read-only memory (ROM) ( 134) may be included.
  • the volatile memory 132 may include, for example, at least one of Dynamic RAM (DRAM), Static RAM (SRAM), Cache RAM, and Pseudo SRAM (PSRAM).
  • DRAM Dynamic RAM
  • SRAM Static RAM
  • PSRAM Pseudo SRAM
  • the non-volatile memory 134 may include, for example, at least one of Programmable ROM (PROM), Erasable PROM (EPROM), Electrically Erasable PROM (EEPROM), flash memory, hard disk, compact disk, and embedded multi media card (eMMC).
  • PROM Programmable ROM
  • EPROM Erasable PROM
  • EEPROM Electrically Erasable PROM
  • flash memory hard disk, compact disk, and embedded multi media card
  • eMMC embedded multi media card
  • the memory 130 , the volatile memory 132 , and the nonvolatile memory 134 of FIG. 2 may correspond to the memory 130 , the volatile memory 132 , and the nonvolatile memory 134 of FIG. 1 , respectively.
  • a set of parameters representing a neural network to be processed by the NPU 210 may be stored in the memory 130 of the electronic device 101 according to an embodiment.
  • Parameters representing a neural network include, for example, a plurality of nodes included in the neural network, a weight assigned to a connection between the plurality of nodes, the number of layers of the neural network, a bias, and/or their product and/or combination.
  • a structure of a neural network represented by a set of parameters stored in the memory 130 of the electronic device 101 according to an embodiment will be described later with reference to FIG. 3 .
  • the NPU 210 may include a neural engine 240 , a buffer 250 and/or a controller 260 .
  • the neural engine 240, the buffer 250 and the controller 260 may be electrically and/or operatively connected to each other by electronic components such as a communication bus.
  • the neural engine 240 of the NPU 210 may include a circuit for performing an operation required to execute a function related to a neural network.
  • An exemplary structure of the neural engine 240 is described below with reference to FIGS. 4A-4B.
  • the number of neural engines 240 included in the NPU 210 may be one or more, such as the first neural engine 240-1 to the m-th neural engine 240-m of FIG. 2 . there is.
  • the buffer 250 of the NPU 210 is connected to the neural engine 240, and one or more numerical values (numeric) to be input to the neural engine 240 to perform calculations of the neural engine 240. values), or one or more numerical values output from the neural engine 240 may be stored at least temporarily.
  • one or more neural engines included in the neural engine 240 may share a buffer 250 of the neural engine 240 .
  • the controller 260 of the NPU 210 may control an operation based on the neural engine 240 included in the NPU 210 .
  • controller 260 in response to receiving a request from processor 120 to execute a function based on the neural network, may obtain one or more parameters representative of the neural network from memory 130. .
  • the controller 260 may input one or more acquired parameters to at least one of neural engines included in the NPU 210 .
  • the controller 260 may control execution of an operation based on parameters input to at least one of the neural engines. An operation of the controller 260 of the NPU 210 according to an embodiment will be described later with reference to FIG. 11 .
  • neural engine 240 may include circuitry to perform binary arithmetic operations between a plurality of numerical values.
  • the binary arithmetic operation may include an addition operation, a subtraction operation, a multiplication operation, and/or a division operation based on bits representing each of the plurality of numerical values.
  • the electronic device 101 may identify a specific numerical value from one or more bits based on a plurality of data types.
  • a data type is a category predetermined for interpretation of one or more bits by the electronic device 101 .
  • the electronic device 101 may interpret a set of one or more bits based on a data type corresponding to the set to identify data represented by the set. For example, when the electronic device 101 stores one or more bits representing a specific numerical value in the memory 130, the number of bits corresponding to the specific numerical value in the memory 130 is differentiated according to the data type. may be differentiated.
  • the neural engine 240 of the NPU 210 may support binary arithmetic operations for each of a plurality of data types. As the neural engine 240 supports binary arithmetic operations of a plurality of data types, the buffer 250 can be managed more efficiently. In the following, a plurality of data types may have different precisions. As the neural engine 240 of the NPU 210 according to an embodiment supports binary arithmetic operations of a plurality of data types, the neural engine 240 may support binary arithmetic operations of a plurality of precisions.
  • the NPU 210 supports the performance of binary arithmetic operations.
  • the buffer 250 of 210 and the memory 130 of the electronic device 101 can be managed more efficiently.
  • the size of data exchanged between the NPU 210 and the memory 130 may be differentiated according to a plurality of data types supported by the neural engine 240 . As the size of the data is differentiated, the bandwidth of the memory 130 can be managed more efficiently.
  • the electronic device of FIG. 3 may correspond to an example of the electronic device 101 of FIGS. 1 and/or 2 .
  • the neural network 300 of FIG. 3 may be obtained from, for example, a set of parameters stored in a memory (eg, the memory 130 of FIGS. 1 and/or 2) by an electronic device according to an embodiment. .
  • the neural network 300 may include a plurality of layers.
  • the neural network 300 may include an input layer 310 , one or more hidden layers 320 and an output layer 330 .
  • the input layer 310 may correspond to vectors and/or matrices representing input data of the neural network 300 .
  • a vector representing input data may have elements corresponding to the number of nodes included in the input layer 310 .
  • elements included in a matrix representing input data may correspond to each of nodes included in the input layer 310 .
  • Signals generated by each of the nodes in the input layer 310 , generated by the input data may be transmitted from the input layer 310 to the hidden layers 320 .
  • the output layer 330 may generate output data of the neural network 300 based on one or more signals received from the hidden layers 320 .
  • the output data may correspond to, for example, a vector and/or a matrix having elements corresponding to the number of nodes included in the output layer 330 .
  • first nodes included in a specific layer among a plurality of layers included in the neural network 300 are at least one of second nodes of a layer previous to the specific layer within a sequence of the plurality of layers. It can correspond to the weighted sum of
  • the electronic device 101 may identify a weight to be applied to at least one of the second nodes from a set of parameters stored in a memory. Training the neural network 300 may include an operation of changing and/or determining one or more weights related to the weighted sum.
  • one or more hidden layers 320 may be positioned between the input layer 310 and the output layer 330, and input data transmitted through the input layer 310 may be converted to an easily predictable value.
  • the input layer 310, one or more hidden layers 320, and the output layer 330 may include a plurality of nodes.
  • One or more hidden layers 320 may be convolution filters or fully connected layers in a convolutional neural network (CNN), or various types of filters or layers grouped based on special functions or characteristics.
  • CNN convolutional neural network
  • one or more hidden layers 320 may be a layer based on a recurrent neural network (RNN) whose output values are input back to the hidden layer at the current time.
  • RNN recurrent neural network
  • the neural network 300 may include a plurality of hidden layers 320 to form a deep neural network. Training a deep neural network is called deep learning. Among the nodes of the neural network 300, nodes included in the hidden layers 320 are referred to as hidden nodes.
  • Nodes included in the input layer 310 and one or more hidden layers 320 may be connected to each other through a connection line having a connection weight, and nodes included in the hidden layer and the output layer may also be connected to each other through a connection line having a connection weight.
  • Tuning and/or training the neural network 300 is performed on each of the layers (eg, the input layer 310, one or more hidden layers 320, and the output layer 330) included in the neural network 300. It may mean changing the connection weight between included nodes. Tuning of the neural network 300 may be performed based on, for example, supervised learning and/or unsupervised learning.
  • An electronic device may tune the neural network 300 based on reinforcement learning in unsupervised learning. For example, the electronic device may change policy information used by the neural network 300 to control the agent based on an interaction between the agent and the environment. For example, an agent takes an action in an environment, and the agent can be trained from that action by a reward based on the action and created using a reward function. The electronic device according to an embodiment may cause the policy information to be changed by the neural network 300 in order to maximize the agent's goal and/or reward through the interaction.
  • the electronic device in a state in which the neural network 300 is obtained using the NPU 210 of FIG. 2 , the electronic device according to an embodiment includes an input layer 310 stored in a memory and one or more hidden layers 320 And/or a weight corresponding to a connection line connecting the output layers 330 may be identified.
  • the electronic device includes a plurality of layers (eg, the input layer 310, the one or more hidden layers ( 320) and the output layer 330), a weighted sum based on the connection line may be obtained sequentially.
  • the obtained weighted sum may be stored in the buffer 250 and/or the memory 130 of FIG. 2 .
  • the electronic device may repeatedly update the weighted sum stored in the memory as the weighted sum is sequentially acquired along the plurality of layers.
  • Each of the plurality of layers of the neural network 300 may have an independent data type and/or precision. For example, when connection lines between a first layer and a second layer among a plurality of layers have weights based on a first data type for representing a floating point number, the electronic device Weighted sums based on the first data type may be obtained from numerical values corresponding to nodes of a layer and the weights. In the above example, when connection lines between the second layer and the third layer among the plurality of layers have weights based on the second data type for representing an integer number, the electronic device performs the obtained weighted sums and Weighted sums based on the second data type may be obtained from weights based on the second data type.
  • the electronic device corresponds to each of the plurality of layers based on different data types, for example, using the NPU 210 of FIG. 2 .
  • weighted sums can be obtained.
  • the electronic device accesses the memory based on weighted sums obtained based on different data types, the bandwidth of the memory can be used more efficiently.
  • the electronic device according to an embodiment may more quickly obtain output data from the neural network 300 based on the plurality of layers.
  • An electronic device may store sets of parameters representing each of a plurality of neural networks having different accuracies.
  • a neural network related to super resolution for upscaling images and/or video is a data type (e.g. IEEE 754) for representing floating point numbers based on 16 bits.
  • a neural network for recognizing a subject included in an image and/or video may require precision of a data type to represent an integer based on 8 bits and/or 4 bits.
  • a neural network for performing handwriting recognition may use the precision of a data type to represent an integer based on the first bit and/or the second bits.
  • An electronic device may perform an operation to obtain a weighted sum based on different accuracies corresponding to each of a plurality of neural networks.
  • FIGS. 4A to 4B are exemplary block diagrams for explaining the structure of a circuit for the electronic device 101 to perform an operation related to a neural network, according to an embodiment.
  • the electronic device 101 of FIGS. 4A to 4B may correspond to an example of the electronic device 101 of FIGS. 1 to 2 and/or the electronic device of FIG. 3 .
  • the neural engine 240 of FIGS. 4A and 4B may correspond to the neural engine 240 of FIG. 2 .
  • the neural engine 240 of the electronic device 101 may include an arithmetic circuit 410, a controller 420, and/or an accumulator circuit 430. .
  • the number of calculation circuits 410 and/or accumulation circuits 430 included in the neural engine 240 may be one or more.
  • FIGS. 4A and 4B an example in which the neural engine 240 includes n arithmetic circuits (a first arithmetic circuit 410 - 1 to an n th arithmetic circuit 410 - n) is shown.
  • the neural engine 240 of the electronic device 101 generates one or more data sets corresponding to the neural engine 240 along channels corresponding to the number of calculation circuits included in the neural engine 240.
  • a data set received by the neural engine 240 may include elements corresponding to the number of channels. The elements may correspond to numerical values represented based on one of a plurality of data types supported by the neural engine 240 .
  • a data set received by the neural engine 240 may include, for example, numerical values assigned to nodes of a specific layer among a plurality of layers of the neural network 300 of FIG. 3 .
  • another data set received by the neural engine 240 may include weights assigned to respective connection lines corresponding to nodes of the specific layer among the plurality of layers.
  • the accumulator circuit 430 of the neural engine 240 of the electronic device 101 accumulates numerical values corresponding to a result of performing an operation from one or more arithmetic circuits included in the neural engine 240. and can be saved.
  • the number of channels used by the arithmetic circuit 410 to output a result of performing a binary arithmetic operation may be differentiated according to embodiments.
  • the number of accumulation circuits included in the neural engine 240 may correspond to the number of channels used by the calculation circuit 410 included in the neural engine 240 to output the result. Referring to FIG.
  • the neural engine 240 in an embodiment in which the arithmetic circuit 410 outputs a result using at least one of two channels, the neural engine 240 includes two accumulator circuits (eg, a first accumulator circuit 430). -1) and the second accumulation circuit 430-2).
  • the neural engine 240 includes four accumulator circuits (eg, the first accumulator circuit 430). -1) to the fourth accumulator circuit 430-4).
  • the controller 420 of the neural engine 240 of the electronic device 101 converts numerical values included in each of one or more data sets received by the neural engine 240 to the neural engine 240. It can be input to each of the first arithmetic circuit 410-1 to the n-th arithmetic circuit 410-n.
  • the controller 420 may control the arithmetic circuit 410 differently according to the data types of the one or more data sets. For example, the controller 420 may adjust a signal path within the computational circuit 410 based on the data type of one or more data sets received by the neural engine 240 . Examples in which the controller 420 adjusts a signal path in the operation circuit 410 based on a data type according to an embodiment will be described later with reference to FIGS. 6A to 6C and/or 9A to 9D.
  • the controller 420 of the neural engine 240 of the electronic device 101 includes numerical values to be input to the calculation circuit 410, numerical values accumulated in the accumulator circuit 430, and the neural engine 240 ) can be selected from among the numerical values contained in the received data sets. For example, in a state in which an operation corresponding to a specific layer of a neural network (eg, one hidden layer among one or more hidden layers 320 of FIG. 3 ) is performed, a weight corresponding to nodes included in a specific layer To calculate the sum, the controller 420 may accumulate and store numerical values output from different channels of the calculation circuit 410 in the accumulation circuit 430 .
  • a neural engine 240 including an arithmetic circuit 410 with two channels for outputting numerical values.
  • the neural engine 240 performs single processing.
  • the 64 numerical values are numerical values obtained by applying each of 64 weights related to a specific layer of the neural network to each of the 64 numerical values input to the specific layer.
  • each of the numerical values obtained by the neural engine 240 may be stored in a specific accumulator circuit corresponding to each of the numerical values among accumulator circuits of the neural engine 240 .
  • a plurality of arithmetic circuits eg, a first arithmetic circuit 410-1, a second arithmetic circuit 410-2, ..., n-th arithmetic circuits 410-n
  • Numerical values output from the first channel O1 may be stored in the first accumulation circuit 430-1 corresponding to the first channel O1.
  • numerical values output from the second channel O2 of the plurality of arithmetic circuits may be stored in the second accumulator circuit 430 - 2 corresponding to the second channel O2 .
  • arithmetic circuits such as the first arithmetic circuit 410-1 to the n-th arithmetic circuit 410-n of the electronic device 101 according to an embodiment perform binary arithmetic operations based on different data types. operations can be supported. For example, a state of performing binary arithmetic operations related to a data type for representing an integer based on a specified number of bits (eg, a data type for representing an integer using 8 bits and/or 4 bits) , calculation circuits of the electronic device 101 may output numerical values corresponding to the performed binary arithmetic operation using both the first channel O1 and the second channel O2 .
  • the calculation circuits of the electronic device 101 use the first channel O1 of the first channel O1 and the second channel O2 to obtain a numerical value corresponding to the binary arithmetic operation performed. can output
  • the controller 420 of the electronic device 101 adjusts a signal path included in the arithmetic circuit 410 so that one through the first channel O1 and/or the second channel O2. An operation of outputting the above numerical values will be described later with reference to FIGS. 6A to 6C.
  • a neural engine 240 including an arithmetic circuit 410 of four channels for outputting numerical values.
  • the neural engine 240 performs single processing.
  • each of the 128 numerical values may correspond to a numerical value obtained by applying different weights based on a kernel to a numerical value assigned to a node of a CNN related to convolution.
  • the kernel may be referred to as a filter in the following.
  • the first accumulator circuit 430-1 includes a plurality of arithmetic circuits (eg, the first arithmetic circuit 410-1, the second arithmetic circuit 410-2, ..., the th Numerical values output from the first channel O1 of the n arithmetic circuits 410-n may be stored.
  • each of the second accumulator circuit 430-2, the third accumulator circuit 430-3, and the fourth accumulator circuit 430-4 includes the second channel O2 and the third channel of the plurality of arithmetic circuits. Numerical values output from each of (O3) and the fourth channel (O4) may be stored.
  • the number of channels activated by the arithmetic circuit 410 of the electronic device 101 according to an embodiment among the first to fourth channels O1 to O4 is data of numerical values input to the arithmetic circuit 410. It may be adjusted according to the type and/or according to the signal path in the arithmetic circuit 410 controlled by the controller 420.
  • the arithmetic circuit 410 of the neural engine 240 may use a first data type to represent a floating-point number along 16 bits and/or a second data type to represent an integer along 8 bits.
  • the operation circuit 410 uses the first channel O1 among the first to fourth channels O1 to accumulate within a single processing cycle.
  • a numerical value corresponding to the result of the multiplication operation may be transmitted to a circuit (eg, the first accumulator circuit 430 - 1 corresponding to the first channel O1 ).
  • numerical values transmitted along the first channel O1 from calculation circuits included in the neural engine 240 may be accumulated.
  • the neural engine 240 transmits numerical values accumulated in the accumulator circuit based on the first data type and/or the second data type within the single processing cycle through one channel corresponding to the accumulator circuit. can be printed out.
  • the arithmetic circuit 410 of the neural engine 240 performs a multiplication operation based on the third data type for representing an integer along 4 bits
  • the arithmetic circuit 410 In a single processing cycle, using the first channel O1 and the second channel O2 among the first channel O1 to the fourth channel O4, two accumulation circuits (eg, the first channel O1 ) and the first accumulator circuit 430 - 1 and the second accumulator circuit 430 - 2 corresponding to the second channel O2 , respectively, it is possible to store two numerical values corresponding to the result of the multiplication operation.
  • each of the two accumulation circuits numerical values transmitted along each of the first channel O1 and the second channel O2 from the calculation circuits included in the neural engine 240 may be accumulated.
  • the neural engine 240 may output numerical values based on the third data type through two channels corresponding to the two accumulator circuits, respectively, within the single processing cycle.
  • the arithmetic circuit 410 of the neural engine 240 performs a multiplication operation based on the fourth data type for representing an integer along 2 bits
  • the arithmetic circuit 410 In a single processing cycle, using all of the first channel O1 to the fourth channels O4, four accumulator circuits (eg, the first accumulator circuit 430-1 to the fourth accumulator circuit 430-1) 4)), it is possible to store four numerical values corresponding to the result of the multiplication operation.
  • numerical values transmitted along each of the first channel O1 to the fourth channels O4 from the calculation circuits included in the neural engine 240 may be accumulated.
  • the neural engine 240 may output numerical values based on the fourth data type through four channels corresponding to each of the four accumulator circuits within the single processing cycle.
  • a signal path in the arithmetic circuit 410 adjusted by the controller 420 of the neural engine 240 in the embodiment of FIG. 4B will be described later with reference to FIGS. 9A to 9D.
  • the neural engine 240 may output numerical values based on the fourth data type through four channels corresponding to each of the four accumulator circuits.
  • the neural engine 240 of the electronic device 101 may include one or more arithmetic circuits that support binary arithmetic operations based on a plurality of data types.
  • the one or more arithmetic circuits may output one or more numerical values using one or more channels activated according to data types.
  • the neural engine 240 may accumulate one or more numerical values output through one or more channels of the one or more arithmetic circuits using one or more accumulation circuits.
  • One or more accumulated numerical values may represent a weighted sum corresponding to each node included in a specific layer of the neural network.
  • FIG. 5 is a block diagram illustrating an example of an arithmetic circuit 410 of the electronic device 101 according to an exemplary embodiment.
  • the electronic device 101 of FIG. 5 may correspond to the electronic device 101 of FIGS. 1 to 2 and 4A to 4B and/or the electronic device of FIG. 3 .
  • the calculation circuit 410 of FIG. 5 may correspond to an example of the calculation circuit 410 of FIG. 4A.
  • an operation circuit 410 may include a combiner 510, a multiplier 520, a converter 530, an adder 580, or a combination thereof.
  • the operation circuit 410 may perform a multiplication operation based on a multiplier and one or more multiplicands. For example, weights assigned to each of the connection lines connecting the plurality of layers in FIG. 3 correspond to an example of the one or more multipliers, and are assigned to each of the nodes included in the plurality of layers in FIG. 3 Numerical values correspond to examples of the one or more multiplicands.
  • the arithmetic circuit 410 includes ports 510-1 and 510-2 for receiving bits representing one or more multiplicands and a port 510 for outputting bits obtained by combining the one or more multiplicands.
  • -3) may include a coupler 510 including.
  • the arithmetic circuit 410 includes a port 520-1 for receiving at least some of the bits representing the multiplier, a port 520-2 connected to the port 510-3 of the combiner 510, and ports ( It may include a multiplier 520 including a port 520-3 for outputting bits corresponding to a result of performing a binary multiplication operation corresponding to bits received from 520-1 and 520-2.
  • the arithmetic circuit 410 includes a port 580-1 for receiving some of the bits representing the multiplicand, a port 580-2 for receiving bits representing the multiplier, and ports 580-1, 580- 2) may include an adder 580 including a port 580-3 for outputting bits representing a result of performing a binary addition operation corresponding to the received bits.
  • ports 510-1, 510-2, 520-1, 580-1, and 580-2 of arithmetic circuit 410 are ports through which arithmetic circuit 410 receives one or more numerical values. can respond to
  • an operation circuit 410 is connected to a port 520-3 of a multiplier 520 and a port 580-3 of an adder 580, so that the ports 520-3 , 580-3), a converter 530 outputting bits representing one or more numerical values to at least one of the first channel O1 or the second channel O2.
  • the converter 530 may use a port (( By converting bits output from 520-3), one or more numerical values to be output through at least one of the first channel O1 and the second channel O2 may be obtained.
  • the converter 530 includes a port 540-1 for receiving bits output from a port 520-3 of a multiplier 520, and bits received through the port 540-1. may include a bit selector 540 including a port 540-2 for outputting bits corresponding to some of the bits.
  • the converter 530 includes a port 550-1 for receiving bits output from the port 520-3 of the multiplier 520, and an arithmetic circuit based on the bits received through the port 550-1.
  • a bit handler 550 including a port 550-2 for outputting one or more bits to the second channel O2 of 410.
  • the converter 530 includes a port 560-1 connected to the port 540-2 of the bit selector 540, a port 560-2 connected to the port 520-3 of the multiplier 520, and an operation circuit 410.
  • a port 560-3 for receiving a signal SEL from a controller (eg, the controller 420 of FIGS. 4A to 4B) corresponding to ), and based on the signal received by the port 560-3.
  • a switch 560 including a port 560-4 for outputting bits of any one of the ports 560-1 and 560-2 may be included.
  • the converter 530 includes a port 570-1 for receiving bits output from the port 560-4 of the switch 560 and a port 570-1 for receiving bits output from the port 580-3 of the adder 580.
  • a port 570-2 and a port 570-3 for outputting bits representing the result of shifting the bits of the port 570-1 based on the bits received through the port 570-2.
  • a shift register 570 including The first channel O1 of the arithmetic circuit 410 may correspond to the port 570 - 3 of the shift register 570 .
  • each of the ports 570 - 3 and 550 - 2 of the calculation circuit 410 may correspond to ports through which the calculation circuit 410 outputs numerical values.
  • output from port 520-3 of multiplier 520 as converter 530 is controlled by the controller of arithmetic circuit 410 (e.g., controller 420 of FIGS. 4A-4B). Bits may be processed based on data types corresponding to numerical values input to the arithmetic circuit 410 . For example, a signal path within converter 530 may be changed according to the data type.
  • the controller corresponding to the calculation circuit 410 changes bits input to the ports 510-1, 510-2, 520-1, 580-1, and 580-2 of the calculation circuit 410 according to the data type.
  • a controller corresponding to the operation circuit 410 may selectively activate the combiner 510 and/or the adder 580 according to the data type.
  • calculation circuit 410 in the calculation circuit 410 according to an exemplary embodiment, signal paths adjusted according to data types of numerical values received by the calculation circuit 410 will be described with reference to FIGS. 6A to 6C .
  • FIGS. 6A to 6C are diagrams for explaining different states 610, 620, and 630 of the arithmetic circuit 410 of FIG.
  • the electronic device 101 of FIGS. 6A to 6C may correspond to the electronic device 101 of FIGS. 1 to 2 , 4A to 4B and 5 and/or the electronic device of FIG. 3 .
  • the arithmetic circuit 410 of FIGS. 6A to 6C may correspond to an example of the arithmetic circuit 410 of FIG. 4A and/or the arithmetic circuit 410 of FIG. 5 .
  • FIG. 6A is an exemplary diagram for explaining an operation of an operation circuit 410 in a state 610 of performing a multiplication operation based on a first data type for representing a floating point number.
  • the first data type may correspond to, for example, a data type for representing a floating point number along 16 bits.
  • the first data type may correspond to a data type (FP16) of a half-precision floating point format of IEEE 754.
  • MSB most significant bit
  • 5 bits adjacent to the most significant bit represent an exponent of the floating point number.
  • the remaining 10 bits including the least significant bit (LSB) represent the mantissa of the floating point number.
  • the bits correspond to Wa_s, Wa_M, and Wa_e of Equation 1. may contain bits.
  • Wa_s is a numerical value representing the sign of Wa
  • Wa_M is a numerical value representing the normalized mantissa of Wa
  • Wa_e is a numerical value representing the biased exponent of Wa.
  • Bits corresponding to the numerical value Wa may sequentially include, from the MSB, 1 bit representing Wa_s, 5 bits representing Wa_e, and 10 bits representing Wa_M.
  • the electronic device 101 uses the arithmetic circuit 410 to obtain numerical values Wa and numerical values.
  • the operation of performing a multiplication operation of the value Ia is described.
  • the numerical value Wa may be one of the elements of a matrix representing a kernel in a CNN and/or a weight assigned to a connection line in FIG. 3 .
  • the numerical value Ia may be one of the elements of another matrix to be applied to a numerical value assigned to a node in FIG. 3 and/or a matrix representing a kernel in a CNN.
  • the numerical value Ia_s represents a sign corresponding to the numerical value Ia in the first data type
  • the numerical value Ia_e represents an index corresponding to the numerical value Ia in the first data type
  • the numerical value Ia_M represents the first data type. It is assumed to represent the mantissa corresponding to the numeric value Ia in the type.
  • mantissas Wa_M and Ia_M of respective numerical values Wa and Ia may be input to ports 520 - 1 and 520 - 2 of the multiplier 520 .
  • the mantissa Wa_M input to the port 510-1 of the combiner 510 bypasses the combiner 510 and , may be transmitted to the port 520-2 of the multiplier 520.
  • Deactivation of the combiner 510 may be controlled by the arithmetic circuit 410 and/or a controller connected to the arithmetic circuit 410 (eg, the controller 420 of FIGS. 4A-4B ).
  • the multiplier 520 may perform a multiplication operation on numerical values respectively indicated by 13 bits and 12 bits (respectively indicated by). For example, via port 520-1, multiplier 520 may receive a numerical value represented along 13 bits. Via port 520-2, multiplier 520 may receive a numerical value represented along 12 bits. When Ia_M and Wa_M indicated based on 10 bits are received through each of the ports 520-1 and 520-2, the multiplier 520 uses sign extension to transmit 13 bits. It is possible to obtain Ia_M represented by and Wa_M represented by 12 bits. The sign extension may be performed, for example, based on each of Wa_s and Ia_s indicating the sign of each of the numerical values Wa and Ia.
  • multiplier 520 may perform multiplication operations on Ia_M and Wa_M represented by 13 bits and 12 bits, respectively.
  • the multiplier 520 may output, for example, a product of Ia_M and Wa_M represented by 24 bits through the port 520-3.
  • exponents Wa_e and Ia_e of respective numerical values Wa and Ia may be input to ports 580 - 1 and 580 - 2 of the adder 580 .
  • Adder 580 may be activated in state 610 by arithmetic circuit 410 and/or a controller coupled to arithmetic circuit 410 .
  • the adder 580 may perform an addition operation on Wa_e and Ia_e represented by 5 bits and output the sum of Wa_e and Ia_e through the port 580-3.
  • the bit selector 540 and the bit adjuster 550 included in the converter 530 may be deactivated.
  • the switch 560 of the converter 530 selects the port 560-2 corresponding to the port 520-3 of the multiplier 520 among the ports 560-1 and 560-2, Based on a signal received through the port 560-3, a connection may be made to the port 560-4.
  • the connection between the ports 560-2 and 560-4 in the switch 560 is a signal input through the port 560-3 and provided, for example, from a controller corresponding to the arithmetic circuit 410. (SEL).
  • bits output from the port 520-3 of the multiplier 520 may be output through the port 560-4 of the switch 560.
  • the shift register 570 may receive the product of Ia_M and Wa_M output from the multiplier 520 through the port 570-1.
  • the shift register 570 calculates the product of Ia_M and Wa_M based on the received sum of Wa_e and Ia_e. can shift Shifting the product of Ia_M and Wa_M based on the sum of Wa_e and Ia_e may correspond to the operation of normalizing the mantissa of a floating point number.
  • the arithmetic circuit 410 may output the bits stored in the shift register 570 through the first channel O1.
  • the arithmetic circuit 410 concatenates shifted bits representing the product of Ia_M and Wa_M, bits representing the sum of Wa_e and Ia_e, and a bit representing the sign of the product of Ia_M and Wa_M, and the first data type Bits representing the product of Wa and Ia may be output according to the number of bits (eg, 32 bits) of 16 bits or more of . Bits output through the first channel O1 and representing the product of Wa and Ia may be stored, for example, in the first accumulator circuit 430-1 of FIG. 4A.
  • FIG. 6B is an exemplary diagram for explaining an operation of the operation circuit 410 in a state 620 of performing a multiplication operation based on a second data type representing an integer.
  • the second data type may correspond to, for example, a data type (INT8) for representing a fixed point number or an integer along 8 bits.
  • INT8 data type
  • MSB represents the sign of the integer
  • the remaining 7 bits represent the absolute value of the integer.
  • the electronic device 101 uses the arithmetic circuit 410 to obtain the numerical value Wb and the numerical value
  • the operation of performing the multiplication operation of Ib is described.
  • the numerical value Wb may be one of the elements of a matrix representing a weight assigned to a connection line in FIG. 3 and/or a kernel in a CNN.
  • the numerical value Ib may be one of the elements of another matrix to be applied to a numerical value assigned to a node in FIG. 3 and/or a matrix representing a kernel in a CNN.
  • numerical values Wb and Ib may be input to ports 520 - 1 and 520 - 2 of the multiplier 520 . Similar to the state 610 of FIG. 6A, as the combiner 510 of the arithmetic circuit 410 is inactivated, the numerical value Wb input to the port 510-1 of the combiner 510 changes the combiner 510. Bypassed, it can be transmitted to port 520-2 of multiplier 520.
  • the multiplier 520 may obtain Ib represented by 13 bits and Wb represented by 12 bits by using sign extension.
  • the sign extension may be performed, for example, based on a bit representing the sign of each of the numerical values Wb and Ib (eg, the MSB of bits representing the numerical values Wb and Ib).
  • the multiplier 520 may output, for example, the product of Wb and Ib represented by 24 bits through the port 520-3.
  • the adder 580 is disabled, or bits representing a designated numerical value (eg, 0) are sent to the ports 580-1 and 580-2 of the adder 580. can be entered. Deactivation of adder 580 may be performed, for example, by arithmetic circuit 410 and/or a controller coupled to arithmetic circuit 410 that has identified a request to perform a multiplication operation based on the second data type. . With adder 580 inactive, the bits that adder 580 sends to port 570-2 of shift register 570 are a specified number that at least temporarily halts the shifting of bits by shift register 570. Can represent a value (eg 0).
  • bit selector 540 and bit adjuster 550 included in converter 530 may be deactivated.
  • switch 560 of converter 530 directs port 560-2 corresponding to port 520-3 of multiplier 520 to a signal received through port 560-3. Based on (SEL), it can connect to port 560-4.
  • bits output from the port 520-3 of the multiplier 520 and representing the product of Wb and Ib are output to the port 570-1 of the shift register 570 through the port 560-4.
  • bits input to the port 570-1 of the shift register 570 may be output independently of the shift.
  • bits representing the product of Wb and Ib (eg, the number of bits of 8 bits or more of the second data type) ) can be output.
  • Bits output through the first channel O1 and representing the product of Wb and Ib may be stored in, for example, the first accumulator circuit 430-1 of FIG. 4A.
  • the sixthC is for explaining an operation of the operation circuit 410 in a state 630 of performing a multiplication operation based on a third data data type, which is distinguished from the second data type of FIG. 6B and represents an integer. It is an exemplary drawing.
  • the third data type may correspond to, for example, a data type INT4 for representing a fixed-point number or an integer along 4 bits. In this case, among 4 bits, MSB represents the sign of the integer, and the remaining 3 bits represent the absolute value of the integer.
  • the electronic device 101 uses the operation circuit 410 to obtain a numerical value Wc0 and a numerical value.
  • the operation of performing a multiplication operation of Wc1 and the numerical value Ic is described.
  • the numerical value Wc0 and the numerical value Wc1 may be one of the elements of a matrix representing a weight assigned to the connection line in FIG. 3 and/or a kernel in a CNN.
  • the numerical value Ic may be a numerical value assigned to a node in FIG. 3 and/or one of elements of another matrix to be applied to a matrix representing a kernel in a CNN.
  • the multiplication operation based on the third data type is independent of the states 610 and 620 in which the first channel O1 among the first channel O1 and the second channel O2 is used, the first channel O1 ) and the activation of all of the second channels O2.
  • the electronic device 101 according to an embodiment generates two numerical values (eg, Wc0 ⁇ Ic and Wc1 ⁇ Ic) may be output through the first channel O1 and the second channel O2.
  • numerical values Wc0 and Wc1 may be input to ports 510 - 1 and 510 - 2 of the combiner 510 .
  • the arithmetic circuit 410 of the electronic device 101 and/or the controller corresponding to the arithmetic circuit 410 activates the combiner 510. can do.
  • the combiner 510 according to an embodiment may combine bits received through each of the ports 510-1 and 510-2 and corresponding to the numerical values Wc0 and Wc1, respectively.
  • the port of the combiner 510 ( Among the bits output from 510-3), 4 bits including the LSB and 3 bits contiguous with the LSB are received through the port 510-1 and correspond to 4 bits representing the numerical value Wc0.
  • 4 bits including the MSB and 3 bits contiguous with the MSB are received through the port 510-2, It may correspond to 4 bits representing the numerical value Wc1.
  • multiplier 520 receives bits representing the numerical value Ic received via port 520-1 and received via port 520-2, combiner 510 A multiplication operation of bits output from the port 510-3 of ) can be performed. Bits received by multiplier 520 through port 520 - 2 may correspond to bits in which numeric values Wc0 and Wc1 are combined by combiner 510 . The multiplier 520 may output a result of performing a multiplication operation through a port 520-3.
  • bit selector 540 and the bit adjuster 550 included in the converter 530 may be activated.
  • Bit selector 540 and bit adjuster 550 can be activated, for example, in response to arithmetic circuit 410 receiving numeric values Wc0, Wc1 and Ic based on a third data type.
  • the bit selector 540 may receive bits output from the port 520-3 through the port 540-1.
  • bit selector 540 may extract a portion of the received bits (eg, 8 bits including the LSB and the 7 bits contiguous with the LSB).
  • the bit selector 540 may output the extracted bits through a port 540-2.
  • the switch 560 converts bits received from the port 560-1 among the ports 560-1 and 560-2 based on the signal SEL received through the port 560-3 to the port ( 560-4). Since the port 560-1 of the switch 560 corresponds to the port 540-2 of the bit selector 540, the switch 560 transmits the bits output from the bit selector 540 to the port 560-4. can be output through For example, the signal SEL input to the port 560-3 of the switch 560 is provided from a controller that inputs numerical values Wc0, Wc1, and Ic based on the third data type to the arithmetic circuit 410. It can be.
  • adder 580 may be deactivated.
  • the shift register 570 may output bits received from the port 570-1 through the port 570-3.
  • deactivation of adder 580 may cause shift operations in shift register 570 to at least temporarily cease.
  • the port 570-3 corresponds to the first channel O1 of the arithmetic circuit 410 and the bits output from the port 540-2 are not controlled by the switch 560 and the shift register 570
  • the operation circuit 410 may output bits output from the port 540 - 2 of the bit selector 540 through the first channel O1 . Bits output through the first channel O1 may correspond to a product of numerical values Wc0 and Ic.
  • the bit adjuster 550 of the arithmetic circuit 410 in response to receiving bits output from the port 520-3 through the port 550-1, at least one of the received bits (eg, a bit corresponding to a specified number of digits) may adjust one or more other bits.
  • the bit adjuster 550 may output the adjusted one or more other bits to the second channel O2 of the arithmetic circuit 410 through the port 550-2.
  • the adjusted one or more other bits may correspond to a product of numerical values Wc1, Ic.
  • Numerical values output from each of the first channel O1 and the second channel O2 may be stored in the first accumulator circuit 430-1 and the second accumulator circuit 430-2 of FIG. 4A, respectively.
  • the number of bits of each of the numerical values stored in each of the first accumulator circuit 430-1 and the second accumulator circuit 430-2 is 4 bits or more (eg, 8 bits) of the third data type. can be
  • a plurality of multiplicands (eg, numerical values Wc0 and Wc1) are multiplied. (eg, numerical value Ic) by performing a multiplication operation, and outputting the result of multiplying each of a plurality of multiplicands by the multiplier through different channels (eg, the first channel O1 and the second channel O2) can do.
  • the operation circuit 410 may output a result of performing a multiplication operation between a single multiplicand and a single multiplier through a single channel (eg, the first channel O1).
  • the calculation circuit 410 performs a multiplication operation between a plurality of multiplicands (eg, numerical values Wc0 and Wc1) and multipliers (eg, numerical values Ic). An example of the operation is described.
  • FIG. 7 is a diagram for explaining an operation of performing a multiplication operation of integers using a multiplier related to a mantissa of a floating point number in the calculation circuit of FIG. 5 .
  • the electronic device of FIG. 7 may correspond to the electronic device 101 of FIGS. 1 to 2 , 4A to 4B , 5 and 6A to 6C , and/or the electronic device of FIG. 3 .
  • a multiplication operation based on a designated data type (eg, the third data type of FIG. 6C) to represent an integer along 4 bits is performed.
  • the operation of the electronic device of is described.
  • the NPU eg, the NPU 210 of FIG. 2
  • the NPU may perform a plurality of multiplication operations based on the CNN. there is.
  • the NPU when performing a convolution operation of 1 ⁇ 1, receives a plurality of numerical values based on a first matrix of 2 ⁇ 2 ⁇ 1 and a plurality of values based on a second matrix of 1 ⁇ 1 ⁇ 1 ⁇ 2 A plurality of numerical values based on a third matrix of 2 ⁇ 2 ⁇ 2 may be obtained by performing a convolution operation between numerical values of .
  • the first matrix may correspond to a matrix representing input data
  • the second matrix may correspond to a matrix representing weights.
  • the NPU according to an embodiment includes a plurality of calculation circuits (eg, FIGS. 4 to 5 and 5) included in a plurality of neural engines (eg, the neural engine 240 of FIG.
  • Each of the calculation circuits 410 of FIGS. 6A to 6C may be controlled to perform a multiplication operation based on a combination of numerical values included in the first matrix and numerical values included in the second matrix.
  • the NPU when each of the first matrix and the second matrix corresponds to a designated data type for representing an integer along 4 bits, the NPU according to an embodiment provides a numerical value included in the first matrix from a single arithmetic circuit. Numerical values (W0 x I0, W1 x I0) obtained by applying each of the weights W0 and W1 included in the second matrix to I0 may be simultaneously obtained.
  • an operation of performing a multiplication operation based on the numerical value I0 and the weights W0 and W1 by the calculation circuit of the NPU according to an embodiment will be described.
  • the combiner of the arithmetic circuit (e.g., the combiner 510 of FIGS. 5 and 6A to 6C) transfers bits representing each of the weights W0 and W1 to different ports (e.g., FIG. 5, 510). It can be received through the ports 510-1 and 510-2 of FIGS. 6A to 6C.
  • the number of bits representing each of the weights W0 and W1 may correspond to the number (eg, 4) according to the designated data type.
  • a combiner of an arithmetic circuit may perform a multiplication operation between integers represented along bits less than the mantissas using a multiplier that performs a multiplication operation between mantissas of floating-point numbers, Bits representing integers can be combined.
  • 12 bits 710 that the combiner combines and outputs weights W0 and W1 represented by 4 bits received through different ports are shown.
  • bits 710 output from the combiner are obtained by shifting 12 bits 712 obtained by performing code extension on a weight W0 represented by 4 bits and 4 bits representing a weight W1. It may correspond to a result of performing a binary addition operation on the obtained 12 bits 714 .
  • a binary numerical value corresponding to the weight W0 may be represented as 1000 according to a designated data type based on 4 bits. From the bits 1000 representing the weight W0, the combiner can use sign extension to obtain 12 bits 712. For example, 12 bits 712 corresponding to the weight W0 represented by 1000 may be 111111111000. For example, when the weight W1 corresponds to -7, a binary value corresponding to the weight W1 may be represented as 1001. In this case, 12 bits 714 obtained by shifting the 4 bits corresponding to W1 by the combiner may be 100100000000.
  • bits 710 output from the combiner may correspond to the sum of 111111111000 and 100100000000.
  • bits 710 may correspond to ⁇ W0 + W1 ⁇ 8 ⁇ for weights W0 and W1.
  • the multiplier (eg, the multiplier 520 of FIGS. 5 and 6A to 6C ) of the arithmetic circuit according to an embodiment is applied to the bits 710 output from the combiner receiving the weights W0 and W1 and the numerical value I0.
  • the bits 730 may be output by performing a binary multiplication operation between the corresponding bits 720 .
  • Bits 720 may include 12 bits obtained by performing sign extension on the numeric value I0 represented along the 4 bits. For example, if the numeric value I0 corresponds to -8 (represented as 1000 along 4 bits), then bits 720 may be 111111111000. In this case, the 24 bits 730 output from the multiplier may be 000000000011100001000000.
  • the multiplier since the combiner outputs bits representing ⁇ W0 + W1 ⁇ 8 ⁇ from the weights W0 and W1, the multiplier performs a multiplication operation between the bits output from the combiner and the bits representing the numerical value I0.
  • One result P can be expressed as in Equation 2.
  • the bit selector and bit adjuster included in the converter (eg, the converter 530 of FIGS. 5 and 6A to 6C) of the arithmetic circuit that receives the bits output from the multiplier is configured to obtain a weight value W0 and a numerical value from the received bits.
  • a first integer P0 corresponding to the result of multiplying I0 and a second integer P1 corresponding to the result of multiplying the weight W1 and the numerical value I0 may be output.
  • the first integer P0 output by the bit selector of the converter includes 8 bits (P[7: 0]).
  • the bit adjuster of the converter extracts 8 bits 740 arranged in lower digits among the bits 730 and , it is possible to obtain a first integer P0.
  • the second integer P1 output by the bit adjuster of the converter can be expressed as Equation 3.
  • the bit adjuster may obtain the second integer P1 by compensating for a change due to sign extension.
  • P[15:8] in Equation 3 may correspond to a portion 750 of bits 730 output from the multiplier.
  • the bit adjuster of the converter adds to portion 750 bits 760 that includes the bit corresponding to the designated digit of bits 730 (eg, P[7]), thereby corresponding to P1 in Equation 3.
  • Bits 770 can be obtained. For example, each of the bits 740 representing the first integer P0 and the bits 770 representing the second integer P1 are, as described above with reference to FIGS. 5 and/or 6C, the first channel of the arithmetic circuit ( O1) and the second channel O2.
  • the arithmetic circuit may simultaneously output a result of multiplying each of a plurality of multiplicands by a multiplier (W0 ⁇ I0, W1 ⁇ I0).
  • Each of the bits 740 and 770 output through the first channel O1 and the second channel O2 and representing each of the first integer P0 and the second integer P1 based on 8 bits, for example, may be accumulated in the first accumulation circuit 430-1 and the second accumulation circuit 430-2 of FIG. 4A.
  • Numerical values, accumulated in each of the first accumulator circuit 430-1 and the second accumulator circuit 430-2 and represented based on the 8 bits, are generated by a neural engine (e.g., the neural engine 240 of FIG. 4A). )) can be converted to the designated data type for representing an integer along 4 bits.
  • the numerical values converted into the designated data type may correspond to a weighted sum of nodes included in a specific layer of the neural network.
  • the operation circuit of the electronic device may perform a multiplication operation between one or more multiplicands and multipliers based on different data types (eg, FP16, INT8, and INT4).
  • the number of multiplication operations that can be performed in a single processing cycle by an arithmetic circuit of an electronic device according to an embodiment may be differentiated based on a data type selected from among data types. For example, if the number of bits representing a numerical value is differentiated along data types, a state in which an operation based on a data type representing a numerical value along with a relatively small number of bits (e.g., state 630 in FIG. 6C) In , the electronic device can simultaneously perform more multiplication operations than other data types.
  • FIGS. 8, 9A to 9D, and/or 10 another example of an arithmetic circuit included in an NPU of an electronic device according to an embodiment will be described with reference to FIGS. 8, 9A to 9D, and/or 10 .
  • FIG. 8 is a block diagram for explaining another example of an arithmetic circuit 410 of the electronic device 101 according to an exemplary embodiment.
  • the electronic device 101 of FIG. 8 may correspond to the electronic device 101 of FIGS. 1 to 2 and 4A to 4B and/or the electronic device of FIG. 3 .
  • the arithmetic circuit 410 of FIG. 5 may correspond to an example of the arithmetic circuit 410 of FIG. 4B .
  • an arithmetic circuit 410 may include combiners 810 815, a multiplier 520, a converter 820, an adder 580, or a combination thereof.
  • the calculation circuit 410 may perform a multiplication operation based on one or more multipliers and one or more multiplicands. For example, weights assigned to each of the connection lines connecting the plurality of layers in FIG. 3 correspond to an example of the one or more multipliers, and are assigned to each of the nodes included in the plurality of layers in FIG. 3 Numerical values correspond to examples of the one or more multiplicands.
  • the arithmetic circuit 410 includes ports 810-1 and 810-2 for receiving bits representing one or more multiplicands, and a port for outputting bits in which the one or more multiplicands are combined ( 810-3) may be included.
  • arithmetic circuit 410 has ports 815-1 and 815-2 for receiving bits representing one or more multipliers, and port 815-3 for outputting bits in which the one or more multipliers are combined. It may include a coupler 815 including a.
  • the arithmetic circuit 410 includes a port 520-1 connected to the port 810-3 of the combiner 810, a port 520-2 connected to the port 815-3 of the combiner 915, and ports It may include a multiplier 520 including a port 520-3 for outputting bits corresponding to a result of performing a binary multiplication operation corresponding to bits received from 520-1 and 520-2. .
  • the arithmetic circuit 410 includes a port 580-1 for receiving some of the bits representing the multiplicand, a port 580-2 for receiving bits representing the multiplier, and ports 580-1, 580- 2) may include an adder 580 including a port 580-3 for outputting bits representing a result of performing a binary addition operation corresponding to the received bits.
  • the ports 810-1, 810-2, 815-1, 815-2, 580-1, and 580-2 of the arithmetic circuit 410 allow the arithmetic circuit 410 to receive one or more numerical values. It can correspond to the receiving ports.
  • Multiplier 520 and adder 580 of FIG. 8 may correspond to multiplier 520 and adder 580 of FIG. 5 , respectively.
  • an operation circuit 410 is connected to a port 520-3 of a multiplier 520 and a port 580-3 of an adder 580, and the ports 520-3 , 580-3), a converter that outputs bits representing one or more numerical values to at least one of four channels (eg, the first channel O1 to the fourth channel O4).
  • the converter 820 may output the bits output from the port 580-3 and/or the data type of the one or more multipliers and/or the one or more multiplicands input to the arithmetic circuit 410 through the port ( 520-3), it is possible to obtain one or more numerical values to be output through at least one of the four channels.
  • the converter 820 includes a port 825-1 for receiving bits output from a port 520-3 of a multiplier 520, and bits received through the port 825-1. and a bit selector 825 including a port 825-2 for outputting bits corresponding to some of the bits.
  • the converter 820 includes a port 830-1 for receiving bits output from the port 520-3 of the multiplier 520 and a port 830-2 for changing and outputting at least one of the received bits.
  • the converter 820 includes a port 840-1 connected to the port 825-2 of the bit adjuster 825 and a port 840 corresponding to the second channel O2 of the arithmetic circuit 410.
  • -2) may include a bit adjuster 840.
  • the converter 820 includes a port 835-1 connected to the port 825-2 of the bit adjuster 825 and a port 835-1 that selects and outputs some of the bits received through the port 835-1. 2) may include a bit selector 835 including.
  • the converter 820 includes a port 570-1 connected to the port 520-3 of the multiplier 520 and a port 570-2 connected to the port 580-3 of the adder 580. ), and a shift register including a port 570-3 outputting bits representing the result of shifting the bits received through the port 570-1 based on the bits received from the port 570-2 ( 570) may be included.
  • the converter 820 has a port 560-1 connected to the port 835-2 of the bit selector 835 and a port 560-1 connected to the port 570-3 of the shift register 570.
  • a port 560-3 for receiving a signal SEL from a controller corresponding to the arithmetic circuit 410 (eg, the controller 420 of FIGS. 4A to 4B), and the port 560-3
  • a switch 560 including a port 560-4 for outputting bits of any one of the ports 560-1 and 560-2 based on the signal received by the switch 560 may be included.
  • Each of the shift register 570 and switch 560 of FIG. 8 may correspond to the shift register 570 and switch 560 of FIG. 5 .
  • the port 560 - 4 of the switch 560 may correspond to the first channel O1 of the arithmetic circuit 410 .
  • the converter 820 includes a port 845-1 connected to the port 830-2 of the bit adjuster 830 and a port 845 corresponding to the third channel O3 of the arithmetic circuit 410.
  • -2) may include a bit selector 845.
  • the converter 820 has a port 850-1 connected to the port 830-2 of the bit adjuster 830 and a port 850-2 corresponding to the fourth channel O4 of the arithmetic circuit 410.
  • a regulator 850 may be included.
  • Each of the bit adjusters 840 and 850 may output a result of changing at least one of the bits received from the ports 840-1 and 850-1 through the ports 840-2 and 850-2. there is.
  • Each of the bit selectors 835 and 845 may select some of the bits received from the ports 835-1 and 845-1 and output them to the ports 835-2 and 845-2.
  • output from port 520-3 of multiplier 520 as converter 820 is controlled by the controller of arithmetic circuit 410 (e.g., controller 420 of FIGS. 4A-4B).
  • Bits to be used may be adjusted and/or divided based on data types corresponding to numerical values input to the arithmetic circuit 410 .
  • a signal path within converter 820 may be changed according to the data type.
  • the controller corresponding to the calculation circuit 410 inputs input to the ports 810-1, 810-2, 815-1, 815-2, 580-1, and 580-2 of the calculation circuit 410 according to the data type. bits can be changed.
  • a controller corresponding to the operation circuit 410 may selectively activate the combiners 810 and 815 and/or the adder 580 according to the data type.
  • FIGS. 9A to 9D are views for explaining different states 910, 920, 930, and 940 of the arithmetic circuit of FIG.
  • the electronic device 101 of FIGS. 9A to 9D may correspond to the electronic device 101 of FIGS. 1 to 2 , 4A to 4B and 8 , and/or the electronic device of FIG. 3 .
  • the arithmetic circuit 410 of FIGS. 9A to 9D may correspond to an example of the arithmetic circuit 410 of FIG. 4B and/or the arithmetic circuit 410 of FIG. 8 .
  • FIG. 9A is an exemplary diagram for explaining an operation of an operation circuit 410 in a state 910 of performing a multiplication operation based on a first data type for representing a floating point number.
  • the first data type may correspond to the data type FP16 of the half-precision floating point format of IEEE 754 described above with reference to FIG. 6A.
  • the electronic device 101 uses the arithmetic circuit 410 to obtain a numerical value Wa and a numerical value. The operation of performing a multiplication operation of the value Ia is described.
  • the numerical value Wa may be one of the elements of a matrix representing a kernel in a CNN and/or a weight assigned to a connection line in FIG. 3 .
  • the numerical value Ia may be one of the elements of another matrix to be applied to a numerical value assigned to a node in FIG. 3 and/or a matrix representing a kernel in a CNN.
  • each of the numerical values Wa_s, Wa_e and Wa_M corresponds to the sign, exponent and mantissa of the numerical value Wa in the first data type
  • each of the numerical values Ia_s, Ia_e and Ia_M corresponds to the sign of the numerical value Ia in the first data type, It is assumed that the exponent and mantissa correspond.
  • mantissas Wa_M and Ia_M of respective numerical values Wa and Ia may be input to ports 520 - 1 and 520 - 2 of the multiplier 520 .
  • the combiners 810 and 815 of the arithmetic circuit 410 are inactivated in state 910, input to ports 810-1 and 815-1 of the combiners 810 and 815, respectively.
  • Mantissas Ia_M and Wa_M may be transmitted to ports 520 - 1 and 520 - 2 of multiplier 520 , bypassing combiners 810 and 815 .
  • Deactivation of combiners 810 and 815 may be controlled by arithmetic circuit 410 and/or a controller coupled to arithmetic circuit 410 (eg, controller 420 of FIGS. 4A-4B ).
  • the multiplier 520 may perform a multiplication operation on numerical values respectively indicated by 13 bits and 12 bits (respectively indicated by). For example, via port 520-1, multiplier 520 may receive a numerical value represented along 13 bits. Via port 520-2, multiplier 520 may receive a numerical value represented along 12 bits. When receiving Ia_M and Wa_M represented by 10 bits through each of the ports 520-1 and 520-2, the multiplier 520 uses sign extension to perform Ia_M represented by 13 bits; and Wa_M represented by 12 bits. The sign extension may be performed, for example, based on each of Wa_s and Ia_s indicating the sign of each of the numerical values Wa and Ia.
  • multiplier 520 may perform multiplication operations on Ia_M and Wa_M represented by 13 bits and 12 bits, respectively.
  • the multiplier 520 may output, for example, a product of Ia_M and Wa_M represented by 24 bits through the port 520-3.
  • exponents Wa_e and Ia_e of respective numerical values Wa and Ia may be input to ports 580 - 1 and 580 - 2 of the adder 580 .
  • Adder 580 may be activated in state 610 by arithmetic circuit 410 and/or a controller coupled to arithmetic circuit 410 .
  • the adder 580 may perform an addition operation on Wa_e and Ia_e represented by 5 bits and output the sum of Wa_e and Ia_e through the port 580-3.
  • the shift register 570 may receive the product of Ia_M and Wa_M output from the multiplier 520 through the port 570-1.
  • the shift register 570 calculates the product of Ia_M and Wa_M based on the received sum of Wa_e and Ia_e.
  • can shift Shifting the product of Ia_M and Wa_M based on the sum of Wa_e and Ia_e may correspond to the operation of normalizing the mantissa of a floating point number.
  • Shift register 570 at state 910, outputs floating point numbers based on the normalized product of Ia_M and Wa_M, and the sum of Wa_e and Ia_e received from adder 580, via port 570-2. Bits representing the product of Wa and Ia can be output.
  • bit selector 825 and the bit adjuster 830 included in the converter 820 may be deactivated.
  • bit selector 825 and bit adjuster 830 are deactivated, bit selectors 835, 845 and bit adjusters 840, 850 connected to bit selector 825 and bit adjuster 830 may be deactivated.
  • switch 560 of converter 820 selects port 560-2, which corresponds to port 570-3 of shift register 570, among ports 560-1 and 560-2. , can be connected to the port 560-4 corresponding to the first channel O1.
  • connection between the ports 560-2 and 560-4 in the switch 560 is a signal input through the port 560-3 and provided, for example, from a controller corresponding to the arithmetic circuit 410. (SEL).
  • SEL arithmetic circuit 410.
  • bits output from the port 520-3 of the multiplier 520 may be output through the port 560-4 of the switch 560. .
  • the arithmetic circuit 410 of the electronic device 101 may output the bits stored in the shift register 570 through the first channel O1.
  • the arithmetic circuit 410 concatenates shifted bits representing the product of Ia_M and Wa_M, bits representing the sum of Wa_e and Ia_e, and a bit representing the sign of the product of Ia_M and Wa_M, and the first data type Bits representing the product of Wa and Ia may be output according to the number of bits (eg, 32 bits) of 16 bits or more of . Bits output through the first channel O1 and representing the product of Wa and Ia may be stored, for example, in the first accumulator circuit 430-1 of FIG. 4B.
  • FIG. 9B is an exemplary diagram for explaining an operation of the operation circuit 410 in a state 920 of performing a multiplication operation based on a second data type for representing an integer.
  • the second data type may correspond to the data type INT8 of FIG. 9B.
  • the electronic device 101 uses the arithmetic circuit 410 to obtain a numerical value Wb and a numerical value.
  • the operation of performing the multiplication operation of Ib is described.
  • the numerical value Wb may be one of the elements of a matrix representing a weight assigned to a connection line in FIG. 3 and/or a kernel in a CNN.
  • the numerical value Ib may be one of the elements of another matrix to be applied to a numerical value assigned to a node in FIG. 3 and/or a matrix representing a kernel in a CNN.
  • numerical values Wb and Ib may be input to ports 520 - 1 and 520 - 2 of the multiplier 520 . Similar to the state 910 of FIG. 9A , as the combiners 810 and 815 of the arithmetic circuit 410 are inactivated, input is input to the ports 810-1 and 815-1 of the combiners 810 and 815. The numerical values Ib and Wb may be transmitted to the ports 520-1 and 520-2 of the multiplier 520, respectively, by bypassing the combiners 810 and 815.
  • the multiplier 520 may obtain Ib represented by 13 bits and Wb represented by 12 bits by using sign extension.
  • the sign extension may be performed, for example, based on a bit representing the sign of each of the numerical values Wb and Ib (eg, the MSB of bits representing the numerical values Wb and Ib).
  • the multiplier 520 may output, for example, the product of Wb and Ib represented by 24 bits through the port 520-3.
  • the adder 580 is disabled, or bits representing a specified numerical value (eg, 0) are sent to the ports 580-1 and 580-2 of the adder 580. can be entered. Deactivation of adder 580 may be performed, for example, by arithmetic circuit 410 and/or a controller coupled to arithmetic circuit 410 that has identified a request to perform a multiplication operation based on the second data type. . With adder 580 inactive, the bits that adder 580 sends to port 570-2 of shift register 570 are a specified number that at least temporarily halts the shifting of bits by shift register 570. Can represent a value (eg 0).
  • bit selectors 825, 835, 845 and bit adjusters 830, 840, 850 included in converter 820 are inactive. It can be.
  • switch 560 of converter 820 directs port 560-2, which corresponds to port 570-3 of shift register 570, to a received message via port 560-3. Based on the signal SEL, a connection can be made to the port 560-4. In this case, bits that are output from the port 570-3 of the shift register 570 and represent the product of Wb and Ib are output to the first channel O1 of the arithmetic circuit 410 through the port 560-4. It can be.
  • bits input to the port 570-1 of the shift register 570 may be output independently of the shift.
  • bits representing the product of Wb and Ib eg, 8 or more bits of the second data type
  • bits output through the first channel O1 and representing the product of Wb and Ib may be stored in, for example, the first accumulator circuit 430-1 of FIG. 4A.
  • FIG. 9C is for explaining an operation of the operation circuit 410 in a state 930 of performing a multiplication operation based on a third data data type, which is distinguished from the second data type of FIG. 9B and represents an integer. It is an exemplary drawing.
  • the third data type may correspond to, for example, the data type INT4 of FIG. 6C.
  • the electronic device 101 uses the operation circuit 410 to obtain a numerical value Wc0 and a numerical value. The operation of performing a multiplication operation of Wc1 and the numerical value Ic is described.
  • the numerical value Wc0 and the numerical value Wc1 may be one of the elements of a matrix representing a weight assigned to the connection line in FIG. 3 and/or a kernel in a CNN.
  • the numerical value Ic may be a numerical value assigned to a node in FIG. 3 and/or one of elements of another matrix to be applied to a matrix representing a kernel in a CNN.
  • the multiplication operation based on the third data type is independent of the states 910 and 920 in which the first channel O1 among the first channel O1 and the second channel O2 is used, the first channel O1 ) and activation of all of the third channels O3.
  • the electronic device 101 according to an embodiment generates two numerical values (eg, Wc0 ⁇ Ic and Wc1 ⁇ Ic) may be output through the first channel O1 and the third channel O2.
  • numerical values Wc0 and Wc1 may be input to ports 815-1 and 815-2 of the combiner 815.
  • arithmetic circuit 410 of electronic device 101 and/or a controller corresponding to arithmetic circuit 410 activates combiner 815. can do.
  • the combiner 815 may combine bits received through each of the ports 815-1 and 815-2 and corresponding to the numerical values Wc0 and Wc1, respectively. Combining the bits corresponding to the numerical values Wc0 and Wc1 by the combiner 815 may be performed similarly to the operation of the combiner 510 of FIG. 6C.
  • multiplier 520 receives bits representing the numerical value Ic received via port 520-1 and a combiner 815 received via port 520-2.
  • a multiplication operation of bits output from the port 815-3 of ) can be performed.
  • the combiner 810 receiving the numerical value Ic may be deactivated.
  • the numerical value Ic received through port 810-1 may bypass combiner 810 and be transmitted to port 520-1 of multiplier 520.
  • the multiplier 520 may output a result of performing a multiplication operation on bits received through the ports 520-1 and 520-2 through the port 520-3.
  • bit selectors 825, 835, and 845 and the bit adjuster 830 included in the converter 820 may be activated.
  • the bit selector 825 may receive bits output from the port 520-3 of the multiplier 502 through the port 825-1.
  • bit selector 825 may extract a portion of the received bits (eg, 8 bits including the LSB and the 7 bits contiguous with the LSB).
  • the bit selector 825 may output the extracted bits through a port 825-2.
  • the bit selector 835 may receive bits selected by the bit selector 825 through a port 835-1 connected to the port 825-2 of the bit selector 825.
  • the bit selector 835 may extract some of the bits received through the port 835-1 (eg, LSB and 4 bits contiguous with the LSB) and output it through the port 835-2. .
  • the switch 560 converts bits received from the port 560-1 among the ports 560-1 and 560-2 based on the signal SEL received through the port 560-3 to the port ( 560-4). Since the port 560-1 of the switch 560 corresponds to the port 835-2 of the bit selector 835, the switch 560 transfers the bits output from the bit selector 835 to the port 560-4. can be output through For example, bits output through the first channel O1 may correspond to a product of numerical values Wc0 and Ic.
  • adder 580 may be deactivated. As the adder 580 is deactivated, the shift register 570 can directly output the bits received from the port 570-1 through the port 570-3.
  • the bit adjuster 830 of the arithmetic circuit 410 in response to receiving bits output from the port 520-3 through the port 830-1, at least one of the received bits (eg, a bit corresponding to a specified number of digits) may adjust one or more other bits.
  • the bit adjuster 830 may output one or more other adjusted bits through the port 830-2.
  • Bit selector 845 which includes port 845-1 connected to port 830-1 of bit adjuster 830, includes a portion of the bits adjusted by bit adjuster 830 (e.g., LSB and LSB). 4 contiguous bits) may be extracted and outputted through a port 840-2 corresponding to the third channel O3.
  • Bits output through the third channel O3 may correspond to a product of numerical values Wc1 and Ic.
  • Numerical values output from each of the first channel O1 and the third channel O3 may be stored in the first accumulator circuit 430-1 and the third accumulator circuit 430-3 of FIG. 4B, respectively.
  • the number of bits of each of the numeric values stored in each of the first accumulator circuit 430-1 and the third accumulator circuit 430-3 is 4 bits or more (eg, 8 bits) of the third data type. can be
  • a plurality of multiplicands (eg, numerical values Wc0 and Wc1) are multiplied. (eg, numerical value Ic) by performing a multiplication operation, and outputting the result of multiplying each of a plurality of multiplicands by the multiplier through different channels (eg, the first channel O1 and the second channel O2) can do.
  • operation of operation circuit 410 performing a multiplication operation between a plurality of multiplicands (eg, numerical values Wc0 and Wc1 ) multipliers (eg, numerical value Ic) is performed in FIG. 6C and/or Similar to FIG. 7 can be performed.
  • FIG. 9D is an example for explaining the operation of the operation circuit 410 in a state 940 of performing a multiplication operation based on a fourth data type, which is distinguished from the second data type of FIG. 9C and represents an integer. it is a schematic drawing.
  • the fourth data type may correspond to, for example, a data type INT2 for representing a fixed-point number or an integer along 2 bits.
  • the electronic device 101 uses the operation circuit 410 to select among the numerical values Wd0 and Wd1. The operation of obtaining products of any one and a combination of any one of the numeric values Id0, Id1 is described.
  • the numerical values Id0 and Id1 are numerical values included in input data to be input to a specific layer among a plurality of layers of the neural network.
  • numerical values Wd0 and Wd1 are weights corresponding to the specific layer.
  • the electronic device 101 may activate all of the first to fourth channels O1 to O4.
  • the electronic device 101 generates four numerical values (eg, Wd0 ⁇ Id0) corresponding to a result of applying multipliers (eg, numerical values Id0 and Id1) to multiplicands (eg, numerical values Wd0 and Wd1), respectively.
  • Wd1 ⁇ Id0, Wd0 ⁇ Id1, and Wd1 ⁇ Id1 may be output through each of the first to fourth channels O1 to O4.
  • multipliers eg, numerical values Id0 and Id1
  • bits output through the port 810-3 of the combiner 810 may represent the multipliers through different digits.
  • multiplicands input to ports 815-1 and 815-2 e.g., numerical values Wd0 and Wd1
  • bits output through the port 815-3 of the combiner 815 may represent the multiplicands through different digits.
  • the multiplier 520 performs a multiplication operation on bits representing each combination of multiplicands and combinations of multipliers received through ports 520-1 and 520-2, respectively.
  • the multiplier 520 may output a result of performing a multiplication operation through a port 520-3.
  • adder 580 of arithmetic circuit 410 may be inactive.
  • bit selectors 825, 835, and 845 and bit adjusters 830, 840, and 850 may be activated.
  • Bit selector 825 similar to bit selector 825 in state 930 of FIG. 9C and/or bit selector 540 of FIG. 6C, outputs bits from multiplier 520 (eg, port ( A portion of the bits output from 520-3 (eg, 8 bits including the LSB and 7 bits contiguous with the LSB) may be extracted
  • the bit selector 825 converts the extracted bits to a port ( 825-2).
  • the bit selector 835 selects some of the bits received through the port 835-1 and output from the port 825-2, similar to the state 930 of FIG. 9C. It can be extracted and output through the port 835-2.
  • bits output through the port 835-2 may be output through the first channel O1 of the arithmetic circuit 410.
  • bits output through the first channel O1 may represent a product of numerical values Wd0 ⁇ Id0.
  • the bit adjuster 840 adjusts at least one of the bits received through the port 840-1 and output from the port 825-2 to the port 840-2 corresponding to the second channel O2. ) can be output.
  • Bits output through the second channel O2 may represent a product of numerical values Wd1 ⁇ Id0.
  • bit adjuster 830 similar to bit selector 830 in state 930 of FIG. 9C and/or bit adjuster 550 of FIG. 6C, output bits from multiplier 520.
  • a result of adjusting one or more other bits based on at least one of the above may be output through the port 830-2.
  • the bits output through the port 830-2 may be transmitted to the port 845-1 of the bit selector 845 and the port 850-1 of the bit adjuster 850.
  • the bit selector 845 extracts some of the bits received through the port 845-1 and outputs them to the port 840-2 corresponding to the third channel O3. can do.
  • Bits output through the third channel O3 may represent a product of numerical values Wd0 ⁇ Id1.
  • the bit adjuster 850 may output a result of adjusting the bits received through the port 850-1 through the port 850-2 corresponding to the fourth channel O4.
  • Bits output through the fourth channel O4 may represent a product of numerical values Wd1 ⁇ Id1.
  • Numerical values output from each of the first channel O1 to fourth channel O4 may be stored in each of the first accumulator circuit 430-1 to fourth accumulator circuit 430-4 of FIG. 4B.
  • the number of bits of each of the numerical values stored in each of the first accumulator circuit 430-1 to the fourth accumulator circuit 430-4 is equal to or greater than the second bits of the fourth data type (eg, 4 bits). ) can be.
  • the operation circuit 410 is performed between a plurality of multiplicands (eg, numerical values Wd0 and Wd1) and a plurality of multipliers (eg, numerical values Id0 and Id1).
  • a plurality of multiplicands eg, numerical values Wd0 and Wd1
  • a plurality of multipliers eg, numerical values Id0 and Id1
  • An example of an operation of performing a multiplication operation of is described.
  • FIG. 10 is a diagram for explaining an operation of performing a multiplication operation of integers using a multiplier related to a mantissa of a floating-point number in the calculation circuit of FIG. 8 .
  • the electronic device of FIG. 10 may correspond to an example of the electronic device 101 of FIGS. 1 to 2, 4A to 4B, 8 and 9A to 9D, and/or the electronic device of FIG. 3 .
  • the electronic device based on a designated data type (eg, the fourth data type of FIG. 9D) to represent an integer along 2 bits, the electronic device according to an embodiment An operation of the device performing a multiplication operation between a plurality of multiplicands (eg, numerical values Wd0 and Wd1) and a plurality of multipliers (eg, numerical values Id0 and Id1) is described.
  • a designated data type eg, the fourth data type of FIG. 9D
  • a first combiner (eg, combiner 810 of FIG. 9D ) of the arithmetic circuit according to an embodiment indicates each of the plurality of multipliers. Bits can be combined. Referring to FIG. 10 , 12 bits 1020 that the first combiner combines and outputs numerical values Id0 and Id1 represented by 2 bits are shown. The bits 1020 output by the first combiner are obtained by shifting 11 bits 1021 obtained by performing sign extension on the numerical value Id0 represented by 2 bits and 2 bits representing the numerical value Id1 It may correspond to a result of performing a binary addition operation on the 11 bits 1022 .
  • the first combiner may perform a binary addition operation based on 11 bits. For example, if the numeric values Id0 and Id1 correspond to 1 and -2, respectively, bits 1021 perform sign extension on the numeric value Id0, resulting in 00000000001, and bits 1022 shift the numeric value Id1. So, it is 10000000000.
  • the second combiner (eg, combiner 815 of FIG. 9D ) of the arithmetic circuit according to an embodiment converts bits representing each of the plurality of multiplicands. can be combined Referring to FIG. 10 , 7 bits 1010 that the second combiner combines and outputs weights Wd0 and Wd1 represented by 2 bits are shown.
  • the bits 1010 output by the second combiner are 6 bits 1011 obtained by performing code extension on the weight Wd0 represented by 2 bits, and 6 bits obtained by shifting 2 bits representing the weight Wd1. may correspond to a result of performing a binary addition operation on s 1012 .
  • the second combiner may perform a binary addition operation based on 6 bits. For example, when the weights Wd0 and Wd1 are -2 and -1, respectively, bits 1011 are the sign-extended binary value 111110 of the weight Wd0, and bits 1012 are binary values obtained by shifting the weight Wd1. The value is 110000.
  • the multiplier of the arithmetic circuit may output bits 1030 by performing a binary multiplication operation between the bits 1010 and 1020 output from the first combiner and the second combiner, respectively.
  • the first bit selector (e.g., bit selector 825 of FIG. 8 and/or FIG. 9D) coupled to the multiplier selects the LSB and the 7 adjacent bits of the bits 1030 representing the output P of the multiplier.
  • Eight bits 1035 (eg, P[7:0]) including bits can be extracted.
  • the first bit adjuster connected to the multiplier (eg, the bit adjuster 830 of FIG. 8 and/or FIG. 9D ) includes bits (eg, P[16:9]) corresponding to a designated portion of the bits 1030 (eg, P[16:9]). 1040) may be adjusted based on a bit different from the part (eg, P[8]).
  • the bits 1035 extracted by the first bit selector are, as described above with reference to FIG. 9D, a second bit adjuster connected to the bit selector (eg, the bit adjuster 840 of FIG. 9D) and It may be input to the second bit selector (eg, the bit selector 835 of FIG. 9D).
  • the second bit selector corresponds to a portion of the bits 1035 (eg, 4 bits including the LSB of the bits 1035 and 3 bits adjacent to the LSB (eg, P[3: 0]) Bits 1055 may be output.
  • the bits 1055 may correspond to, for example, the product of Wd0 ⁇ Id0 output through the first channel O1.
  • the second bit adjuster includes MSB among the bits 1035 and 4 bits including 3 bits adjacent to the MSB ( For example, bits 1070 representing the result of adding bits 1065 based on a bit of a designated digit (eg, P[3]) among bits 1035 to P[7:4]) 1060
  • Bits ( 1070) may be output to the second channel O2 by the second bit adjuster.
  • bits 1050 output by the first bit adjuster are connected to the first bit adjuster. It may be input to a bit adjuster (eg, bit adjuster 850 of FIG. 9D ) and a third bit selector (eg, bit selector 845 of FIG. 9D ).
  • the third bit selector corresponds to a portion of the bits 1050 (eg, LSB of the bits 1050 and 4 bits including the 3 bits adjacent to the LSB) (eg, P1[3:0]) It is possible to output bits 1075 that do.
  • the bits 1075 may correspond to a product of Wd0 ⁇ Id1 output through the third channel O3, for example.
  • the bits 1075 may be output to the third channel O3 by the third bit selector.
  • the third bit adjuster assigns MSB among the bits 1050 and four bits (eg, P1[7:4]) 1080 including the three bits adjacent to the MSB to a designated digit among the bits 1050.
  • Bits 1090 indicating the result of adding the bits 1085 based on (eg, P1[3]) may be output.
  • the arithmetic circuit may simultaneously output all of the products between two multiplicands and two multipliers.
  • Bits 1055, 1070 which are output through the first channel O1 to the fourth channel O4 and represent products between two multiplicands and two multipliers based on 4 bits; 1075 and 1090) may be accumulated in each of the first accumulator circuit 430-1 to the fourth accumulator circuit 430-4 of FIG. 4B, for example.
  • the products accumulated in each of the first accumulator circuit 430-1 to the fourth accumulator circuit 430-4 and represented based on the 4 bits are generated by a neural engine (eg, the neural engine 240 of FIG. 4B). )) can be converted to the designated data type for representing an integer along 2 bits.
  • the products converted into the specified data type may correspond to a weighted sum of nodes included in a specific layer of the neural network.
  • the operation circuit of the electronic device performs a multiplication operation between one or more multiplicands and one or more multipliers based on different data types (eg, FP16, INT8, INT4, and INT2).
  • the data types may be independently set in each of a plurality of layers included in the neural network.
  • the calculation circuit of the electronic device performs a multiplication operation based on the data type of each of the plurality of layers, the size of data input and/or output from the NPU including the calculation circuit to the memory is It can be differentiated according to data type. As the size of data is differentiated, traffic between the NPU and the memory may be reduced.
  • FIG. 11 is a flowchart 1100 illustrating an operation of processing input data based on a neural network by an electronic device according to an exemplary embodiment.
  • the electronic device of FIG. 11 may correspond to examples of the electronic devices of FIGS. 1 to 10 .
  • the operation of the electronic device of FIG. 11 may be performed by the electronic device 101, the NPU 210 and/or the controller 260 of FIG. 2 .
  • the electronic device may identify a request to obtain output data from a neural network using input data.
  • the request may be identified by, for example, an application running on a processor of the electronic device (eg, the processor 120 of FIGS. 1 and/or 2 ).
  • the processor 120 in response to executing an instruction for calling an API related to a function related to the NPU 210 among instructions, based on the executed instruction, to the NPU 210 At least one of input data to be input or a data type of the input data may be identified.
  • the API is an application (or included in an operating system) that includes functions related to neural networks, such as face recognition, image recognition based on an always on camera, voice recognition, and/or handwriting recognition. system software).
  • the API may cause at least partial activation of the NPU 210 .
  • the processor 120 may request the NPU 210 to acquire output data corresponding to the input data while transmitting the data type and input data.
  • the instructions for calling APIs related to functions related to the NPU 210 may be generated by a compiler (eg, a neural network compiler) for generating an instruction set for the NPU 210.
  • the instruction may indicate a data type of each of the layers included in the neural network.
  • the instruction may indicate connections between nodes included in the layers (eg, a graph).
  • the electronic device may identify a plurality of weights distinguished by a plurality of layers of a neural network in a memory. For example, the electronic device may identify a plurality of weights representing a neural network from a memory (eg, the memory 130 of FIGS. 1 and/or 2 ). Independently of identifying the plurality of weights, the electronic device may identify input data associated with the request of operation 1110 .
  • the input data may include, for example, a data set corresponding to an input layer of the neural network.
  • the electronic device selects at least one neural from among the neural engines of the NPU to perform an operation based on weights corresponding to a specific layer among a plurality of layers. You can choose your engine.
  • the neural network of operation 1110 may include a sequence of multiple layers. As will be described later, the specific layer may be gradually selected from the first layer in the sequence of the plurality of layers. Selection of a neural engine by an electronic device according to an embodiment may be based on the number of times a weighted sum based on a specific layer is calculated.
  • the electronic device may input at least a portion of weights corresponding to a specific layer to at least one selected neural engine.
  • the weight input to the neural engine may be a numerical value displayed according to a data type identifiable by one or more calculation circuits (eg, the calculation circuit 410 of FIGS. 4A and 4B ) included in the neural engine.
  • the electronic device transmits input data to at least one selected neural engine, processes the input data based on weights input to the neural engine, and results in data.
  • the input data may include numerical values corresponding to input data related to the request and/or assigned to nodes included in a layer preceding the specific layer in the sequence of the plurality of layers.
  • the neural engine in response to receiving the one or more weights of operation 1140 and the input data of operation 1150, uses one or more arithmetic circuits included in the neural engine to determine the one or more weights and the input data.
  • a weighted sum of can be obtained.
  • An operation of obtaining the weighted sum by one or more arithmetic circuits may be performed similarly to, for example, FIGS. 5 to 10 .
  • the electronic device may determine whether a specific layer of operations 1130 and 1140 corresponds to the last layer among a plurality of layers. . If the specific layer does not correspond to the last layer (1160 - No), in operation 1170, the electronic device according to an embodiment may select a layer next to the specific layer as a specific layer for obtaining result data. there is. After selecting the next layer as the specific layer, the electronic device may repeatedly perform operations 1130 , 1140 , 1150 , and 1160 .
  • the electronic device may output the obtained result data as output data corresponding to the identified request.
  • the output data may correspond to data output from a last layer in a sequence of a plurality of layers related to the neural network of operation 1110, for example.
  • the NPU 210 of the electronic device 101 may output output data of operation 1180 to the processor 120 .
  • Outputting output data from the NPU 210 to the processor 120 may cause an event (or software interrupt) notifying generation of output data corresponding to the request of operation 1110 to occur.
  • processor 120 may execute one or more instructions corresponding to the event to execute one or more functions for processing the output data of operation 1180 .
  • the electronic device of FIG. 12 is a flowchart 1200 illustrating an operation of controlling one or more neural engines by an electronic device according to an exemplary embodiment.
  • the electronic device of FIG. 12 may correspond to examples of the electronic devices of FIGS. 1 to 11 .
  • the operation of the electronic device of FIG. 12 may be performed by the electronic device 101 of FIG. 2, the NPU 210, the neural engine 240 of FIGS. 4A to 4B, and/or the controller 420. there is.
  • the operation of FIG. 12 may be related to the operations 1130 , 1140 , and 1150 of FIG. 11 .
  • the neural engine of the electronic device may receive input data and one or more weights.
  • the electronic device may input input data and one or more weights to the neural engine by performing at least one of the operations 1140 and 1150 of FIG. 11 .
  • Input data and one or more weights input to the neural engine may be stored in a buffer of the neural engine (eg, the buffer 250 of FIG. 2 ).
  • the neural engine of the electronic device may identify data types of received input data and one or more weights.
  • the data type may be related to the number of bits used to represent the input data and the one or more weights.
  • the data type may be matched with the data type of the input data and/or adjusted by a processor of the electronic device (eg, the processor 120 of FIGS. 1 and/or 2 ).
  • the processor may change the data type based on a bandwidth of a memory (eg, memory 130 of FIG. 2 ).
  • another processor eg, processor 120 of FIG. 2 , and/or GPU 220 in which a portion of the bandwidth is distinguished from an NPU (eg, NPU 210 of FIG.
  • the processor may change the data type to another data type in which a relatively small number of bits are used so that the NPU occupies less than another part of the bandwidth.
  • the processor may change the data type based on a parameter indicating a state of a battery, such as State of Charge (SoC). For example, when a battery has an SoC less than a specified threshold, the electronic device may change the data type in order to reduce power consumption of the NPU and the memory by the operations of FIG. 12 .
  • SoC State of Charge
  • the neural engine of the electronic device adjusts signal paths of a plurality of operation circuits included in the neural engine based on the identified data type.
  • the neural engine changes the signal path of the calculation circuit, for example, a combiner included in the calculation circuit (eg, the combiners 510, 810, and 815 of FIGS. 5 and/or 8), a switch (eg, FIG. 5 and/or switch 560 of FIG. 8 ), an adder (eg, adder 580 of FIGS. 5 and/or 8 ) and/or a converter (eg, converters 530 of FIGS. 5 and/or 8 ). 820)) may include an operation of controlling, activating, or deactivating.
  • An example of adjusting a signal path according to a data type by a neural engine according to an embodiment may correspond to FIGS. 6A to 6C and/or 9A to 9D.
  • the neural engine of the electronic device controls a plurality of calculation circuits based on the adjusted signal paths to obtain input data and one input data from the plurality of calculation circuits. As a result of performing an operation based on the above weights, data may be obtained.
  • the electronic device in operation 1250, may accumulate and store result data obtained based on operation 1240 in one or more accumulation circuits.
  • the neural engine may accumulate numerical values output from each of the plurality of calculation circuits in an accumulation circuit (eg, the accumulation circuit 430 of FIGS. 4A and 4B ).
  • the operation of the neural engine to store the resulting data in the accumulator circuit may be differentiated according to the data type identified in operation 1220.
  • the neural engine of the electronic device may output result data accumulated in one or more accumulation circuits.
  • result data of operation 1150 of FIG. 11 result data of operation 1260 may be output.
  • Result data output by the neural engine of the electronic device may include, for example, numerical values assigned to nodes included in one layer among a plurality of layers included in the neural network.
  • FIG. 13 is a flowchart 1300 illustrating an operation of performing an operation based on different data types by an electronic device according to an exemplary embodiment.
  • the electronic device of FIG. 13 may correspond to examples of the electronic devices of FIGS. 1 to 12 .
  • the operation of the electronic device of FIG. 13 includes the electronic device 101 of FIG. 2 , the NPU 210 , the neural engine 240 , the calculation circuit 410 of FIGS. 4A to 4B , and/or the controller 420 .
  • the operation of FIG. 13 may be related to operation 1240 of FIG. 12 , for example.
  • the calculation circuit of the NPU of the electronic device may receive input data and weights.
  • the arithmetic circuit of the NPU of the electronic device determines whether input data of a first data type and a weight representing a floating point number are received in operation 1310. can
  • the arithmetic circuit of the NPU of the electronic device In response to receiving input data of a first data type and a weight for representing a floating point number (1320-yes), in operation 1330, the arithmetic circuit of the NPU of the electronic device according to an embodiment, the arithmetic circuit By inputting the mantissa of the first floating-point number represented by the input data and the mantissa of the second floating-point number corresponding to the weight to each of the first port and the second port of the multiplier of the multiplier, the bits of the third port of the multiplier The result of multiplying the mantissas can be obtained from The multiplier of the arithmetic circuit may include, for example, the multiplier 520 of FIGS. 5 and/or 8 .
  • the arithmetic circuit of the NPU of the electronic device provides an exponent of a first floating point number and a second floating point number to each of the first port and the second port of the adder.
  • the adder of the arithmetic circuit may include, for example, the adder 580 of FIGS. 5 and/or 8 .
  • the calculation circuit of the NPU of the electronic device shifts the result obtained from the multiplier based on the result obtained from the adder, and A third floating point number corresponding to a result of multiplying the decimal point number and the second floating point number may be obtained. Shifting the result obtained from the multiplier by the arithmetic circuit may correspond to an example of an operation of normalizing a result obtained by multiplying mantissas output from the multiplier.
  • the arithmetic circuit of the NPU of the electronic device performs a multiplier
  • a third integer obtained by combining the first integer and the second integer represented by the input data based on the second data type is input to the first port of
  • the third integer represented by the second data type is input to the second port. 4 integers can be entered.
  • the operation circuit may perform operation 1360 .
  • the third integer to be input to the first port of the multiplier may be obtained based on, for example, the combiner 510 of FIG. 5 .
  • the calculation circuit of the NPU of the electronic device multiplies the first integer and the fourth integer based on the bits of the third port of the multiplier, and the second A result of multiplying 2 integers and a 4th integer may be obtained.
  • the arithmetic circuit may include a fifth integer representing a result of multiplying the first integer and the fourth integer using a converter (eg, converter 530 of FIG. 5 and/or converter 820 of FIG. 8 ), and a second integer.
  • a sixth integer representing a result of multiplying 2 integers and a 4th integer may be obtained.
  • the calculation circuit of the NPU of the electronic device may output a result of performing calculations related to input data and weights.
  • a result output by the arithmetic circuit based on operation 1380 may include the third floating point number of operation 1350.
  • the electronic device operates (1370). ) of the fifth integer and the sixth integer may be output.
  • actions 1330, 1340, and 1350 may correspond to state 610 of FIG. 6A and/or state 910 of FIG. 9A.
  • FIG. 14 is a flowchart 1400 for describing an operation performed by an electronic device to obtain one or more integers to be input to a multiplier related to a mantissa of a floating point number, according to an embodiment.
  • the electronic device of FIG. 14 may correspond to examples of the electronic devices of FIGS. 1 to 13 .
  • the operation of the electronic device of FIG. 14 may be performed by the coupler 510 of FIG. 5 and/or the couplers 810 and 815 of FIG. 8 .
  • a combiner included in an arithmetic circuit of an electronic device generates a first data type based on a second data type different from a first data type for representing a floating-point number. From the integers, bits indicating the sign of the first integer can be identified. The combiner can optionally perform operation 1410 in response to receiving the first integer based on the second data type.
  • a combiner included in an arithmetic circuit of an electronic device includes one based on bits identified as bits representing a first integer based on the second data type.
  • a second integer representing a first integer of a second data type may be obtained according to the number of bits representing a mantissa of a floating point number of a first data type.
  • a combiner may obtain a second integer represented along 12 bits corresponding to the number of bits representing the mantissa of a floating point number.
  • Concatenating one or more bits by the combiner based on operation 1420 may involve sign extension of the first integer.
  • the second integer that the combiner obtains based on operation 1420 may correspond to the integer represented by bits 712 of FIG. 7 , for example.
  • a combiner included in an arithmetic circuit of an electronic device shifts bits representing a third integer based on a second data type to obtain a fourth integer.
  • the combiner may obtain the fourth integer by shifting the bits representing the third integer based on the number of bits representing the mantissa of the floating point number.
  • the fourth integer that the combiner obtains based on operation 1430 may correspond to the integer represented by bits 714 of FIG. 7 , for example.
  • the combiner included in the arithmetic circuit of the electronic device adds the second integer and the fourth integer of each of the operations 1420 and 1430 to a port of the multiplier. It is possible to obtain a fifth integer to be input as .
  • the fifth integer that the combiner obtains based on operation 1440 may correspond to the integer represented by bits 710 of FIG. 7 , for example.
  • FIG. 15 is a flowchart 1500 for explaining an operation performed by an electronic device based on bits output from a multiplier of an arithmetic circuit according to an embodiment.
  • the electronic device of FIG. 15 may correspond to examples of the electronic devices of FIGS. 1 to 14 .
  • the operation of the electronic device of FIG. 14 may be performed by the converter 530 of FIG. 5 and/or the converter 820 of FIG. 8 .
  • the converter of the arithmetic circuit of the electronic device converts a plurality of bits representing a product of bits input to each of the first port and the second port of the multiplier, It can be obtained from the third port.
  • the converter of the electronic device converts a first floating-point mantissa and a second floating-point mantissa based on a first data type to represent a floating-point number into a multiplier. It is possible to determine whether input is received through each of the first port and the second port.
  • the converter of the arithmetic circuit of the electronic device may acquire a plurality of bits representing the sum of bits input to the first port and the second port of the adder, respectively, from the third port of the adder.
  • the electronic device may perform operation 1530 similar to operation 1340 of FIG. 13 .
  • the converter of the arithmetic circuit of the electronic device based on the plurality of bits obtained from the third port of the adder, obtains from the third port of the multiplier.
  • a plurality of bits can be shifted.
  • the electronic device may perform operation 1540 similar to operation 1350 of FIG. 13 .
  • the electronic device calculates a first floating-point number and a second floating-point number based on the shifted plurality of bits and the plurality of bits obtained from the third port of the adder.
  • a third floating point number representing the product may be output.
  • the third floating point number may be represented based on the number of bits indicated by the first data type or a greater number of bits.
  • Performing operations 1530, 1540, and 1550 by the electronic device may correspond to state 610 of FIG. 6A and/or state 910 of FIG. 9A.
  • the electronic device in operation 1560, the electronic device according to an embodiment Based on operation 1510, the converter of the arithmetic circuit may extract bits corresponding to the first part including the least significant bit from among the plurality of bits obtained from the third port of the multiplier. In operation 1570, the converter of the arithmetic circuit of the electronic device converts, from the bits included in the first portion extracted based on operation 1560, between integers based on a second data type for representing the integer. The result of performing the multiplication operation can be output.
  • an arithmetic circuit calculates multiplicands (eg, weights Wc0, Wc1 in FIGS. 6C and/or 9C) and multipliers (eg, numerical values Ic in FIGS. 6C and/or 9C) represented along four bits. If received, the electronic device may output the bits included in the extracted first part as a product of the first multiplicand and the multiplier among the multiplicands. For another example, when the arithmetic circuit receives multiplicands (e.g., weights Wd0 and Wd1 in FIG. 9D) and multipliers (e.g., numerical values Id0 and Id1 in FIG.
  • the electronic device may output a product of a first multiplicand and a first multiplier, and a product of a second multiplicand and a first multiplier among the multiplicands, from the bits included in the extracted first part.
  • Each of the product of the first multiplicand and the second multiplier and the product of the second multiplier and the first multiplier may be expressed based on the 4 bits or more bits (eg, 8 bits) of the second data type.
  • the converter of the arithmetic circuit of the electronic device converts a second portion adjacent to the first portion among a plurality of bits obtained from the third port of the multiplier. Corresponding bits can be extracted.
  • the converter of the arithmetic circuit of the electronic device may output a result of performing a multiplication operation between integers based on the second data type, from the bits included in the extracted second part.
  • multiplicands eg, weights Wc0, Wc1 in FIGS. 6C and/or 9C
  • multipliers eg, numerical values Ic in FIGS. 6C and/or 9C
  • the electronic device may output the bits included in the extracted second part as a product of the second multiplicand and the multiplier among the multiplicands.
  • the arithmetic circuit receives multiplicands represented along two bits (e.g. weights Wd0, Wd1 in FIG. 9D) and multipliers (e.g. numerical values Id0, Id1 in FIG. 9D)
  • the electronic device extracts From the bits included in the second part, a product of a first multiplier and a second multiplier among the multiplicands and a product of the second multiplier and the second multiplier may be output.
  • Each of the product of the first multiplicand and the second multiplier and the product of the second multiplier and the second multiplier may be expressed based on the 4 bits or more bits (eg, 8 bits) of the second data type.
  • an electronic device is different from a first data type for representing a floating point number and a plurality of second data types for representing an integer.
  • a combiner for combining a first integer and a second integer of the plurality of integers in response to receiving a request to perform a multiplication operation based on integer numbers;
  • a multiplier for obtaining a product of bits corresponding to mantissas of the floating-point number distinguished by , a third integer among the plurality of integers is input to a first port of the multiplier, and the combiner
  • a fourth integer representing a combination of the first integer and the second integer by is input to the second port of the multiplier, from a third port different from the first port and the second port of the multiplier, In response to identifying a fifth integer representing a product of 3 integers and the fourth integer, based on the identified fifth integer, a sixth integer representing a product of the first integer and the third integer, and the second integer
  • An arithmetic circuit including a converter outputting a seventh integer
  • the combiner may use sign extension to represent the first integer and the integer of the second data type according to the number of bits representing the mantissa of the floating-point number of the first data type.
  • the fourth integer may be output by combining the shifted second integer based on the number of bits representing .
  • the converter may include a bit selector extracting bits corresponding to a first part among bits of the third port representing the fifth integer to obtain the sixth integer; and A bit adjuster for obtaining the seventh integer based on at least one bit among bits representing 6 integers and bits corresponding to a second part different from the first part among the bits of the third port ) may be included.
  • the bit adjuster of the converter combines a most significant bit (MSB) of bits corresponding to the first part and one or more bits corresponding to the second part to obtain the seventh integer. can be obtained.
  • MSB most significant bit
  • the electronic device further includes a shift register, and the converter transmits the sixth integer of the sixth integer or the fifth integer to the shift register in a state of receiving the request, , and a switch for transmitting the fifth integer of the sixth integer or the fifth integer to the shift register in a state in which another request different from the request is received.
  • the multiplier in response to identifying the fourth integer output from the combiner, represents the mantissa of the floating-point number of the first data type using the identified fourth integer and sign extension.
  • the fifth integer may be output by performing a multiplication operation of the third integer represented by the number of bits.
  • the multiplier in response to receiving another request to perform a multiplication operation of a first floating point number and a second floating point number based on the first data type, which is different from the request, the first floating point number is different from the request.
  • a multiplication operation of a first mantissa of a floating-point number and a second mantissa of the second floating-point number is performed to output a third mantissa, and the first mantissa and the second mantissa bypass the combiner to obtain the can be input to the multiplier.
  • the operation circuit may include an adder that performs an addition operation of a first exponent of the first floating-point number and a second exponent of the second floating-point number, and outputs a third exponent, and an output from the adder
  • a shift register for shifting the third mantissa based on the third exponent may be further included.
  • the method of the electronic device is a multiplication operation based on a plurality of integers of a second data type representing an integer and different from a first data type representing a floating point number.
  • bits corresponding to the mantissas of the floating-point number distinguished by the first data type Transmitting a third integer among the plurality of integers based on the number of bits of the mantissa to a first port of a multiplier for obtaining a product, transmitting the third integer to the first port
  • a fifth integer representing a product of the third integer and the fourth integer In response to identifying, from a third port different from the port, a fifth integer representing a product of the third integer and the fourth integer, based on the obtained fifth integer, a number of the first integer and the third integer and obtaining a sixth integer representing a product and a seventh integer representing a product of the second integer and the fourth integer.
  • the combining operation may include representing the first integer according to the number of bits representing the mantissa of the floating-point number of the first data type by using sign extension; shifting an integer based on the number of bits representing the first integer and the integer of the second data type, and the first integer and the shifted second integer represented along the mantissa of the floating point number. and adding 2 integers to obtain the fourth integer.
  • the obtaining operation may include extracting bits corresponding to a first part among bits of the third port representing the fifth integer, obtaining the sixth integer, and obtaining the sixth integer. and obtaining the seventh integer based on at least one of the indicated bits and bits corresponding to a second part different from the first part among the bits of the third port.
  • the obtaining of the seventh integer may include obtaining the seventh integer by combining a most significant bit among bits corresponding to the first part and one or more bits corresponding to the second part.
  • the operation of transmitting the third integer may include transmitting the third integer expressed along the number of bits representing the mantissa of the floating point of the first data type using sign extension to the first port. More actions may be included.
  • the method of the electronic device in response to receiving another request to perform a multiplication operation of a first floating point number and a second floating point number based on the first data type, which is different from the request, inputting a first mantissa of the first floating-point number to the first port of the multiplier, and inputting a second mantissa of the second floating-point number to the second port of the multiplier; In a state where the first mantissa is input and the second mantissa is input through the second port, a third mantissa corresponding to the product of the first mantissa and the second mantissa is obtained from the third port of the multiplier. It may further include an operation to do.
  • the method of the electronic device may, in response to receiving the other request, perform an addition operation of a first exponent of the first floating-point number and a second exponent of the second floating-point number, The method may further include obtaining 3 exponents and shifting the third mantissa based on the obtained third exponent.
  • an electronic device is different from a first data type for representing a floating point number and based on a plurality of integers of a second data type for representing an integer.
  • a first combiner that, in response to receiving a request to perform a multiplication operation, combines a first integer and a second integer of the plurality of integers, in response to receiving the request, a first combiner of the plurality of integers;
  • a second combiner for combining 3 integers and a fourth integer, a multiplier for obtaining a product of bits corresponding to the mantissas of the floating-point number distinguished by the first data type, the first integer and A fifth integer representing a combination of the second integers is input to a first port of the multiplier, and a sixth integer representing a combination of the third integer and the fourth integer of the second combiner is input to a second port of the multiplier.
  • a converter for obtaining products of a combination of any one of the first integer or the second integer and any one of the third integer or the fourth integer may be obtained.
  • the multiplier is responsive to identifying another request to perform a multiplication operation on a first floating point number and a second floating point number of the first data type that is different from the request, the first floating point number being different from the request.
  • the electronic device performs an addition operation of a first exponent of the first floating-point number and a second exponent of the second floating-point number to obtain a third exponent.
  • An adder outputting , and a shift register for shifting a third mantissa output from the multiplier based on the third exponent output from the adder and corresponding to a product of the first mantissa and the second mantissa can include
  • the first combiner uses sign extension to represent the first integer and the integer of the second data type based on bits exceeding the number of bits representing the integer of the second data type.
  • the fifth integer may be output by combining the second integer shifted based on the number of bits to represent .
  • the converter may include a first bit selector for extracting bits corresponding to a first part among bits of the third port representing the seventh integer, and among the bits extracted from the first bit selector, the least significant A second bit selector for obtaining a product of the first integer and the third integer by extracting bits corresponding to a third part including a least significant bit (LSB), among the bits corresponding to the third part Based on at least one, among the bits extracted from the first bit selector, adjusting bits corresponding to a fourth part distinct from the third part to obtain a product of the first integer and the fourth integer.
  • LSB least significant bit
  • 1 bit adjuster based on at least one of the bits corresponding to the first part, a second bit adjuster adjusting bits corresponding to a second part different from the first part among the bits of the third port, the A third bit selector extracting bits corresponding to a fifth part including a least significant bit from among the bits adjusted by the second bit adjuster to obtain a product of the second integer and the third integer; and Based on at least one of the bits corresponding to the second integer, the second integer and the second integer and the and a third bit adjuster for obtaining a product of a fourth integer.
  • the method of the electronic device is a multiplication operation based on a plurality of integers of a second data type representing an integer and different from a first data type representing a floating point number. combining a first integer and a second integer of the plurality of integers in response to receiving a request to perform a third integer and a fourth integer of the plurality of integers in response to receiving the integer; An operation of combining integers, a fifth integer representing a combination of the first integer and the second integer, and a sixth integer representing a combination of the third integer and the fourth integer, respectively, by the first data type inputting to first and second ports of a multiplier for obtaining a product of bits corresponding to the distinct mantissas of the floating-point number, from a third port different from the first and second ports of the multiplier.
  • an electronic device includes a neural processing unit (NPU) including a processor, a memory, and a neural engine for training a neural network having a plurality of layers, wherein the neural engine includes an accumulation circuit. circuit), and an arithmetic circuit including a combiner, a multiplier, an adder, and a converter, the converter including a bit selector, a bit adjuster, a switch, and a shift register, and a controller that accumulates and stores.
  • the controller may accumulate, and store, in the accumulation circuit, numerical values output from different channels of the calculation circuit to calculate a weighted sum corresponding to nodes included in a specific layer of the neural network.
  • the controller can selectively activate at least one of the combiner, the adder, the bit selector, or the bit adjuster based at least in part on an operational state.
  • the neural engine may be configured to receive a request to perform a multiplication based on a plurality of integers of a second data type representing an integer and different from a first data type representing a floating point number.
  • a first integer and a second integer among the plurality of integers may be combined using a combiner.
  • the neural engine may obtain a product of bits corresponding to the mantissa of the floating-point number by using the multiplier, wherein the bits are classified by a first data type, and among the plurality of integers
  • a third integer is input to a first port of the multiplier, and a fourth integer representing a combination of the first integer and the second integer is input to a second port of the multiplier.
  • the neural engine is configured to identify, using the converter, a fifth integer representing a product of the third integer and the fourth integer from a third port of the multiplier different from the first port and the second port. In response, based on the identified fifth integer, output a sixth integer representing the product of the first integer and the third integer, and a seventh integer representing the product of the second integer and the third integer.
  • devices and components described in the embodiments include a processor, a controller, an arithmetic logic unit (ALU), a digital signal processor, a microcomputer, a field programmable gate array (FPGA), and a programmable PLU (programmable logic unit). logic unit), microprocessor, or any other device capable of executing and responding to instructions.
  • the processing device may run an operating system (OS) and one or more software applications running on the operating system.
  • a processing device may also access, store, manipulate, process, and generate data in response to execution of software.
  • the processing device includes a plurality of processing elements and/or a plurality of types of processing elements. It can be seen that it can include.
  • a processing device may include a plurality of processors or a processor and a controller. Other processing configurations are also possible, such as parallel processors.
  • Software may include a computer program, code, instructions, or a combination of one or more of the foregoing, which configures a processing device to operate as desired or processes independently or collectively. You can command the device.
  • the software and/or data may be embodied in any tangible machine, component, physical device, computer storage medium or device to be interpreted by or to provide instructions or data to a processing device. there is.
  • Software may be distributed on networked computer systems and stored or executed in a distributed manner.
  • Software and data may be stored on one or more computer readable media.
  • the method according to the embodiment may be implemented in the form of program instructions that can be executed through various computer means and recorded on a computer readable medium.
  • the medium may continuously store a program executable by a computer or temporarily store the program for execution or download.
  • the medium may be various recording means or storage means in the form of a single or combined hardware, but is not limited to a medium directly connected to a certain computer system, and may be distributed on a network. Examples of the medium include magnetic media such as hard disks, floppy disks and magnetic tapes, optical recording media such as CD-ROM and DVD, magneto-optical media such as floptical disks, and ROM, RAM, flash memory, etc. configured to store program instructions.
  • examples of other media include recording media or storage media managed by an app store that distributes applications, a site that supplies or distributes various other software, and a server.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Molecular Biology (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Neurology (AREA)
  • Advance Control (AREA)

Abstract

일 실시예에 따른 연산 회로는, 복수의 정수들 중 제1 정수 및 제2 정수를 결합하는 결합기를 포함할 수 있다. 상기 연산 회로는, 제1 데이터 타입에 의해 구별되는 부동 소수점 수의 가수들에 대응하는 비트들의 곱을 획득하기 위한 곱셈기를 포함할 수 있다. 상기 복수의 정수들 중 제3 정수가 상기 곱셈기의 제1 포트로 입력될 수 있고, 상기 제1 정수 및 상기 제2 정수의 결합을 나타내는 제4 정수가 상기 곱셈기의 제2 포트로 입력될 수 있다. 상기 연산 회로는, 상기 제1 정수 및 상기 제3 정수의 곱을 나타내는 제6 정수, 및 상기 제2 정수 및 상기 제3 정수의 곱을 나타내는 제7 정수를 출력하는 변환기를 포함하는 연산 회로를 포함할 수 있다.

Description

상이한 데이터 타입들을 지원하는 NPU를 포함하는 전자 장치 및 그 제어 방법
아래의 설명들은 상이한 데이터 타입들을 지원하는 NPU를 포함하는 전자 장치 및 그 제어 방법에 관한 것이다.
전자 장치의 발전으로, 최근 인공 지능(Artificial Intelligence, AI) 기술을 탑재한 전자 장치와 관련된 기술 개발이 진행되고 있다. 인공 지능 기술이 적용된 전자 장치는, 외부 신호에 의한 인스트럭션들의 업데이트와 독립적으로, 주변 상황을 스스로 학습하고, 판단할 수 있다. 인공 지능 기술이 적용된 전자 장치가 주변 상황을 능동적으로 학습하고 판단함에 따라, 사람의 판단을 요구하는 상황을 전자 장치에 기반하여 자동적으로 대응하는 것을 가능하게 할 수 있다. 인공 지능 기술을 탑재한 전자 장치는, 인공 지능에 특화된 연산을 수행하기 위한 하드웨어 컴포넌트가 연구되고 있다.
전자 장치가, 인공 지능과 관련된 연산을 보다 효율적으로 수행하는 방안이 요구될 수 있다.
본 문서에서 이루고자 하는 기술적 과제는 상술한 기술적 과제로 제한되지 않으며, 언급되지 않은 또 다른 기술적 과제들은 아래의 기재로부터 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.
일 실시예(an embodiment)에 따른 전자 장치(electronic device)는 연산 회로를 포함할 수 있다. 상기 연산 회로는, 부동 소수점 수(floating point number)를 나타내기 위한 제1 데이터 타입과 상이하고, 정수를 나타내기 위한 제2 데이터 타입의 복수의 정수들(integer numbers)에 기반하는 곱셈 연산(multiplication)을 수행하기 위한 요청을 수신하는 것에 응답하여, 상기 복수의 정수들 중 제1 정수 및 제2 정수를 결합하는 결합기를 포함할 수 있다. 상기 연산 회로는, 상기 제1 데이터 타입에 의해 구별되는 상기 부동 소수점 수의 가수들(mantissas)에 대응하는 비트들의 곱(product)을 획득하기 위한 곱셈기, 상기 복수의 정수들 중 제3 정수가 상기 곱셈기의 제1 포트로 입력되고, 상기 결합기에 의한 상기 제1 정수 및 상기 제2 정수의 결합을 나타내는 제4 정수가 상기 곱셈기의 제2 포트로 입력됨,를 포함할 수 있다. 상기 연산 회로는, 상기 곱셈기의 상기 제1 포트 및 상기 제2 포트와 상이한 제3 포트로부터, 상기 제3 정수 및 상기 제4 정수의 곱을 나타내는 제5 정수를 식별하는 것에 응답하여, 상기 식별된 제5 정수에 기반하여, 상기 제1 정수 및 상기 제3 정수의 곱을 나타내는 제6 정수, 및 상기 제2 정수 및 상기 제3 정수의 곱을 나타내는 제7 정수를 출력하는 변환기(converter)를 포함하는 연산 회로를 포함할 수 있다.
일 실시예에 따른 전자 장치의 방법은, 부동 소수점 수를 나타내기 위한 제1 데이터 타입과 상이하고, 정수를 나타내기 위한 제2 데이터 타입의 복수의 정수들에 기반하는 곱셈 연산을 수행하라는 요청을 수신하는 것에 응답하여, 상기 복수의 정수들 중 제1 정수 및 제2 정수를 결합하는 동작을 포함할 수 있다. 상기 방법은, 상기 제1 데이터 타입에 의해 구별되는 상기 부동 소수점 수의 가수들에 대응하는 비트들의 곱(product)을 획득하기 위한 곱셈기의 제1 포트로, 상기 가수의 비트들의 수에 기반하여 상기 복수의 정수들 중 제3 정수를 송신하는 동작을 포함할 수 있다. 상기 방법은, 상기 제1 포트로 상기 제3 정수를 송신하는 상태에서, 상기 곱셈기의 상기 제1 포트와 구별되는 제2 포트로, 상기 제1 정수 및 상기 제2 정수의 결합을 나타내는 제4 정수를 송신하는 동작을 포함할 수 있다. 상기 방법은, 상기 곱셈기의 상기 제1 포트 및 상기 제2 포트와 상이한 제3 포트로부터, 상기 제3 정수 및 상기 제4 정수의 곱을 나타내는 제5 정수를 식별하는 것에 응답하여, 상기 획득된 제5 정수에 기반하여, 상기 제1 정수 및 상기 제3 정수의 곱을 나타내는 제6 정수 및 상기 제2 정수 및 상기 제3 정수의 곱을 나타내는 제7 정수를 획득하는 동작을 포함할 수 있다.
일 실시예에 따른 전자 장치(electronic device)는, 부동 소수점 수를 나타내기 위한 제1 데이터 타입과 상이하고, 정수를 나타내기 위한 제2 데이터 타입의 복수의 정수들에 기반하는 곱셈 연산을 수행하기 위한 요청을 수신하는 것에 응답하여, 상기 복수의 정수들 중 제1 정수 및 제2 정수를 결합하는 제1 결합기를 포함할 수 있다. 상기 전자 장치는, 상기 요청을 수신하는 것에 응답하여, 상기 복수의 정수들 중 제3 정수 및 제4 정수를 결합하는 제2 결합기를 포함할 수 있다. 상기 전자 장치는, 상기 제1 데이터 타입에 의해 구별되는 상기 부동 소수점 수의 가수들에 대응하는 비트들의 곱을 획득하기 위한 곱셈기, 상기 제1 결합기의 상기 제1 정수 및 상기 제2 정수의 결합을 나타내는 제5 정수가 상기 곱셈기의 제1 포트로 입력되고, 상기 제2 결합기의 상기 제3 정수 및 상기 제4 정수의 결합을 나타내는 제6 정수가 상기 곱셈기의 제2 포트로 입력됨,를 포함할 수 있다. 상기 전자 장치는, 상기 곱셈기의 상기 제1 포트 및 상기 제2 포트와 상이한 제3 포트로부터, 상기 제5 정수 및 상기 제6 정수의 곱을 나타내는 제7 정수를 식별하는 것에 응답하여, 상기 식별된 제7 정수에 기반하여, 상기 제1 정수 또는 상기 제2 정수 중 어느 한 정수 및 상기 제3 정수 또는 상기 제4 정수 중 어느 한 정수의 조합의 곱들을 획득하는 변환기를 포함할 수 있다.
일 실시예에 따른 전자 장치의 방법은, 부동 소수점 수를 나타내기 위한 제1 데이터 타입과 상이하고, 정수를 나타내기 위한 제2 데이터 타입의 복수의 정수들에 기반하는 곱셈 연산을 수행하기 위한 요청을 수신하는 것에 응답하여 상기 복수의 정수들 중 제1 정수 및 제2 정수를 결합하는 동작을 포함할 수 있다. 상기 방법은, 상기 정수를 수신하는 것에 응답하여, 상기 복수의 정수들 중 제3 정수 및 제4 정수를 결합하는 동작을 포함할 수 있다. 상기 방법은, 상기 제1 정수 및 상기 제2 정수의 결합을 나타내는 제5 정수, 및 상기 제3 정수 및 상기 제4 정수의 결합을 나타내는 제6 정수 각각을, 상기 제1 데이터 타입에 의해 구별되는 상기 부동 소수점 수의 가수들에 대응하는 비트들의 곱을 획득하기 위한 곱셈기의 제1 포트 및 제2 포트로 입력하는 동작을 포함할 수 있다. 상기 방법은, 상기 곱셈기의 상기 제1 포트 및 상기 제2 포트와 상이한 제3 포트로부터, 상기 제5 정수 및 상기 제6 정수의 곱을 나타내는 제7 정수를 식별하는 것에 응답하여, 상기 식별된 제7 정수에 기반하여, 상기 제1 정수 또는 상기 제2 정수 중 어느 한 정수 및 상기 제3 정수 또는 상기 제4 정수 중 어느 한 정수의 조합의 곱들을 획득하는 동작을 포함할 수 있다.
일 실시예에 따른, 전자 장치는, 프로세서, 메모리, 및 복수의 레이어들을 가지는 뉴럴 네트워크를 트레이닝하기 위한 뉴럴 엔진을 포함하는 NPU(neural processing unit)를 포함하고, 상기 뉴럴 엔진은, 누적 회로(accumulation circuit), 및 결합기, 곱셈기, 덧셈기, 및 변환기를 포함하는 연산 회로, 상기 변환기는 비트 선택기, 비트 조절기, 스위치, 및 쉬프트 레지스터를 포함함, 및 누적 및 저장하는 컨트롤러를 포함할 수 있다. 상기 컨트롤러는, 상기 누적 회로 내에, 상기 뉴럴 네트워크의 특정 레이어 내에 포함된 노드들에 대응하는 가중 합을 계산하기 위하여 상기 연산 회로의 상이한 채널들로부터 출력된 수치 값들을, 누적, 및 저장할 수 있다. 상기 컨트롤러는 동작 상태에 적어도 부분적으로 기반하여 상기 결합기, 상기 덧셈기, 상기 비트 선택기, 또는 상기 비트 조절기 중 적어도 하나를 선택적으로 활성화할 수 있다.
일 실시예에 따른 전자 장치는 인공 지능과 관련된 연산을 보다 효율적으로 수행할 수 있다.
본 개시에서 얻을 수 있는 효과는 상술한 효과들로 제한되지 않으며, 언급하지 않은 또 다른 효과들은 아래의 기재로부터 본 개시가 속하는 기술 분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.
도 1은, 다양한 실시예들에 따른, 네트워크 환경 내의 전자 장치의 블록도이다.
도 2는 일 실시예에 따른 전자 장치에 포함된 하나 이상의 프로세서들을 설명하기 위한 블록도이다.
도 3은 일 실시예에 따른 전자 장치에서 실행되는 뉴럴 네트워크를 설명하기 위한 예시적인 도면이다.
도 4a 내지 도 4b들은 일 실시예에 따른 전자 장치가 뉴럴 네트워크와 관련된 연산을 수행하기 위한 회로의 구조를 설명하기 위한 예시적인 블록도이다.
도 5는 일 실시예에 따른 전자 장치의 연산 회로의 일 예를 설명하기 위한 블록도이다.
도 6a 내지 도 6c들은 도 5의 연산 회로의 서로 다른 상태들을 설명하기 위한 도면들이다.
도 7은 도 5의 연산 회로에서 부동 소수점 수의 가수(mantissa)와 관련된 곱셈기를 이용하여, 정수들의 곱셈 연산을 수행하는 동작을 설명하기 위한 도면이다.
도 8은 일 실시예에 따른 전자 장치의 연산 회로의 다른 일 예를 설명하기 위한 블록도이다.
도 9a 내지 도 9d들은 도 5의 연산 회로의 서로 다른 상태들을 설명하기 위한 도면들이다.
도 10은 도 8의 연산 회로에서 부동 소수점 수의 가수와 관련된 곱셈기를 이용하여, 정수들의 곱셈 연산을 수행하는 동작을 설명하기 위한 도면이다.
도 11은 일 실시예에 따른 전자 장치가 뉴럴 네트워크에 기반하여 입력 데이터를 처리하는 동작을 설명하기 위한 흐름도이다.
도 12는 일 실시예에 따른 전자 장치가 하나 이상의 뉴럴 엔진들을 제어하는 동작을 설명하기 위한 흐름도이다.
도 13은 일 실시예에 따른 전자 장치가, 상이한 데이터 타입들에 기반하는 연산을 수행하는 동작을 설명하기 위한 흐름도이다.
도 14는 일 실시예에 따른 전자 장치가, 부동 소수점 수의 가수와 관련된 곱셈기로 입력될 하나 이상의 정수들을 획득하기 위하여 수행하는 동작을 설명하기 위한 흐름도이다.
도 15는 일 실시예에 따른 전자 장치가, 연산 회로의 곱셈기로부터 출력된 비트들에 기반하여 수행하는 동작을 설명하기 위한 흐름도이다.
이하, 본 문서의 다양한 실시예들이 첨부된 도면을 참조하여 설명된다.
본 문서의 다양한 실시 예들 및 이에 사용된 용어들은 본 문서에 기재된 기술을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 해당 실시 예의 다양한 변경, 균등물, 및/또는 대체물을 포함하는 것으로 이해되어야 한다. 도면의 설명과 관련하여, 유사한 구성요소에 대해서는 유사한 참조 부호가 사용될 수 있다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함할 수 있다. 본 문서에서, "A 또는 B", "A 및/또는 B 중 적어도 하나", "A, B 또는 C" 또는 "A, B 및/또는 C 중 적어도 하나" 등의 표현은 함께 나열된 항목들의 모든 가능한 조합을 포함할 수 있다. "제 1", "제 2", "첫째" 또는 "둘째" 등의 표현들은 해당 구성요소들을, 순서 또는 중요도에 상관없이 수식할 수 있고, 한 구성요소를 다른 구성요소와 구분하기 위해 사용될 뿐 해당 구성요소들을 한정하지 않는다. 어떤(예: 제 1) 구성요소가 다른(예: 제 2) 구성요소에 "(기능적으로 또는 통신적으로) 연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 상기 어떤 구성요소가 상기 다른 구성요소에 직접적으로 연결되거나, 다른 구성요소(예: 제 3 구성요소)를 통하여 연결될 수 있다.
본 문서에서 사용된 용어 "모듈"은 하드웨어, 소프트웨어 또는 펌웨어로 구성된 유닛을 포함하며, 예를 들면, 로직, 논리 블록, 부품, 또는 회로 등의 용어와 상호 호환적으로 사용될 수 있다. 모듈은, 일체로 구성된 부품 또는 하나 또는 그 이상의 기능을 수행하는 최소 단위 또는 그 일부가 될 수 있다. 예를 들면, 모듈은 ASIC(application-specific integrated circuit)으로 구성될 수 있다.
도 1은, 다양한 실시예들에 따른, 네트워크 환경(100) 내의 전자 장치(101)의 블록도이다. 도 1을 참조하면, 네트워크 환경(100)에서 전자 장치(101)는 제 1 네트워크(198)(예: 근거리 무선 통신 네트워크)를 통하여 전자 장치(102)와 통신하거나, 또는 제 2 네트워크(199)(예: 원거리 무선 통신 네트워크)를 통하여 전자 장치(104) 또는 서버(108) 중 적어도 하나 와 통신할 수 있다. 일실시예에 따르면, 전자 장치(101)는 서버(108)를 통하여 전자 장치(104)와 통신할 수 있다. 일실시예에 따르면, 전자 장치(101)는 프로세서(120), 메모리(130), 입력 모듈(150), 음향 출력 모듈(155), 디스플레이 모듈(160), 오디오 모듈(170), 센서 모듈(176), 인터페이스(177), 연결 단자(178), 햅틱 모듈(179), 카메라 모듈(180), 전력 관리 모듈(188), 배터리(189), 통신 모듈(190), 가입자 식별 모듈(196), 또는 안테나 모듈(197)을 포함할 수 있다. 어떤 실시예에서는, 전자 장치(101)에는, 이 구성요소들 중 적어도 하나(예: 연결 단자(178))가 생략되거나, 하나 이상의 다른 구성요소가 추가될 수 있다. 어떤 실시예에서는, 이 구성요소들 중 일부들(예: 센서 모듈(176), 카메라 모듈(180), 또는 안테나 모듈(197))은 하나의 구성요소(예: 디스플레이 모듈(160))로 통합될 수 있다.
프로세서(120)는, 예를 들면, 소프트웨어(예: 프로그램(140))를 실행하여 프로세서(120)에 연결된 전자 장치(101)의 적어도 하나의 다른 구성요소(예: 하드웨어 또는 소프트웨어 구성요소)를 제어할 수 있고, 다양한 데이터 처리 또는 연산을 수행할 수 있다. 일실시예에 따르면, 데이터 처리 또는 연산의 적어도 일부로서, 프로세서(120)는 다른 구성요소(예: 센서 모듈(176) 또는 통신 모듈(190))로부터 수신된 명령 또는 데이터를 휘발성 메모리(132)에 저장하고, 휘발성 메모리(132)에 저장된 명령 또는 데이터를 처리하고, 결과 데이터를 비휘발성 메모리(134)에 저장할 수 있다. 일실시예에 따르면, 프로세서(120)는 메인 프로세서(121)(예: 중앙 처리 장치 또는 어플리케이션 프로세서) 또는 이와는 독립적으로 또는 함께 운영 가능한 보조 프로세서(123)(예: 그래픽 처리 장치, 신경망 처리 장치(NPU: neural processing unit), 이미지 시그널 프로세서, 센서 허브 프로세서, 또는 커뮤니케이션 프로세서)를 포함할 수 있다. 예를 들어, 전자 장치(101)가 메인 프로세서(121) 및 보조 프로세서(123)를 포함하는 경우, 보조 프로세서(123)는 메인 프로세서(121)보다 저전력을 사용하거나, 지정된 기능에 특화되도록 설정될 수 있다. 보조 프로세서(123)는 메인 프로세서(121)와 별개로, 또는 그 일부로서 구현될 수 있다.
보조 프로세서(123)는, 예를 들면, 메인 프로세서(121)가 인액티브(예: 슬립) 상태에 있는 동안 메인 프로세서(121)를 대신하여, 또는 메인 프로세서(121)가 액티브(예: 어플리케이션 실행) 상태에 있는 동안 메인 프로세서(121)와 함께, 전자 장치(101)의 구성요소들 중 적어도 하나의 구성요소(예: 디스플레이 모듈(160), 센서 모듈(176), 또는 통신 모듈(190))와 관련된 기능 또는 상태들의 적어도 일부를 제어할 수 있다. 일실시예에 따르면, 보조 프로세서(123)(예: 이미지 시그널 프로세서 또는 커뮤니케이션 프로세서)는 기능적으로 관련 있는 다른 구성요소(예: 카메라 모듈(180) 또는 통신 모듈(190))의 일부로서 구현될 수 있다. 일실시예에 따르면, 보조 프로세서(123)(예: 신경망 처리 장치)는 인공지능 모델의 처리에 특화된 하드웨어 구조를 포함할 수 있다. 인공지능 모델은 기계 학습을 통해 생성될 수 있다. 이러한 학습은, 예를 들어, 인공지능 모델이 수행되는 전자 장치(101) 자체에서 수행될 수 있고, 별도의 서버(예: 서버(108))를 통해 수행될 수도 있다. 학습 알고리즘은, 예를 들어, 지도형 학습(supervised learning), 비지도형 학습(unsupervised learning), 준지도형 학습(semi-supervised learning) 또는 강화 학습(reinforcement learning)을 포함할 수 있으나, 전술한 예에 한정되지 않는다. 인공지능 모델은, 복수의 인공 신경망 레이어들을 포함할 수 있다. 인공 신경망은 심층 신경망(DNN: deep neural network), CNN(convolutional neural network), RNN(recurrent neural network), RBM(restricted boltzmann machine), DBN(deep belief network), BRDNN(bidirectional recurrent deep neural network), 심층 Q-네트워크(deep Q-networks) 또는 상기 중 둘 이상의 조합 중 하나일 수 있으나, 전술한 예에 한정되지 않는다. 인공지능 모델은 하드웨어 구조 이외에, 추가적으로 또는 대체적으로, 소프트웨어 구조를 포함할 수 있다.
메모리(130)는, 전자 장치(101)의 적어도 하나의 구성요소(예: 프로세서(120) 또는 센서 모듈(176))에 의해 사용되는 다양한 데이터를 저장할 수 있다. 데이터는, 예를 들어, 소프트웨어(예: 프로그램(140)) 및, 이와 관련된 명령에 대한 입력 데이터 또는 출력 데이터를 포함할 수 있다. 메모리(130)는, 휘발성 메모리(132) 또는 비휘발성 메모리(134)를 포함할 수 있다.
프로그램(140)은 메모리(130)에 소프트웨어로서 저장될 수 있으며, 예를 들면, 운영 체제(142), 미들 웨어(144) 또는 어플리케이션(146)을 포함할 수 있다.
입력 모듈(150)은, 전자 장치(101)의 구성요소(예: 프로세서(120))에 사용될 명령 또는 데이터를 전자 장치(101)의 외부(예: 사용자)로부터 수신할 수 있다. 입력 모듈(150)은, 예를 들면, 마이크, 마우스, 키보드, 키(예: 버튼), 또는 디지털 펜(예: 스타일러스 펜)을 포함할 수 있다.
음향 출력 모듈(155)은 음향 신호를 전자 장치(101)의 외부로 출력할 수 있다. 음향 출력 모듈(155)은, 예를 들면, 스피커 또는 리시버를 포함할 수 있다. 스피커는 멀티미디어 재생 또는 녹음 재생과 같이 일반적인 용도로 사용될 수 있다. 리시버는 착신 전화를 수신하기 위해 사용될 수 있다. 일실시예에 따르면, 리시버는 스피커와 별개로, 또는 그 일부로서 구현될 수 있다.
디스플레이 모듈(160)은 전자 장치(101)의 외부(예: 사용자)로 정보를 시각적으로 제공할 수 있다. 디스플레이 모듈(160)은, 예를 들면, 디스플레이, 홀로그램 장치, 또는 프로젝터 및 해당 장치를 제어하기 위한 제어 회로를 포함할 수 있다. 일실시예에 따르면, 디스플레이 모듈(160)은 터치를 감지하도록 설정된 터치 센서, 또는 상기 터치에 의해 발생되는 힘의 세기를 측정하도록 설정된 압력 센서를 포함할 수 있다.
오디오 모듈(170)은 소리를 전기 신호로 변환시키거나, 반대로 전기 신호를 소리로 변환시킬 수 있다. 일실시예에 따르면, 오디오 모듈(170)은, 입력 모듈(150)을 통해 소리를 획득하거나, 음향 출력 모듈(155), 또는 전자 장치(101)와 직접 또는 무선으로 연결된 외부 전자 장치(예: 전자 장치(102))(예: 스피커 또는 헤드폰)를 통해 소리를 출력할 수 있다.
센서 모듈(176)은 전자 장치(101)의 작동 상태(예: 전력 또는 온도), 또는 외부의 환경 상태(예: 사용자 상태)를 감지하고, 감지된 상태에 대응하는 전기 신호 또는 데이터 값을 생성할 수 있다. 일실시예에 따르면, 센서 모듈(176)은, 예를 들면, 제스처 센서, 자이로 센서, 기압 센서, 마그네틱 센서, 가속도 센서, 그립 센서, 근접 센서, 컬러 센서, IR(infrared) 센서, 생체 센서, 온도 센서, 습도 센서, 또는 조도 센서를 포함할 수 있다.
인터페이스(177)는 전자 장치(101)가 외부 전자 장치(예: 전자 장치(102))와 직접 또는 무선으로 연결되기 위해 사용될 수 있는 하나 이상의 지정된 프로토콜들을 지원할 수 있다. 일실시예에 따르면, 인터페이스(177)는, 예를 들면, HDMI(high definition multimedia interface), USB(universal serial bus) 인터페이스, SD카드 인터페이스, 또는 오디오 인터페이스를 포함할 수 있다.
연결 단자(178)는, 그를 통해서 전자 장치(101)가 외부 전자 장치(예: 전자 장치(102))와 물리적으로 연결될 수 있는 커넥터를 포함할 수 있다. 일실시예에 따르면, 연결 단자(178)는, 예를 들면, HDMI 커넥터, USB 커넥터, SD 카드 커넥터, 또는 오디오 커넥터(예: 헤드폰 커넥터)를 포함할 수 있다.
햅틱 모듈(179)은 전기적 신호를 사용자가 촉각 또는 운동 감각을 통해서 인지할 수 있는 기계적인 자극(예: 진동 또는 움직임) 또는 전기적인 자극으로 변환할 수 있다. 일실시예에 따르면, 햅틱 모듈(179)은, 예를 들면, 모터, 압전 소자, 또는 전기 자극 장치를 포함할 수 있다.
카메라 모듈(180)은 정지 영상 및 동영상을 촬영할 수 있다. 일실시예에 따르면, 카메라 모듈(180)은 하나 이상의 렌즈들, 이미지 센서들, 이미지 시그널 프로세서들, 또는 플래시들을 포함할 수 있다.
전력 관리 모듈(188)은 전자 장치(101)에 공급되는 전력을 관리할 수 있다. 일실시예에 따르면, 전력 관리 모듈(188)은, 예를 들면, PMIC(power management integrated circuit)의 적어도 일부로서 구현될 수 있다.
배터리(189)는 전자 장치(101)의 적어도 하나의 구성요소에 전력을 공급할 수 있다. 일실시예에 따르면, 배터리(189)는, 예를 들면, 재충전 불가능한 1차 전지, 재충전 가능한 2차 전지 또는 연료 전지를 포함할 수 있다.
통신 모듈(190)은 전자 장치(101)와 외부 전자 장치(예: 전자 장치(102), 전자 장치(104), 또는 서버(108)) 간의 직접(예: 유선) 통신 채널 또는 무선 통신 채널의 수립, 및 수립된 통신 채널을 통한 통신 수행을 지원할 수 있다. 통신 모듈(190)은 프로세서(120)(예: 어플리케이션 프로세서)와 독립적으로 운영되고, 직접(예: 유선) 통신 또는 무선 통신을 지원하는 하나 이상의 커뮤니케이션 프로세서를 포함할 수 있다. 일실시예에 따르면, 통신 모듈(190)은 무선 통신 모듈(192)(예: 셀룰러 통신 모듈, 근거리 무선 통신 모듈, 또는 GNSS(global navigation satellite system) 통신 모듈) 또는 유선 통신 모듈(194)(예: LAN(local area network) 통신 모듈, 또는 전력선 통신 모듈)을 포함할 수 있다. 이들 통신 모듈 중 해당하는 통신 모듈은 제 1 네트워크(198)(예: 블루투스, WiFi(wireless fidelity) direct 또는 IrDA(infrared data association)와 같은 근거리 통신 네트워크) 또는 제 2 네트워크(199)(예: 레거시 셀룰러 네트워크, 5G 네트워크, 차세대 통신 네트워크, 인터넷, 또는 컴퓨터 네트워크(예: LAN 또는 WAN)와 같은 원거리 통신 네트워크)를 통하여 외부의 전자 장치(104)와 통신할 수 있다. 이런 여러 종류의 통신 모듈들은 하나의 구성요소(예: 단일 칩)로 통합되거나, 또는 서로 별도의 복수의 구성요소들(예: 복수 칩들)로 구현될 수 있다. 무선 통신 모듈(192)은 가입자 식별 모듈(196)에 저장된 가입자 정보(예: 국제 모바일 가입자 식별자(IMSI))를 이용하여 제 1 네트워크(198) 또는 제 2 네트워크(199)와 같은 통신 네트워크 내에서 전자 장치(101)를 확인 또는 인증할 수 있다.
무선 통신 모듈(192)은 4G 네트워크 이후의 5G 네트워크 및 차세대 통신 기술, 예를 들어, NR 접속 기술(new radio access technology)을 지원할 수 있다. NR 접속 기술은 고용량 데이터의 고속 전송(eMBB(enhanced mobile broadband)), 단말 전력 최소화와 다수 단말의 접속(mMTC(massive machine type communications)), 또는 고신뢰도와 저지연(URLLC(ultra-reliable and low-latency communications))을 지원할 수 있다. 무선 통신 모듈(192)은, 예를 들어, 높은 데이터 전송률 달성을 위해, 고주파 대역(예: mmWave 대역)을 지원할 수 있다. 무선 통신 모듈(192)은 고주파 대역에서의 성능 확보를 위한 다양한 기술들, 예를 들어, 빔포밍(beamforming), 거대 배열 다중 입출력(massive MIMO(multiple-input and multiple-output)), 전차원 다중입출력(FD-MIMO: full dimensional MIMO), 어레이 안테나(array antenna), 아날로그 빔형성(analog beam-forming), 또는 대규모 안테나(large scale antenna)와 같은 기술들을 지원할 수 있다. 무선 통신 모듈(192)은 전자 장치(101), 외부 전자 장치(예: 전자 장치(104)) 또는 네트워크 시스템(예: 제 2 네트워크(199))에 규정되는 다양한 요구사항을 지원할 수 있다. 일실시예에 따르면, 무선 통신 모듈(192)은 eMBB 실현을 위한 Peak data rate(예: 20Gbps 이상), mMTC 실현을 위한 손실 Coverage(예: 164dB 이하), 또는 URLLC 실현을 위한 U-plane latency(예: 다운링크(DL) 및 업링크(UL) 각각 0.5ms 이하, 또는 라운드 트립 1ms 이하)를 지원할 수 있다.
안테나 모듈(197)은 신호 또는 전력을 외부(예: 외부의 전자 장치)로 송신하거나 외부로부터 수신할 수 있다. 일실시예에 따르면, 안테나 모듈(197)은 서브스트레이트(예: PCB) 위에 형성된 도전체 또는 도전성 패턴으로 이루어진 방사체를 포함하는 안테나를 포함할 수 있다. 일실시예에 따르면, 안테나 모듈(197)은 복수의 안테나들(예: 어레이 안테나)을 포함할 수 있다. 이런 경우, 제 1 네트워크(198) 또는 제 2 네트워크(199)와 같은 통신 네트워크에서 사용되는 통신 방식에 적합한 적어도 하나의 안테나가, 예를 들면, 통신 모듈(190)에 의하여 상기 복수의 안테나들로부터 선택될 수 있다. 신호 또는 전력은 상기 선택된 적어도 하나의 안테나를 통하여 통신 모듈(190)과 외부의 전자 장치 간에 송신되거나 수신될 수 있다. 어떤 실시예에 따르면, 방사체 이외에 다른 부품(예: RFIC(radio frequency integrated circuit))이 추가로 안테나 모듈(197)의 일부로 형성될 수 있다.
다양한 실시예에 따르면, 안테나 모듈(197)은 mmWave 안테나 모듈을 형성할 수 있다. 일실시예에 따르면, mmWave 안테나 모듈은 인쇄 회로 기판, 상기 인쇄 회로 기판의 제 1 면(예: 아래 면)에 또는 그에 인접하여 배치되고 지정된 고주파 대역(예: mmWave 대역)을 지원할 수 있는 RFIC, 및 상기 인쇄 회로 기판의 제 2 면(예: 윗 면 또는 측 면)에 또는 그에 인접하여 배치되고 상기 지정된 고주파 대역의 신호를 송신 또는 수신할 수 있는 복수의 안테나들(예: 어레이 안테나)을 포함할 수 있다.
상기 구성요소들 중 적어도 일부는 주변 기기들간 통신 방식(예: 버스, GPIO(general purpose input and output), SPI(serial peripheral interface), 또는 MIPI(mobile industry processor interface))을 통해 서로 연결되고 신호(예: 명령 또는 데이터)를 상호간에 교환할 수 있다.
일실시예에 따르면, 명령 또는 데이터는 제 2 네트워크(199)에 연결된 서버(108)를 통해서 전자 장치(101)와 외부의 전자 장치(104)간에 송신 또는 수신될 수 있다. 외부의 전자 장치(102, 또는 104) 각각은 전자 장치(101)와 동일한 또는 다른 종류의 장치일 수 있다. 일실시예에 따르면, 전자 장치(101)에서 실행되는 동작들의 전부 또는 일부는 외부의 전자 장치들(102, 104, 또는 108) 중 하나 이상의 외부의 전자 장치들에서 실행될 수 있다. 예를 들면, 전자 장치(101)가 어떤 기능이나 서비스를 자동으로, 또는 사용자 또는 다른 장치로부터의 요청에 반응하여 수행해야 할 경우에, 전자 장치(101)는 기능 또는 서비스를 자체적으로 실행시키는 대신에 또는 추가적으로, 하나 이상의 외부의 전자 장치들에게 그 기능 또는 그 서비스의 적어도 일부를 수행하라고 요청할 수 있다. 상기 요청을 수신한 하나 이상의 외부의 전자 장치들은 요청된 기능 또는 서비스의 적어도 일부, 또는 상기 요청과 관련된 추가 기능 또는 서비스를 실행하고, 그 실행의 결과를 전자 장치(101)로 전달할 수 있다. 전자 장치(101)는 상기 결과를, 그대로 또는 추가적으로 처리하여, 상기 요청에 대한 응답의 적어도 일부로서 제공할 수 있다. 이를 위하여, 예를 들면, 클라우드 컴퓨팅, 분산 컴퓨팅, 모바일 에지 컴퓨팅(MEC: mobile edge computing), 또는 클라이언트-서버 컴퓨팅 기술이 이용될 수 있다. 전자 장치(101)는, 예를 들어, 분산 컴퓨팅 또는 모바일 에지 컴퓨팅을 이용하여 초저지연 서비스를 제공할 수 있다. 다른 실시예에 있어서, 외부의 전자 장치(104)는 IoT(internet of things) 기기를 포함할 수 있다. 서버(108)는 기계 학습 및/또는 신경망을 이용한 지능형 서버일 수 있다. 일실시예에 따르면, 외부의 전자 장치(104) 또는 서버(108)는 제 2 네트워크(199) 내에 포함될 수 있다. 전자 장치(101)는 5G 통신 기술 및 IoT 관련 기술을 기반으로 지능형 서비스(예: 스마트 홈, 스마트 시티, 스마트 카, 또는 헬스 케어)에 적용될 수 있다.
본 문서에 개시된 다양한 실시예들에 따른 전자 장치는 다양한 형태의 장치가 될 수 있다. 전자 장치는, 예를 들면, 휴대용 통신 장치(예: 스마트폰), 컴퓨터 장치, 휴대용 멀티미디어 장치, 휴대용 의료 기기, 카메라, 웨어러블 장치, 또는 가전 장치를 포함할 수 있다. 본 문서의 실시예에 따른 전자 장치는 전술한 기기들에 한정되지 않는다.
본 문서의 다양한 실시예들 및 이에 사용된 용어들은 본 문서에 기재된 기술적 특징들을 특정한 실시예들로 한정하려는 것이 아니며, 해당 실시예의 다양한 변경, 균등물, 또는 대체물을 포함하는 것으로 이해되어야 한다. 도면의 설명과 관련하여, 유사한 또는 관련된 구성요소에 대해서는 유사한 참조 부호가 사용될 수 있다. 아이템에 대응하는 명사의 단수 형은 관련된 문맥상 명백하게 다르게 지시하지 않는 한, 상기 아이템 한 개 또는 복수 개를 포함할 수 있다. 본 문서에서, "A 또는 B", "A 및 B 중 적어도 하나", "A 또는 B 중 적어도 하나", "A, B 또는 C", "A, B 및 C 중 적어도 하나", 및 "A, B, 또는 C 중 적어도 하나"와 같은 문구들 각각은 그 문구들 중 해당하는 문구에 함께 나열된 항목들 중 어느 하나, 또는 그들의 모든 가능한 조합을 포함할 수 있다. "제 1", "제 2", 또는 "첫째" 또는 "둘째"와 같은 용어들은 단순히 해당 구성요소를 다른 해당 구성요소와 구분하기 위해 사용될 수 있으며, 해당 구성요소들을 다른 측면(예: 중요성 또는 순서)에서 한정하지 않는다. 어떤(예: 제 1) 구성요소가 다른(예: 제 2) 구성요소에, "기능적으로" 또는 "통신적으로"라는 용어와 함께 또는 이런 용어 없이, "커플드" 또는 "커넥티드"라고 언급된 경우, 그것은 상기 어떤 구성요소가 상기 다른 구성요소에 직접적으로(예: 유선으로), 무선으로, 또는 제 3 구성요소를 통하여 연결될 수 있다는 것을 의미한다.
본 문서의 다양한 실시예들에서 사용된 용어 "모듈"은 하드웨어, 소프트웨어 또는 펌웨어로 구현된 유닛을 포함할 수 있으며, 예를 들면, 로직, 논리 블록, 부품, 또는 회로와 같은 용어와 상호 호환적으로 사용될 수 있다. 모듈은, 일체로 구성된 부품 또는 하나 또는 그 이상의 기능을 수행하는, 상기 부품의 최소 단위 또는 그 일부가 될 수 있다. 예를 들면, 일실시예에 따르면, 모듈은 ASIC(application-specific integrated circuit)의 형태로 구현될 수 있다.
본 문서의 다양한 실시예들은 기기(machine)(예: 전자 장치(101)) 의해 읽을 수 있는 저장 매체(storage medium)(예: 내장 메모리(136) 또는 외장 메모리(138))에 저장된 하나 이상의 명령어들을 포함하는 소프트웨어(예: 프로그램(140))로서 구현될 수 있다. 예를 들면, 기기(예: 전자 장치(101))의 프로세서(예: 프로세서(120))는, 저장 매체로부터 저장된 하나 이상의 명령어들 중 적어도 하나의 명령을 호출하고, 그것을 실행할 수 있다. 이것은 기기가 상기 호출된 적어도 하나의 명령어에 따라 적어도 하나의 기능을 수행하도록 운영되는 것을 가능하게 한다. 상기 하나 이상의 명령어들은 컴파일러에 의해 생성된 코드 또는 인터프리터에 의해 실행될 수 있는 코드를 포함할 수 있다. 기기로 읽을 수 있는 저장 매체는, 비일시적(non-transitory) 저장 매체의 형태로 제공될 수 있다. 여기서, '비일시적'은 저장 매체가 실재(tangible)하는 장치이고, 신호(signal)(예: 전자기파)를 포함하지 않는다는 것을 의미할 뿐이며, 이 용어는 데이터가 저장 매체에 반영구적으로 저장되는 경우와 임시적으로 저장되는 경우를 구분하지 않는다.
일실시예에 따르면, 본 문서에 개시된 다양한 실시예들에 따른 방법은 컴퓨터 프로그램 제품(computer program product)에 포함되어 제공될 수 있다. 컴퓨터 프로그램 제품은 상품으로서 판매자 및 구매자 간에 거래될 수 있다. 컴퓨터 프로그램 제품은 기기로 읽을 수 있는 저장 매체(예: compact disc read only memory(CD-ROM))의 형태로 배포되거나, 또는 어플리케이션 스토어(예: 플레이 스토어쪠)를 통해 또는 두 개의 사용자 장치들(예: 스마트 폰들) 간에 직접, 온라인으로 배포(예: 다운로드 또는 업로드)될 수 있다. 온라인 배포의 경우에, 컴퓨터 프로그램 제품의 적어도 일부는 제조사의 서버, 어플리케이션 스토어의 서버, 또는 중계 서버의 메모리와 같은 기기로 읽을 수 있는 저장 매체에 적어도 일시 저장되거나, 임시적으로 생성될 수 있다.
다양한 실시예들에 따르면, 상기 기술한 구성요소들의 각각의 구성요소(예: 모듈 또는 프로그램)는 단수 또는 복수의 개체를 포함할 수 있으며, 복수의 개체 중 일부는 다른 구성요소에 분리 배치될 수도 있다. 다양한 실시예들에 따르면, 전술한 해당 구성요소들 중 하나 이상의 구성요소들 또는 동작들이 생략되거나, 또는 하나 이상의 다른 구성요소들 또는 동작들이 추가될 수 있다. 대체적으로 또는 추가적으로, 복수의 구성요소들(예: 모듈 또는 프로그램)은 하나의 구성요소로 통합될 수 있다. 이런 경우, 통합된 구성요소는 상기 복수의 구성요소들 각각의 구성요소의 하나 이상의 기능들을 상기 통합 이전에 상기 복수의 구성요소들 중 해당 구성요소에 의해 수행되는 것과 동일 또는 유사하게 수행할 수 있다. 다양한 실시예들에 따르면, 모듈, 프로그램 또는 다른 구성요소에 의해 수행되는 동작들은 순차적으로, 병렬적으로, 반복적으로, 또는 휴리스틱하게 실행되거나, 상기 동작들 중 하나 이상이 다른 순서로 실행되거나, 생략되거나, 또는 하나 이상의 다른 동작들이 추가될 수 있다.
도 2는 일 실시예에 따른 전자 장치(101)에 포함된 하나 이상의 프로세서들을 설명하기 위한 블록도이다. 도 2의 전자 장치(101)는 도 1의 전자 장치(101)에 대응할 수 있다.
도 2를 참고하면, 일 실시예에 따른 전자 장치(101)는 프로세서(120), NPU(210), GPU(220) 또는 메모리(130) 중 적어도 하나를 포함할 수 있다. 프로세서(120), NPU(210), GPU(220) 및 메모리(130)는 통신 버스(a communication bus)(230)와 같은 전자 소자(electronical component)에 의해 서로 전기적으로 및/또는 작동적으로 연결될 수 있다(electronically and/or operably coupled with each other). 전자 장치(101)에 포함된 하드웨어 컴포넌트의 타입 및/또는 개수는 도 2에 도시된 바에 제한되지 않으며, 예를 들어, 전자 장치(101)는 도 1의 디스플레이 모듈(160), 통신 모듈(190)을 더 포함할 수 있다.
일 실시예에 따른 전자 장치(101)의 프로세서(120)는 하나 이상의 인스트럭션에 기반하여 데이터를 처리하기 위한 하드웨어 컴포넌트를 포함할 수 있다. 데이터를 처리하기 위한 하드웨어 컴포넌트는, 예를 들어, ALU(Arithmetic and Logic Unit), FPU(Floating Point Unit) 및/또는 FPGA(Field Programmable Gate Array)를 포함할 수 있다. 일 실시예에서 프로세서(120)는 AP(Application Processor)로 참조될 수 있다. 프로세서(120)의 개수는 하나 이상일 수 있다. 예를 들어, 프로세서(120)는 듀얼 코어(dual core), 쿼드 코어(quad core) 또는 헥사 코어(hexa core)와 같은 멀티-코어 프로세서의 구조를 가질 수 있다. 도 2의 프로세서(120)는 도 1의 프로세서(120) 및/또는 메인 프로세서(121)의 일 예에 대응할 수 있다.
일 실시예에 따른 전자 장치(101)의 GPU(220)는 컴퓨터 그래픽과 관련된 인스트럭션의 실행에 필요한 복수의 동작을 수행하는 파이프라인을 하나 이상 포함할 수 있다. 예를 들어, GPU(220)의 파이프라인은, 3차원 이미지를 생성하고, 생성된 3차원 이미지로부터 2차원 래스터 이미지를 생성하기 위한 그래픽스 파이프라인(graphics pipeline) 또는 렌더링 파이프라인(rendering pipeline)을 포함할 수 있다. 그래픽스 파이프라인은, 메모리(130)에 저장된 파일에 포함되고, 셰이딩 언어(shading language)로 작성된 코드에 기반하여 제어될 수 있다. 예를 들어, 셰이딩 언어로 작성된 코드가, 프로세서(120)에 의해 GPU(220)에서 실행 가능한 인스트럭션으로 컴파일될 수 있다.
일 실시예에 따른 전자 장치(101)의 NPU(210)는 뉴럴 네트워크에 기반하는 하나 이상의 기능들을 지원하기 위한 하드웨어 컴포넌트를 포함할 수 있다. 뉴럴 네트워크는, 많은 수의 인공 뉴런(또는, 노드)들을 이용하여 생물학적인 시스템의 계산 능력을 모방하는 소프트웨어나 하드웨어로 구현된 인식 모델이다. 예를 들어, 일 실시예에 따른 전자 장치(101)는 뉴럴 네트워크에 기반하여, 인간의 인지 작용이나 학습 과정과 유사한 기능들을 실행할 수 있다. 일 실시예에서, NPU(210)에 의해 지원되는, 상기 뉴럴 네트워크에 기반하는 하나 이상의 기능들은, 뉴럴 네트워크를 트레이닝하는 기능, 트레이닝된 뉴럴 네트워크를 이용하여 영상 인식, 음성 인식 및/또는 필기 인식을 수행하는 기능, 뉴럴 네트워크에 기반하는, 전자 장치(101)의 사용자에게 개인화된 기능, API(Application Programming Interface)를 이용하여 어플리케이션에 기반하는 뉴럴 네트워크를 제어하는 기능을 포함할 수 있다.
도 2의 프로세서(120), NPU(210) 및 GPU(220) 각각은 전자 장치(101)에서 상이한 집적 회로들(Integrated Circuits)로써 포함되거나, 또는 SoC(System on Chip)에 기반하는 단일 집적 회로(single IC)에 포함될 수 있다. 예를 들어, 프로세서(120), NPU(210), GPU(220) 또는 이들의 조합이 전자 장치(101)에 포함된 단일 집적 회로 내에 포함될 수 있다. SoC에 기반하여 포함되는 처리 유닛(processing unit)의 타입은 상기 예시에 제한되지 않으며, 예를 들어, 도 2에 도시되지 않은 다른 하드웨어 컴포넌트(예, 커뮤니케이션 프로세서)가 프로세서(120), NPU(210) 및 GPU(220)와 함께 단일 집적 회로 내에 포함될 수 있다.
일 실시예에 따른 전자 장치(101)의 메모리(130)는 프로세서(120), NPU(210) 및/또는 GPU(220)에 입력 및/또는 출력되는 데이터 및/또는 인스트럭션을 저장하기 위한 하드웨어 컴포넌트를 포함할 수 있다. 메모리(130)는, 예를 들어, RAM(Random-Access Memory)와 같은 휘발성 메모리(Volatile Memory)(132) 및/또는 ROM(Read-Only Memory)와 같은 비휘발성 메모리(Non-Volatile Memory)(134)를 포함할 수 있다. 휘발성 메모리(132)는, 예를 들어, DRAM(Dynamic RAM), SRAM(Static RAM), Cache RAM, PSRAM (Pseudo SRAM) 중 적어도 하나를 포함할 수 있다. 비휘발성 메모리(134)는, 예를 들어, PROM(Programmable ROM), EPROM (Erasable PROM), EEPROM (Electrically Erasable PROM), 플래시 메모리, 하드디스크, 컴팩트 디스크, eMMC(Embedded Multi Media Card) 중 적어도 하나를 포함할 수 있다. 도 2의 메모리(130), 휘발성 메모리(132) 및 비휘발성 메모리(134)는, 도 1의 메모리(130), 휘발성 메모리(132) 및 비휘발성 메모리(134) 각각에 대응할 수 있다.
일 실시예에 따른 전자 장치(101)의 메모리(130) 내에, NPU(210)에 의해 처리될 뉴럴 네트워크를 나타내는 파라미터들의 집합이 저장될 수 있다. 뉴럴 네트워크를 나타내는 파라미터들은, 예를 들어, 뉴럴 네트워크에 포함된 복수의 노드들, 상기 복수의 노드들 사이의 연결에 할당되는(assigned) 가중치, 상기 뉴럴 네트워크의 레이어들의 개수, 바이어스(bias), 및/또는 이들의 곱, 및/또는 결합을 나타낼 수 있다. 일 실시예에 따른 전자 장치(101)의 메모리(130) 내에 저장된 파라미터들의 집합에 의해 나타나는 뉴럴 네트워크의 구조는 도 3을 참고하여 후술된다.
도 2를 참고하면, 일 실시예에 따른 전자 장치(101)의 NPU(210)에 포함된 하나 이상의 하드웨어 컴포넌트들이 도시된다. 예를 들어, NPU(210)는 뉴럴 엔진(240), 버퍼(250) 및/또는 컨트롤러(260)를 포함할 수 있다. 비록 도시되지 않았지만, 뉴럴 엔진(240), 버퍼(250) 및 컨트롤러(260)는 통신 버스와 같은 전자 소자에 의해 서로 전기적으로 및/또는 작동적으로 연결될 수 있다.
일 실시예에 따른 NPU(210)의 뉴럴 엔진(240)은, 뉴럴 네트워크와 관련된 기능을 실행하기 위해 요구되는 연산을 수행하기 위한 회로를 포함할 수 있다. 뉴럴 엔진(240)의 예시적인 구조가, 도 4a 내지 도 4b를 참고하여 후술된다. 도 2를 참고하면, NPU(210)에 포함된 뉴럴 엔진(240)의 개수는, 도 2의 제1 뉴럴 엔진(240-1) 내지 제m 뉴럴 엔진(240-m)과 같이, 하나 이상일 수 있다.
일 실시예에 따른 NPU(210)의 버퍼(250)는, 뉴럴 엔진(240)에 연결되어, 뉴럴 엔진(240)의 연산을 수행하기 위하여 뉴럴 엔진(240)으로 입력될 하나 이상의 수치 값들(numeric values), 또는 뉴럴 엔진(240)으로부터 출력된 하나 이상의 수치 값들을 적어도 일시적으로(at least temporarily) 저장할 수 있다. 도 2를 참고하면, 뉴럴 엔진(240)에 포함된 하나 이상의 뉴럴 엔진들이, 뉴럴 엔진(240)의 버퍼(250)를 공유할 수 있다.
일 실시예에 따른 NPU(210)의 컨트롤러(260)는, NPU(210)에 포함된 뉴럴 엔진(240)에 기반하는 연산을 제어할 수 있다. 예를 들어, 컨트롤러(260)는, 프로세서(120)로부터 뉴럴 네트워크에 기반하는 기능을 실행하라는 요청을 수신하는 것에 응답하여, 메모리(130)로부터 상기 뉴럴 네트워크를 나타내는 하나 이상의 파라미터들을 획득할 수 있다. 컨트롤러(260)는 획득된 하나 이상의 파라미터들을 NPU(210)에 포함된 뉴럴 엔진들 중 적어도 하나에 입력할 수 있다. 컨트롤러(260)는 뉴럴 엔진들 중 적어도 하나에 입력된 파라미터들에 기반하는 연산의 실행을 제어할 수 있다. 일 실시예에 따른 NPU(210)의 컨트롤러(260)의 동작은 도 11을 참고하여 후술된다.
일 실시예에서, 뉴럴 엔진(240)은 복수의 수치 값들 사이의 이진 산술 연산(binary arithmetic operation)을 수행하기 위한 회로를 포함할 수 있다. 상기 이진 산술 연산은, 상기 복수의 수치 값들 각각을 나타내는 비트들에 기반하는 덧셈 연산, 뺄셈 연산, 곱셈 연산 및/또는 나눗셈 연산을 포함할 수 있다.
일 실시예에 따른 전자 장치(101)는 복수의 데이터 타입들(data types)에 기반하여, 하나 이상의 비트들로부터 특정 수치 값을 식별할 수 있다. 데이터 타입은, 전자 장치(101)에 의한 하나 이상의 비트들의 해석을 위해 사전에 정의된(predetermined) 카테고리이다. 예를 들어, 전자 장치(101)는 하나 이상의 비트들의 집합을, 상기 집합에 대응하는 데이터 타입에 기반하여 해석하여, 상기 집합에 의해 나타내어지는 데이터를 식별할 수 있다. 예를 들어, 전자 장치(101)가 메모리(130) 내에 특정 수치 값을 나타내는 하나 이상의 비트들을 저장하는 경우, 메모리(130) 내에서, 상기 특정 수치 값에 대응하는 비트들의 수가 데이터 타입에 따라 차별화될 수 있다(may be differentiated).
일 실시예에 따른 NPU(210)의 뉴럴 엔진(240)은 복수의 데이터 타입들(data types) 각각에 대한 이진 산술 연산을 지원할 수 있다. 뉴럴 엔진(240)이 복수의 데이터 타입들의 이진 산술 연산을 지원함에 따라, 버퍼(250)가 보다 효율적으로 관리될 수 있다. 이하에서, 복수의 데이터 타입들은 상이한 정밀도들(precisions)을 가질 수 있다. 일 실시예에 따른 NPU(210)의 뉴럴 엔진(240)이 복수의 데이터 타입들의 이진 산술 연산을 지원함에 따라, 뉴럴 엔진(240)은 복수의 정밀도들의 이진 산술 연산을 지원할 수 있다.
상술한 바와 같이, 일 실시예에 따른 NPU(210)의 뉴럴 엔진(240) 및 뉴럴 엔진(240)에 포함된 회로가 복수의 데이터 타입들에 기반하는 이진 산술 연산의 수행을 지원함에 따라, NPU(210)의 버퍼(250) 및 전자 장치(101)의 메모리(130)가 보다 효율적으로 관리될 수 있다. 예를 들어, NPU(210) 및 메모리(130) 사이에서 교환되는 데이터의 크기가, 뉴럴 엔진(240)에 의해 지원되는 복수의 데이터 타입들에 따라 차별화될 수 있다. 상기 데이터의 크기가 차별화됨에 따라, 메모리(130)의 대역폭이 보다 효율적으로 관리될 수 있다.
이하에서는 도 3을 참고하여, 일 실시예에 따른 전자 장치(101)가 NPU(210)에 기반하여 식별하는 뉴럴 네트워크의 일 예가 설명된다.
도 3은 일 실시예에 따른 전자 장치에서 실행되는 뉴럴 네트워크(300)를 설명하기 위한 예시적인 도면이다. 도 3의 전자 장치는 도 1 및/또는 도 2의 전자 장치(101)의 일 예에 대응할 수 있다. 도 3의 뉴럴 네트워크(300)는, 예를 들어, 일 실시예에 따른 전자 장치에 의하여 메모리(예, 도 1 및/또는 도 2의 메모리(130)) 내에 저장된 파라미터들의 집합으로부터 획득될 수 있다.
도 3을 참고하면, 뉴럴 네트워크(300)는 복수의 레이어들을 포함할 수 있다. 예를 들어, 뉴럴 네트워크(300)는 입력 레이어(310), 하나 이상의 히든 레이어들(320) 및 출력 레이어(330)를 포함할 수 있다. 입력 레이어(310)는 뉴럴 네트워크(300)의 입력 데이터를 나타내는 벡터 및/또는 매트릭스에 대응할 수 있다. 예를 들어, 입력 데이터를 나타내는 벡터는, 입력 레이어(310)에 포함된 노드들의 개수에 대응하는 원소들(elements)을 가질 수 있다. 예를 들어, 입력 데이터를 나타내는 매트릭스에 포함된 원소들은, 입력 레이어(310)에 포함된 노드들 각각에 대응할 수 있다. 입력 데이터에 의해 발생된, 입력 레이어(310) 내 노드들 각각에서 발생된 신호들은, 입력 레이어(310)에서 히든 레이어들(320)로 송신될 수 있다. 출력 레이어(330)는, 히든 레이어들(320)로부터 수신된 하나 이상의 신호들에 기반하여, 뉴럴 네트워크(300)의 출력 데이터를 생성할 수 있다. 상기 출력 데이터는, 예를 들어, 출력 레이어(330)에 포함된 노드들의 개수에 대응하는 원소들을 가지는 벡터 및/또는 매트릭스에 대응할 수 있다.
일 실시예에서, 뉴럴 네트워크(300)에 포함된 복수의 레이어들 중 특정 레이어에 포함된 제1 노드들은, 상기 복수의 레이어들의 시퀀스 내에서 상기 특정 레이어의 이전 레이어의 제2 노드들 중 적어도 하나의 가중합(weighted sum)에 대응할 수 있다. 일 실시예에 따른 전자 장치(101)는 메모리 내에 저장된 파라미터들의 집합으로부터, 상기 제2 노드들 중 적어도 하나에 적용될 가중치를 식별할 수 있다. 뉴럴 네트워크(300)를 트레이닝 하는 것은, 상기 가중합과 관련된 하나 이상의 가중치들을 변경 및/또는 결정하는 동작을 포함할 수 있다.
도 3을 참고하면, 하나 이상의 히든 레이어들(320)이 입력 레이어(310) 및 출력 레이어(330) 사이에 위치할 수 있고, 입력 레이어(310)를 통해 전달된 입력 데이터를 예측하기 쉬운 값으로 변환할 수 있다. 입력 레이어(310), 하나 이상의 히든 레이어들(320) 및 출력 레이어(330)는 복수의 노드들을 포함할 수 있다. 하나 이상의 히든 레이어들(320)은 CNN(convolutional neural network)에서의 콘볼루션 필터(convolution filter) 또는 완전 연결 레이어(fully connected layer)이거나, 특별한 기능이나 특징을 기준으로 묶인 다양한 종류의 필터 또는 레이어일 수 있다. 일 실시예에서, 하나 이상의 히든 레이어들(320)은 출력 값이 현재 시간의 히든 레이어에 다시 입력되는 리커런트 뉴럴 네트워크(recurrent neural network, RNN)에 기반하는 레이어일 수 있다. 일 실시예에 따른 뉴럴 네트워크(300)는 다수의(numerous) 히든 레이어들(320)을 포함하여, 딥 뉴럴 네트워크(deep neural network)를 형성할 수 있다. 딥 뉴럴 네트워크를 학습시키는 것을 딥 러닝(deep learning)이라 한다. 뉴럴 네트워크(300)의 노드 중에서, 히든 레이어들(320)에 포함된 노드를 가리켜 히든 노드라 한다.
입력 레이어(310) 및 하나 이상의 히든 레이어들(320)에 포함된 노드들은 연결 가중치를 가지는 연결선을 통해 서로 연결될 수 있고, 히든 레이어 및 출력 레이어에 포함된 노드들도 연결 가중치를 가지는 연결선을 통해 서로 연결될 수 있다. 뉴럴 네트워크(300)를 튜닝 및/또는 트레이닝하는 것은, 뉴럴 네트워크(300)에 포함된 레이어들(예, 입력 레이어(310), 하나 이상의 히든 레이어들(320) 및 출력 레이어(330)) 각각에 포함된 노드들 사이의 연결 가중치를 변경하는 것을 의미할 수 있다. 뉴럴 네트워크(300)의 튜닝은, 예를 들어, 지도 학습(supervised learning) 및/또는 비지도 학습(unsupervised learning)에 기반하여 수행될 수 있다.
일 실시예에 따른 전자 장치는, 비지도 학습에서 강화 학습(reinforcement learning)에 기반하여 뉴럴 네트워크(300)를 튜닝할 수 있다. 예를 들어, 전자 장치는, 뉴럴 네트워크(300)가 에이전트를 제어하기 위해 이용하는 정책 정보를, 에이전트 및 환경 사이의 상호 작용(interaction)에 기반하여 변경할 수 있다. 예를 들어, 에이전트는 환경 내에서 액션을 취하고(takes an action), 상기 에이전트는, 상기 액션에 기반하고, 리워드 함수를 이용하여 생성된, 리워드에 의하여 상기 액션으로부터 훈련될 수 있다. 일 실시예에 따른 전자 장치는, 상기 상호 작용에 의한 상기 에이전트의 목표 및/또는 보상을 극대화하기 위하여, 상기 뉴럴 네트워크(300)에 의한 상기 정책 정보의 변경을 야기할 수 있다.
예를 들어, 도 2의 NPU(210)를 이용하여 뉴럴 네트워크(300)를 획득하는 상태에서, 일 실시예에 따른 전자 장치는 메모리에 저장된 입력 레이어(310), 하나 이상의 히든 레이어들(320) 및/또는 출력 레이어(330) 사이를 연결하는 연결선에 대응하는 가중치를 식별할 수 있다. 식별된 가중치에 기반하여 뉴럴 네트워크(300)로부터 출력 데이터를 획득하기 위하여, 전자 장치는, 뉴럴 네트워크(300)의 복수의 레이어들(예, 상기 입력 레이어(310), 상기 하나 이상의 히든 레이어들(320) 및 상기 출력 레이어(330))을 따라 순차적으로, 상기 연결선에 기반하는 가중합을 획득할 수 있다. 획득된 가중합은, 도 2의 버퍼(250) 및/또는 메모리(130) 내에 저장될 수 있다. 예를 들어, 전자 장치는 복수의 레이어들을 따라 순차적으로 가중합을 획득함에 따라, 메모리 내에 저장된 가중합을 반복적으로 갱신할 수 있다.
뉴럴 네트워크(300)의 복수의 레이어들 각각은 독립적인 데이터 타입 및/또는 정밀도를 가질 수 있다. 예를 들어, 복수의 레이어들 중 제1 레이어 및 제2 레이어 사이의 연결선들이 부동 소수점 수(floating point number)를 나타내기 위한 제1 데이터 타입에 기반하는 가중치들을 가지는 경우, 전자 장치는 상기 제1 레이어의 노드들에 대응하는 수치 값들 및 상기 가중치들로부터, 상기 제1 데이터 타입에 기반하는 가중합들을 획득할 수 있다. 상기 예시에서, 복수의 레이어들 중 제2 레이어 및 제3 레이어 사이의 연결선들이 정수(integer number)를 나타내기 위한 제2 데이터 타입에 기반하는 가중치들을 가지는 경우, 전자 장치는 획득된 가중합들 및 상기 제2 데이터 타입에 기반하는 가중치들로부터, 상기 제2 데이터 타입에 기반하는 가중합들을 획득할 수 있다.
복수의 레이어들이 상이한 데이터 타입들을 가지는 경우, 일 실시예에 따른 전자 장치는, 예를 들어, 도 2의 NPU(210)를 이용하여, 상이한 데이터 타입들에 기반하여 상기 복수의 레이어들 각각에 대응하는 가중합들을 획득할 수 있다. 전자 장치가 상이한 데이터 타입들에 기반하여 획득된 가중합들에 기반하여 메모리에 액세스함에 따라, 메모리의 대역폭이 보다 효율적으로 이용될 수 있다. 메모리의 대역폭이 보다 효율적으로 이용됨에 따라, 일 실시예에 따른 전자 장치는 상기 복수의 레이어들에 기반하는 뉴럴 네트워크(300)로부터, 출력 데이터를 보다 신속하게 획득할 수 있다.
일 실시예에 따른 전자 장치는 상이한 정밀도들을 가지는 복수의 뉴럴 네트워크들 각각을 나타내는 파라미터들의 집합들을 저장할 수 있다. 예를 들어, 이미지 및/또는 비디오를 업스케일링(upscaling)하기 위한 초해상도(super resolution)와 관련된 뉴럴 네트워크는, 16 비트들에 기반하여 부동 소수점 수를 나타내기 위한 데이터 타입(예, IEEE 754에 의하여 정의된 반-정밀도 부동 소수점 포맷(half-precision floating point format))의 정밀도를 이용할 수 있다. 예를 들어, 이미지 및/또는 비디오에 포함된 피사체를 인식하기 위한 뉴럴 네트워크는, 8 비트들 및/또는 4비트들에 기반하여 정수를 나타내기 위한 데이터 타입의 정밀도를 요구할 수 있다. 예를 들어, 필기 인식을 수행하기 위한 뉴럴 네트워크는, 제1 비트 및/또는 제2 비트들에 기반하여 정수를 나타내기 위한 데이터 타입의 정밀도를 이용할 수 있다. 일 실시예에 따른 전자 장치는 복수의 뉴럴 네트워크들 각각에 대응하는 상이한 정밀도들에 기반하여, 가중합을 획득하기 위한 연산을 수행할 수 있다.
이하에서는, 도 4a 내지 도 4b를 참고하여, 일 실시예에 따른 전자 장치가 상기 가중합을 획득하는 동작이 상세히 설명된다.
도 4a 내지 도 4b들은 일 실시예에 따른 전자 장치(101)가 뉴럴 네트워크와 관련된 연산을 수행하기 위한 회로의 구조를 설명하기 위한 예시적인 블록도이다. 도 4a 내지 도 4b의 전자 장치(101)는 도 1 내지 도 2의 전자 장치(101) 및/또는 도 3의 전자 장치의 일 예에 대응할 수 있다. 예를 들어, 도 4a 내지 도 4b의 뉴럴 엔진(240)은, 도 2의 뉴럴 엔진(240)에 대응할 수 있다.
도 4a 내지 도 4b를 참고하면, 일 실시예에 따른 전자 장치(101)의 뉴럴 엔진(240)은, 연산 회로(410), 컨트롤러(420) 및/또는 누적 회로(430)를 포함할 수 있다. 뉴럴 엔진(240)에 포함된 연산 회로(410) 및/또는 누적 회로(430)의 개수는 하나 이상일 수 있다. 도 4a 내지 도 4b를 참고하면, 뉴럴 엔진(240)이 n개의 연산 회로들(제1 연산 회로(410-1) 내지 제n 연산 회로(410-n))을 포함하는 일 예가 도시된다.
일 실시예에 따른 전자 장치(101)의 뉴럴 엔진(240)은, 뉴럴 엔진(240)에 포함된 연산 회로들의 개수에 대응하는 채널들을 따라, 뉴럴 엔진(240)에 대응하는 하나 이상의 데이터 세트들을 수신할 수 있다. 뉴럴 엔진(240)이 수신하는 데이터 세트는, 상기 채널들의 수에 대응하는 원소들(elements)을 포함할 수 있다. 상기 원소들은, 뉴럴 엔진(240)에 의해 지원되는 복수의 데이터 타입들 중 하나에 기반하여 나타내어지는 수치 값에 대응할 수 있다. 뉴럴 엔진(240)이 수신하는 데이터 세트는, 예를 들어, 도 3의 뉴럴 네트워크(300)의 복수의 레이어들 중 특정 레이어의 노드들 각각에 할당된 수치 값들을 포함할 수 있다. 상기 예시에서, 뉴럴 엔진(240)이 수신하는 다른 데이터 세트는, 상기 복수의 레이어들 중 상기 특정 레이어의 노드들에 대응하는 연결선들 각각에 할당된 가중치들을 포함할 수 있다.
일 실시예에 따른 전자 장치(101)의 뉴럴 엔진(240)의 누적 회로(430)는, 뉴럴 엔진(240)에 포함된 하나 이상의 연산 회로들로부터 연산을 수행한 결과에 대응하는 수치 값들을 누적하여 저장할 수 있다. 연산 회로(410)가 이진 산술 연산을 수행한 결과를 출력하기 위해 이용하는 채널의 수는, 실시예에 따라 차별화될 수 있다. 뉴럴 엔진(240)에 포함된 누적 회로의 수는, 뉴럴 엔진(240)에 포함된 연산 회로(410)가 상기 결과를 출력하기 위해 이용하는 채널의 수에 대응할 수 있다. 도 4a를 참고하면, 연산 회로(410)가 두 개의 채널들 중 적어도 하나를 이용하여 결과를 출력하는 일 실시예에서, 뉴럴 엔진(240)은 두 개의 누적 회로(예, 제1 누적 회로(430-1) 및 제2 누적 회로(430-2))를 포함할 수 있다. 도 4b를 참고하면, 연산 회로(410)가 네 개의 채널들 중 적어도 하나를 이용하여 결과를 출력하는 일 실시예에서, 뉴럴 엔진(240)은 네 개의 누적 회로(예, 제1 누적 회로(430-1) 내지 제4 누적 회로(430-4))를 포함할 수 있다.
일 실시예에 따른 전자 장치(101)의 뉴럴 엔진(240)의 컨트롤러(420)는, 뉴럴 엔진(240)이 수신한 하나 이상의 데이터 세트들 각각에 포함된 수치 값들을, 뉴럴 엔진(240)의 제1 연산 회로(410-1) 내지 제n 연산 회로(410-n) 각각에 입력할 수 있다. 컨트롤러(420)는, 상기 하나 이상의 데이터 세트들의 데이터 타입에 따라 연산 회로(410)를 다르게 제어할 수 있다. 예를 들어, 컨트롤러(420)는 연산 회로(410) 내 신호 경로를, 뉴럴 엔진(240)이 수신한 하나 이상의 데이터 세트들의 데이터 타입에 기반하여 조절할 수 있다. 일 실시예에 따른 컨트롤러(420)가 연산 회로(410) 내 신호 경로를 데이터 타입에 기반하여 조절하는 예시들이 도 6a 내지 도 6c 및/또는 도 9a 내지 도 9d를 참고하여 후술된다.
일 실시예에 따른 전자 장치(101)의 뉴럴 엔진(240)의 컨트롤러(420)는, 연산 회로(410)로 입력될 수치 값들을, 누적 회로(430)에 누적된 수치 값, 뉴럴 엔진(240)이 수신한 데이터 세트들에 포함된 수치 값들 중에서 선택할 수 있다. 예를 들어, 뉴럴 네트워크의 특정 레이어(예, 도 3의 하나 이상의 히든 레이어들(320) 중 하나의 히든 레이어)에 대응하는 연산을 수행하는 상태에서, 특정 레이어에 포함된 노드들에 대응하는 가중합을 계산하기 위하여, 컨트롤러(420)는 연산 회로(410)의 상이한 채널들에서 출력되는 수치 값들을 누적 회로(430) 내에 누적하여 저장할 수 있다.
도 4a를 참고하면, 수치 값들을 출력하기 위한 두 개의 채널들을 연산 회로(410)를 포함하는 뉴럴 엔진(240)의 일 예가 도시된다. 뉴럴 엔진(240)이, n = 32개의 연산 회로들(예, 제1 연산 회로(410-1) 내지 제n 연산 회로(410-n))을 포함하는 경우, 뉴럴 엔진(240)은 단일 처리 사이클(single processing cycle) 내에, 상기 연산 회로들로부터 32 Х 2 = 64 개의 수치 값들을 획득할 수 있다. 예를 들어, 상기 64 개의 수치 값들은, 뉴럴 네트워크의 특정 레이어와 관련된 64 개의 가중치들 각각을, 상기 특정 레이어로 입력되는 64 개의 수치 값들 각각에 적용한 수치 값이다.
일 실시예에서, 뉴럴 엔진(240)에 의해 획득된 상기 수치 값들 각각은, 뉴럴 엔진(240)의 누적 회로들 중에서 상기 수치 값들 각각에 대응하는 특정 누적 회로에 저장될 수 있다. 도 4a를 참고하면, 복수의 연산 회로들(예, 제1 연산 회로(410-1), 제2 연산 회로(410-2), ..., 제n 연산 회로들(410-n))의 제1 채널(O1)로부터 출력되는 수치 값들이 상기 제1 채널(O1)에 대응하는 제1 누적 회로(430-1) 내에 저장될 수 있다. 유사하게, 복수의 연산 회로들의 제2 채널(O2)로부터 출력되는 수치 값들이 상기 제2 채널(O2)에 대응하는 제2 누적 회로(430-2) 내에 저장될 수 있다.
상술한 바와 같이, 일 실시예에 따른 전자 장치(101)의 제1 연산 회로(410-1) 내지 제n 연산 회로들(410-n)과 같은 연산 회로들은 상이한 데이터 타입들에 기반하는 이진 산술 연산을 지원할 수 있다. 예를 들어, 지정된 수의 비트들에 기반하여 정수를 나타내기 위한 데이터 타입(예, 8 비트들 및/또는 4 비트들을 이용하여 정수를 나타내기 위한 데이터 타입)과 관련된 이진 산술 연산을 수행하는 상태에서, 전자 장치(101)의 연산 회로들은 제1 채널(O1) 및 제2 채널(O2) 전부를 이용하여, 수행된 이진 산술 연산에 대응하는 수치 값을 출력할 수 있다. 예를 들어, 상기 지정된 수를 초과하는 수의 비트들에 기반하여 부동 소수점 수를 나타내기 위한 다른 데이터 타입(예, 16 비트들을 이용하여 부동 소수점 수를 나타내기 위한 다른 데이터 타입)과 관련된 이진 산술 연산을 수행하는 상태에서, 전자 장치(101)의 연산 회로들은 제1 채널(O1) 및 제2 채널(O2) 중 제1 채널(O1)을 이용하여, 수행된 이진 산술 연산에 대응하는 수치 값을 출력할 수 있다. 일 실시예에 따른 전자 장치(101)의 컨트롤러(420)가 연산 회로(410) 내에 포함된 신호 경로를 조절하여, 상기 제1 채널(O1) 및/또는 상기 제2 채널(O2)을 통하여 하나 이상의 수치 값들을 출력하는 동작은 도 6a 내지 도 6c를 참고하여 후술된다.
도 4b를 참고하면, 수치 값들을 출력하기 위한 네 개의 채널들을 연산 회로(410)를 포함하는 뉴럴 엔진(240)의 일 예가 도시된다. 뉴럴 엔진(240)이, n = 32개의 연산 회로들(예, 제1 연산 회로(410-1) 내지 제n 연산 회로(410-n))을 포함하는 경우, 뉴럴 엔진(240)은 단일 처리 사이클(single processing cycle) 내에, 상기 연산 회로들로부터 32 Х 4 = 128 개의 수치 값들을 획득할 수 있다. 예를 들어, 상기 128 개의 수치 값들 각각은, 콘볼루션과 관련된 CNN의 노드에 할당된 수치 값에, 커널(kernel)에 기반하여 나타내어지는 상이한 가중치들을 적용한 수치 값에 대응할 수 있다. 상기 커널은, 이하에서, 필터로 참조될 수 있다.
도 4b를 참고하면, 제1 누적 회로(430-1)는, 복수의 연산 회로들(예, 제1 연산 회로(410-1), 제2 연산 회로(410-2), ..., 제n 연산 회로들(410-n))의 제1 채널(O1)로부터 출력되는 수치 값들을 저장할 수 있다. 유사하게, 제2 누적 회로(430-2), 제3 누적 회로(430-3) 및 제4 누적 회로(430-4) 각각은, 복수의 연산 회로들의 제2 채널(O2), 제3 채널(O3) 및 제4 채널(O4) 각각으로부터 출력되는 수치 값들을 저장할 수 있다. 일 실시예에 따른 전자 장치(101)의 연산 회로(410)가 제1 채널(O1) 내지 제4 채널(O4) 중에서 활성화하는 채널의 수는, 연산 회로(410)로 입력되는 수치 값의 데이터 타입에 따라, 및/또는 컨트롤러(420)에 의해 조절되는 연산 회로(410) 내 신호 경로에 따라 조절될 수 있다.
예를 들어, 일 실시예에 따른 뉴럴 엔진(240)의 연산 회로(410)가 16 비트들을 따라 부동 소수점 수를 나타내기 위한 제1 데이터 타입, 및/또는 8 비트들을 따라 정수를 나타내기 위한 제2 데이터 타입에 기반하는 곱셈 연산을 수행하는 상태에서, 연산 회로(410)는 단일 처리 사이클 내에, 제1 채널(O1) 내지 제4 채널(O4) 중에서 제1 채널(O1)을 이용하여, 누적 회로(예, 제1 채널(O1)에 대응하는 제1 누적 회로(430-1))로, 곱셈 연산의 결과에 대응하는 수치 값을 송신할 수 있다. 상기 누적 회로에서, 뉴럴 엔진(240)에 포함된 연산 회로들로부터 상기 제1 채널(O1)을 따라 송신된 수치 값들이 누적될 수 있다. 이 경우, 뉴럴 엔진(240)은 상기 단일 처리 사이클 내에, 제1 데이터 타입 및/또는 제2 데이터 타입에 기반하여 상기 누적 회로에 누적된 수치 값들을, 상기 누적 회로에 대응하는 하나의 채널을 통해 출력할 수 있다.
예를 들어, 일 실시예에 따른 뉴럴 엔진(240)의 연산 회로(410)가 4 비트들을 따라 정수를 나타내기 위한 제3 데이터 타입에 기반하는 곱셈 연산을 수행하는 상태에서, 연산 회로(410)는 단일 처리 사이클 내에, 제1 채널(O1) 내지 제4 채널(O4) 중에서 제1 채널(O1) 및 제2 채널(O2)을 이용하여, 2 개의 누적 회로들(예, 제1 채널(O1) 및 제2 채널(O2) 각각에 대응하는 제1 누적 회로(430-1) 및 제2 누적 회로(430-2))로, 곱셈 연산의 결과에 대응하는 2 개의 수치 값들을 저장할 수 있다. 상기 2 개의 누적 회로들 각각에서, 뉴럴 엔진(240)에 포함된 연산 회로들로부터 상기 제1 채널(O1) 및 상기 제2 채널(O2) 각각을 따라 송신된 수치 값들이 누적될 수 있다. 이 경우, 뉴럴 엔진(240)은 상기 단일 처리 사이클 내에, 제3 데이터 타입에 기반하는 수치 값들을, 상기 2 개의 누적 회로들 각각에 대응하는 2 개의 채널들을 통해 출력할 수 있다.
예를 들어, 일 실시예에 따른 뉴럴 엔진(240)의 연산 회로(410)가 2 비트들을 따라 정수를 나타내기 위한 제4 데이터 타입에 기반하는 곱셈 연산을 수행하는 상태에서, 연산 회로(410)는 단일 처리 사이클 내에, 제1 채널(O1) 내지 제4 채널들(O4) 전부를 이용하여, 4 개의 누적 회로들(예, 제1 누적 회로(430-1) 내지 제4 누적 회로(430-4))로, 곱셈 연산의 결과에 대응하는 4 개의 수치 값들을 저장할 수 있다. 상기 4 개의 누적 회로들 각각에서, 뉴럴 엔진(240)에 포함된 연산 회로들로부터 상기 제1 채널(O1) 내지 상기 제4 채널들(O4) 각각을 따라 송신된 수치 값들이 누적될 수 있다. 이 경우, 뉴럴 엔진(240)은 상기 단일 처리 사이클 내에, 제4 데이터 타입에 기반하는 수치 값들을, 상기 4 개의 누적 회로들 각각에 대응하는 4 개의 채널들을 통해 출력할 수 있다.
도 4b의 일 실시예에서의 뉴럴 엔진(240)의 컨트롤러(420)에 의해 조절된 연산 회로(410) 내 신호 경로가 도 9a 내지 도 9d를 참고하여 후술된다. 이 경우, 뉴럴 엔진(240)은 제4 데이터 타입에 기반하는 수치 값들을, 상기 4 개의 누적 회로들 각각에 대응하는 4 개의 채널을 통해 출력할 수 있다.
상술한 바와 같이, 일 실시예에 따른 전자 장치(101)의 뉴럴 엔진(240)은 복수의 데이터 타입들에 기반하는 이진 산술 연산을 지원하는 하나 이상의 연산 회로들을 포함할 수 있다. 상기 하나 이상의 연산 회로들은, 데이터 타입에 따라 활성화되는 하나 이상의 채널들을 이용하여, 하나 이상의 수치 값들을 출력할 수 있다. 뉴럴 엔진(240)은 하나 이상의 누적 회로들을 이용하여, 상기 하나 이상의 연산 회로들의 하나 이상의 채널들을 통해 출력되는 하나 이상의 수치 값들을 누적할 수 있다. 누적된 하나 이상의 수치 값들은, 뉴럴 네트워크의 특정 레이어에 포함된 노드들 각각에 대응하는 가중합을 나타낼 수 있다.
이하에서는, 도 5를 참고하여, 도 4a의 연산 회로(410)의 예시적인 구조가 설명된다.
도 5는 일 실시예에 따른 전자 장치(101)의 연산 회로(410)의 일 예를 설명하기 위한 블록도이다. 도 5의 전자 장치(101)는 도 1 내지 도 2 및 도 4a 내지 도 4b의 전자 장치(101), 및/또는 도 3의 전자 장치의 일 예에 대응할 수 있다. 예를 들어, 도 5의 연산 회로(410)는 도 4a의 연산 회로(410)의 일 예에 대응할 수 있다.
도 5를 참고하면, 일 실시예에 따른 연산 회로(410)는 결합기(510), 곱셈기(520), 변환기(530), 덧셈기(580) 또는 이들의 조합을 포함할 수 있다. 일 실시예에 따른 연산 회로(410)는 승수(multiplier) 및 하나 이상의 피승수들(multiplicands)에 기반하는 곱셈 연산을 수행할 수 있다. 예를 들어, 도 3의 복수의 레이어들 사이를 연결하는 연결선들 각각에 할당된 가중치들이, 상기 하나 이상의 승수들의 일 예에 대응하고, 도 3의 복수의 레이어들에 포함된 노드들 각각에 할당된 수치 값들이, 상기 하나 이상의 피승수들의 일 예에 대응한다.
도 5를 참고하면, 연산 회로(410)는, 하나 이상의 피승수들을 나타내는 비트들을 수신하기 위한 포트들(510-1, 510-2) 및 상기 하나 이상의 피승수들이 결합된 비트들을 출력하기 위한 포트(510-3)를 포함하는 결합기(510)를 포함할 수 있다. 연산 회로(410)는, 승수를 나타내는 비트들 중 적어도 일부분을 수신하기 위한 포트(520-1), 결합기(510)의 포트(510-3)에 연결된 포트(520-2), 및 포트들(520-1, 520-2)로부터 수신된 비트들에 대응하는 이진 곱셈 연산을 수행한 결과에 대응하는 비트들을 출력하기 위한 포트(520-3)를 포함하는 곱셈기(520)를 포함할 수 있다. 연산 회로(410)는, 피승수를 나타내는 비트들 중 일부분을 수신하기 위한 포트(580-1), 승수를 나타내는 비트들을 수신하기 위한 포트(580-2), 및 포트들(580-1, 580-2)로부터 수신된 비트들에 대응하는 이진 덧셈 연산을 수행한 결과를 나타내는 비트들을 출력하기 위한 포트(580-3)를 포함하는 덧셈기(580)를 포함할 수 있다. 예를 들어, 연산 회로(410)의 포트들(510-1, 510-2, 520-1, 580-1, 580-2)이, 연산 회로(410)가 하나 이상의 수치 값들을 수신하는 포트들에 대응할 수 있다.
도 5를 참고하면, 일 실시예에 따른 연산 회로(410)는 곱셈기(520)의 포트(520-3) 및 덧셈기(580)의 포트(580-3)에 연결되어, 포트들(520-3, 580-3)로부터 수신되는 비트들에 기반하여, 제1 채널(O1) 또는 제2 채널(O2) 중 적어도 하나로, 하나 이상의 수치 값들을 나타내는 비트들을 출력하는 변환기(530)를 포함할 수 있다. 예를 들어, 변환기(530)는 포트(580-3)로부터 출력되는 비트들 및/또는 연산 회로(410)에 입력되는 상기 하나 이상의 승수들 및/또는 상기 하나 이상의 피승수들의 데이터 타입에 따라 포트(520-3)로부터 출력되는 비트들을 변환하여, 제1 채널(O1) 또는 제2 채널(O2) 중 적어도 하나를 통해 출력될 하나 이상의 수치 값들을 획득할 수 있다.
도 5를 참고하면, 변환기(530)는 곱셈기(520)의 포트(520-3)로부터 출력되는 비트들을 수신하기 위한 포트(540-1), 및 상기 포트(540-1)를 통해 수신된 비트들 중 일부분에 대응하는 비트들을 출력하기 위한 포트(540-2)를 포함하는 비트 선택기(540)를 포함할 수 있다. 변환기(530)는 곱셈기(520)의 포트(520-3)로부터 출력되는 비트들을 수신하기 위한 포트(550-1), 및 상기 포트(550-1)를 통해 수신된 비트들에 기반하여 연산 회로(410)의 제2 채널(O2)로 하나 이상의 비트들을 출력하기 위한 포트(550-2)를 포함하는 비트 조정기(550)를 포함할 수 있다. 변환기(530)는 비트 선택기(540)의 포트(540-2)에 연결된 포트(560-1), 곱셈기(520)의 포트(520-3)에 연결된 포트(560-2), 연산 회로(410)에 대응하는 컨트롤러(예, 도 4a 내지 도 4b의 컨트롤러(420))로부터 신호(SEL)를 수신하기 위한 포트(560-3), 및 상기 포트(560-3)에 의해 수신된 신호에 기반하여, 포트들(560-1, 560-2) 중 어느 한 포트의 비트들을 출력하기 위한 포트(560-4)를 포함하는 스위치(560)를 포함할 수 있다. 변환기(530)는 스위치(560)의 포트(560-4)로부터 출력되는 비트들을 수신하기 위한 포트(570-1), 덧셈기(580)의 포트(580-3)로부터 출력되는 비트들을 수신하기 위한 포트(570-2), 및 포트(570-2)를 통해 수신된 비트들에 기반하여, 포트(570-1)의 비트들을 시프트한 결과를 나타내는 비트들을 출력하기 위한 포트(570-3)를 포함하는 시프트 레지스터(570)를 포함할 수 있다. 연산 회로(410)의 제1 채널(O1)은 시프트 레지스터(570)의 포트(570-3)에 대응할 수 있다. 예를 들어, 연산 회로(410)의 포트들(570-3, 550-2) 각각이 연산 회로(410)가 수치 값들을 출력하기 위한 포트들에 대응할 수 있다.
일 실시예에서, 변환기(530)가 연산 회로(410)의 컨트롤러(예, 도 4a 내지 도 4b의 컨트롤러(420))에 의해 제어됨에 따라, 곱셈기(520)의 포트(520-3)로부터 출력되는 비트들이, 연산 회로(410)로 입력되는 수치 값들에 대응하는 데이터 타입에 기반하여 처리될 수 있다. 예를 들어, 변환기(530) 내에서의 신호 경로가 상기 데이터 타입에 따라 변경될 수 있다. 연산 회로(410)에 대응하는 컨트롤러는 상기 데이터 타입에 따라 연산 회로(410)의 포트들(510-1, 510-2, 520-1, 580-1, 580-2)로 입력되는 비트들을 변경할 수 있다. 연산 회로(410)에 대응하는 컨트롤러는 상기 데이터 타입에 따라 결합기(510) 및/또는 덧셈기(580)를 선택적으로 활성화할 수 있다.
이하에서는, 도 6a 내지 도 6c를 참고하여, 일 실시예에 따른 연산 회로(410)에서, 연산 회로(410)가 수신하는 수치 값들의 데이터 타입에 따라 조절되는 신호 경로들이 설명된다.
도 6a 내지 도 6c들은 도 5의 연산 회로(410)의 서로 다른 상태들(610, 620, 630)을 설명하기 위한 도면들이다. 도 6a 내지 도 6c들의 전자 장치(101)는 도 1 내지 도 2, 도 4a 내지 도 4b 및 도 5의 전자 장치(101), 및/또는 도 3의 전자 장치의 일 예에 대응할 수 있다. 예를 들어, 도 6a 내지 도 6c의 연산 회로(410)는 도 4a의 연산 회로(410) 및/또는 도 5의 연산 회로(410)의 일 예에 대응할 수 있다.
도 6a는 부동 소수점 수를 나타내기 위한 제1 데이터 타입에 기반하는 곱셈 연산을 수행하는 상태(610)에서의 연산 회로(410)의 동작을 설명하기 위한 예시적인 도면이다. 상기 제1 데이터 타입은, 예를 들어, 16 비트들을 따라 부동 소수점 수를 나타내기 위한 데이터 타입에 대응할 수 있다. 예를 들어, 상기 제1 데이터 타입은, 예를 들어, IEEE 754의 반-정밀도 부동 소수점 포맷의 데이터 타입(FP16)에 대응할 수 있다. 이 경우, 상기 16 비트들 중 최상위 비트(most significant bit, MSB)는, 부동 소수점 수의 부호를 나타낸다. 상기 16 비트들 중 상기 최상위 비트에 연접하는 5 비트들은, 상기 부동 소수점 수의 지수(exponent)를 나타낸다. 상기 16 비트들 중 최하위 비트(least significant bit, LSB)를 포함하는 나머지 10 비트들은, 상기 부동 소수점 수의 가수(mantissa)를 나타낸다.
예를 들어, IEEE 754의 반-정밀도 부동 소수점 포맷에 대응하는 제1 데이터 타입에 기반하여 수치 값 Wa를 복수의 비트들을 따라 나타내는 경우, 상기 비트들은 수학식 1의 Wa_s, Wa_M, Wa_e에 대응하는 비트들을 포함할 수 있다.
Figure PCTKR2022009974-appb-img-000001
수학식 1을 참고하면, Wa_s는 Wa의 부호를 나타내는 수치 값이고, Wa_M은 Wa의 정규화된(normalized) 가수를 나타내는 수치 값이고, Wa_e는 Wa의 편향된(biased) 지수를 나타내는 수치 값이다. 수치 값 Wa에 대응하는 비트들은, MSB부터, Wa_s를 나타내는 1개의 비트, Wa_e를 나타내는 5 개의 비트들 및 Wa_M을 나타내는 10 개의 비트들을 순차적으로 포함할 수 있다.
이하에서는, 상기 반-정밀도 부동 소수점 포맷에 대응하는 제1 데이터 타입에 기반하는 곱셈 연산을 수행하는 상태(610)에서, 전자 장치(101)가 연산 회로(410)를 이용하여 수치 값 Wa 및 수치 값 Ia의 곱셈 연산을 수행하는 동작이 설명된다. 예를 들어, 수치 값 Wa는 도 3의 연결선에 할당된 가중치 및/또는 CNN에서의 커널을 나타내는 매트릭스의 원소들 중 하나일 수 있다. 예를 들어, 수치 값 Ia는 도 3의 노드에 할당된 수치 값 및/또는 CNN에서의 커널을 나타내는 매트릭스에 적용될 다른 매트릭스의 원소들 중 하나일 수 있다. 이하에서는, 수치 값 Ia_s는 제1 데이터 타입에서의 수치 값 Ia에 대응하는 부호를 나타내고, 수치 값 Ia_e는 제1 데이터 타입에서의 수치 값 Ia에 대응하는 지수를 나타내고, 수치 값 Ia_M는 제1 데이터 타입에서의 수치 값 Ia에 대응하는 가수를 나타내는 것으로 가정한다.
도 6a를 참고하면, 상태(610)에서, 수치 값들 Wa, Ia 각각의 가수들 Wa_M 및 Ia_M들이, 곱셈기(520)의 포트들(520-1, 520-2)로 입력될 수 있다. 예를 들어, 연산 회로(410)의 결합기(510)가 상태(610)에서 비활성화됨에 따라, 결합기(510)의 포트(510-1)로 입력되는 가수 Wa_M이, 결합기(510)를 바이패스하여, 곱셈기(520)의 포트(520-2)로 송신될 수 있다. 결합기(510)의 비활성화는, 연산 회로(410) 및/또는 연산 회로(410)에 연결된 컨트롤러(예, 도 4a 내지 도 4b의 컨트롤러(420)에 의해 제어될 수 있다.
일 실시예에 따른 곱셈기(520)는 13 비트들 및 12 비트들에 의해 각각 나타내어진(respectively indicated by) 수치 값들에 대한 곱셈 연산을 수행할 수 있다. 예를 들어, 포트(520-1)를 통하여, 곱셈기(520)는 13 비트들을 따라 나타낸 수치 값을 수신할 수 있다. 포트(520-2)를 통하여, 곱셈기(520)는 12 비트들을 따라 나타낸 수치 값을 수신할 수 있다. 포트들(520-1, 520-2) 각각을 통하여, 10 비트들에 기반하여 나타내어지는 Ia_M 및 Wa_M들을 수신하는 경우, 곱셈기(520)는 부호 확장(sign extension)을 이용하여 13 비트들에 의해 나타내어지는 Ia_M, 및 12 비트들에 의해 나타내어지는 Wa_M을 획득할 수 있다. 상기 부호 확장은, 예를 들어, 수치 값들 Wa, Ia 각각의 부호를 나타내는 Wa_s 및 Ia_s 각각에 기반하여 수행될 수 있다. 일 실시예에서, 곱셈기(520)는 13 비트들 및 12 비트들에 의해 각각 나타내어진 Ia_M 및 Wa_M에 대한 곱셈 연산을 수행할 수 있다. 곱셈기(520)는 포트(520-3)를 통하여, 예를 들어, 24 비트들에 의해 나타내어지는 Ia_M 및 Wa_M의 곱(product)을 출력할 수 있다.
도 6a를 참고하면, 상태(610)에서, 수치 값들 Wa, Ia 각각의 지수들 Wa_e 및 Ia_e들이, 덧셈기(580)의 포트들(580-1, 580-2)로 입력될 수 있다. 덧셈기(580)는 상태(610)에서 연산 회로(410) 및/또는 연산 회로(410)에 연결된 컨트롤러에 의해 활성화될 수 있다. 덧셈기(580)는, 5 비트들에 의해 나타내어진 Wa_e 및 Ia_e에 대한 덧셈 연산을 수행하여, 포트(580-3)를 통하여, Wa_e 및 Ia_e의 합(sum)을 출력할 수 있다.
도 6a를 참고하면, 상태(610)에서, 변환기(530)에 포함된 비트 선택기(540) 및 비트 조정기(550)가 비활성화될 수 있다. 상태(610)에서 변환기(530)의 스위치(560)는, 포트들(560-1, 560-2) 중에서 곱셈기(520)의 포트(520-3)에 대응하는 포트(560-2)를, 포트(560-3)를 통해 수신되는 신호에 기반하여 포트(560-4)로 연결할 수 있다. 스위치(560)에서의 포트들(560-2, 560-4) 사이의 연결은, 포트(560-3)를 통해 입력되고, 예를 들어, 연산 회로(410)에 대응하는 컨트롤러로부터 제공된, 신호(SEL)에 의해 수립될 수 있다. 포트들(560-2, 560-4)이 서로 연결됨에 따라, 곱셈기(520)의 포트(520-3)로부터 출력되는 비트들이 스위치(560)의 포트(560-4)를 통해 출력될 수 있다. 이 경우, 시프트 레지스터(570)는 포트(570-1)를 통하여, 곱셈기(520)로부터 출력된 Ia_M 및 Wa_M의 곱을 수신할 수 있다. Ia_M 및 Wa_M의 곱을 수신한 상태에서, 포트(570-2)를 통해 Wa_e 및 Ia_e의 합을 수신함에 따라, 시프트 레지스터(570)는 수신된 Wa_e 및 Ia_e의 합에 기반하여, Ia_M 및 Wa_M의 곱을 시프트할 수 있다. Wa_e 및 Ia_e의 합에 기반하여 Ia_M 및 Wa_M의 곱을 시프트하는 것은, 부동 소수점 수의 가수를 정규화하는 동작에 대응할 수 있다.
상태(610)에서, 연산 회로(410)는 시프트 레지스터(570)에 저장된 비트들을, 제1 채널(O1)을 통해 출력할 수 있다. 예를 들어, 연산 회로(410)는 시프트된 Ia_M 및 Wa_M의 곱을 나타내는 비트들, Wa_e 및 Ia_e의 합을 나타내는 비트들 및 Ia_M 및 Wa_M의 곱의 부호를 나타내는 비트를 연접하여, 상기 제1 데이터 타입의 16 비트들 이상의 개수의 비트들(예, 32 비트들)에 따라 Wa 및 Ia의 곱을 나타내는 비트들을 출력할 수 있다. 제1 채널(O1)을 통해 출력되고, Wa 및 Ia의 곱을 나타내는, 비트들은, 예를 들어, 도 4a의 제1 누적 회로(430-1)에 저장될 수 있다.
도 6b는 정수를 나타내기 위한 제2 데이터 타입에 기반하는 곱셈 연산을 수행하는 상태(620)에서의 연산 회로(410)의 동작을 설명하기 위한 예시적인 도면이다. 상기 제2 데이터 타입은, 예를 들어, 8 비트들을 따라 고정 소수점 수(fixed point number) 또는, 정수를 나타내기 위한 데이터 타입(INT8)에 대응할 수 있다. 이 경우, 8 비트들 중 MSB는 정수의 부호를 나타내고, 나머지 7 비트들은 상기 정수의 절대 값을 나타낸다.
이하에서는, 8 비트들을 따라 정수를 나타내기 위한 제2 데이터 타입에 기반하는 곱셈 연산을 수행하는 상태(620)에서, 전자 장치(101)가 연산 회로(410)를 이용하여 수치 값 Wb 및 수치 값 Ib의 곱셈 연산을 수행하는 동작이 설명된다. 예를 들어, 수치 값 Wb는 도 3의 연결선에 할당된 가중치 및/또는 CNN에서의 커널을 나타내는 매트릭스의 원소들 중 하나일 수 있다. 예를 들어, 수치 값 Ib는 도 3의 노드에 할당된 수치 값 및/또는 CNN에서의 커널을 나타내는 매트릭스에 적용될 다른 매트릭스의 원소들 중 하나일 수 있다.
도 6b를 참고하면, 상태(620)에서, 수치 값들 Wb, Ib이, 곱셈기(520)의 포트들(520-1, 520-2)로 입력될 수 있다. 도 6a의 상태(610)와 유사하게, 연산 회로(410)의 결합기(510)가 비활성화됨에 따라, 결합기(510)의 포트(510-1)로 입력되는 수치 값 Wb가, 결합기(510)를 바이패스하여, 곱셈기(520)의 포트(520-2)로 송신될 수 있다.
일 실시예에 따른 곱셈기(520)는 부호 확장을 이용하여 13 비트들에 의해 나타내어지는 Ib, 및 12 비트들에 의해 나타내어지는 Wb를 획득할 수 있다. 상기 부호 확장은, 예를 들어, 수치 값들 Wb 및 Ib 각각의 부호를 나타내는 비트(예, 수치 값들 Wb 및 Ib를 나타내는 비트들의 MSB)에 기반하여 수행될 수 있다. 곱셈기(520)는 포트(520-3)를 통하여, 예를 들어, 24 비트들에 의해 나타내어지는 Wb 및 Ib의 곱을 출력할 수 있다.
도 6b를 참고하면, 상태(620)에서, 덧셈기(580)가 비활성화되거나, 또는 지정된 수치 값(예, 0)을 나타내는 비트들이 덧셈기(580)의 포트들(580-1, 580-2)로 입력될 수 있다. 덧셈기(580)의 비활성화는, 예를 들어, 제2 데이터 타입에 기반하는 곱셈 연산을 수행하라는 요청을 식별한 연산 회로(410) 및/또는 연산 회로(410)에 연결된 컨트롤러에 의해 수행될 수 있다. 덧셈기(580)가 비활성화됨에 따라, 덧셈기(580)가 시프트 레지스터(570)의 포트(570-2)로 송신하는 비트들은, 시프트 레지스터(570)에 의한 비트들의 시프트를 적어도 일시적으로 중단하는 지정된 수치 값(예, 0)을 나타낼 수 있다.
도 6b를 참고하면, 상태(620)에서, 상태(610)와 유사하게, 변환기(530)에 포함된 비트 선택기(540) 및 비트 조정기(550)가 비활성화될 수 있다. 상태(620)에서, 변환기(530)의 스위치(560)는, 곱셈기(520)의 포트(520-3)에 대응하는 포트(560-2)를, 포트(560-3)를 통해 수신되는 신호(SEL)에 기반하여, 포트(560-4)로 연결할 수 있다. 이 경우, 곱셈기(520)의 포트(520-3)로부터 출력되고, Wb 및 Ib의 곱을 나타내는 비트들이, 포트(560-4)를 통해 시프트 레지스터(570)의 포트(570-1)로 출력될 수 있다. 덧셈기(580)가 비활성화됨에 따라, 시프트 레지스터(570)의 포트(570-3)에서, 포트(570-1)로 입력된 비트들이 시프트와 독립적으로 출력될 수 있다. 예를 들어, 포트(570-3)를 통하여 연산 회로(410)의 제1 채널(O1)로, Wb 및 Ib의 곱을 나타내는 비트들(예, 제2 데이터 타입의 8 비트들 이상의 수의 비트들)이 출력될 수 있다. 제1 채널(O1)을 통해 출력되고, Wb 및 Ib의 곱을 나타내는, 비트들은, 예를 들어, 도 4a의 제1 누적 회로(430-1)에 저장될 수 있다.
도 6c는 도 6b의 제2 데이터 타입과 구별되고, 정수를 나타내기 위한, 제3 데이터 데이터 타입에 기반하는 곱셈 연산을 수행하는 상태(630)에서의 연산 회로(410)의 동작을 설명하기 위한 예시적인 도면이다. 상기 제3 데이터 타입은, 예를 들어, 4 비트들을 따라 고정 소수점 수 또는, 정수를 나타내기 위한 데이터 타입(INT4)에 대응할 수 있다. 이 경우, 4 비트들 중 MSB는 정수의 부호를 나타내고, 나머지 3 비트들은 상기 정수의 절대 값을 나타낸다.
이하에서는, 4 비트들을 따라 정수를 나타내기 위한 제3 데이터 타입에 기반하는 곱셈 연산을 수행하는 상태(630)에서, 전자 장치(101)가 연산 회로(410)를 이용하여 수치 값 Wc0, 수치 값 Wc1 및 수치 값 Ic의 곱셈 연산을 수행하는 동작이 설명된다. 예를 들어, 수치 값 Wc0 및 수치 값 Wc1은 도 3의 연결선에 할당된 가중치 및/또는 CNN에서의 커널을 나타내는 매트릭스의 원소들 중 하나일 수 있다. 예를 들어, 수치 값 Ic는 도 3의 노드에 할당된 수치 값 및/또는 CNN에서의 커널을 나타내는 매트릭스에 적용될 다른 매트릭스의 원소들 중 하나일 수 있다. 제3 데이터 타입에 기반하는 곱셈 연산은, 제1 채널(O1) 및 제2 채널(O2) 중 제1 채널(O1)이 이용되는 상태들(610, 620)과 독립적으로, 제1 채널(O1) 및 제2 채널(O2) 전부의 활성화를 야기할 수 있다. 일 실시예에 따른 전자 장치(101)는 피승수들(예, 수치 값 Wc0, 수치 값 Wc1) 각각에 승수(예, 수치 값 Ic)를 적용한 결과에 대응하는 두 수치 값들(예, Wc0 Х Ic 및 Wc1 Х Ic)을, 제1 채널(O1) 및 제2 채널(O2)을 통해 출력할 수 있다.
도 6c를 참고하면, 상태(630)에서, 수치 값들 Wc0, Wc1이, 결합기(510)의 포트들(510-1, 510-2)로 입력될 수 있다. 제3 데이터 타입에 기반하는 곱셈 연산을 수행하라는 요청을 식별하는 것에 응답하여, 전자 장치(101)의 연산 회로(410) 및/또는 연산 회로(410)에 대응하는 컨트롤러는 결합기(510)를 활성화할 수 있다. 활성화된 상태에서, 일 실시예에 따른 결합기(510)는 포트들(510-1, 510-2) 각각을 통해 수신되고, 수치 값들 Wc0, Wc1 각각에 대응하는 비트들을 결합할 수 있다.
예를 들어, 포트들(510-1, 510-2) 각각을 통해 제3 데이터 타입을 따라 4 개의 비트들을 이용하여 나타내어지는 수치 값들 Wc0, Wc1을 수신하는 상태에서, 결합기(510)의 포트(510-3)에서 출력되는 비트들 중에서, LSB 및 LSB와 연접하는 3 개의 비트들을 포함하는 4 개의 비트들은, 포트(510-1)를 통해 수신되고, 수치 값 Wc0를 나타내는 4 개의 비트들에 대응할 수 있다. 상기 예시에서, 결합기(510)의 포트(510-3)로부터 출력되는 비트들 중에서, MSB 및 MSB와 연접하는 3 개의 비트들을 포함하는 4 개의 비트들은, 포트(510-2)를 통해 수신되고, 수치 값 Wc1를 나타내는 4 개의 비트들에 대응할 수 있다. 일 실시예 따른 전자 장치(101)의 결합기(510)가 수치 값들 Wc0, Wc1을 나타내는 비트들을 결합하는 동작은 도 7에서 후술된다.
도 6c를 참고하면, 상태(630)에서, 곱셈기(520)는 포트(520-1)를 통해 수신되는 수치 값 Ic를 나타내는 비트들, 및 포트(520-2)를 통해 수신되고, 결합기(510)의 포트(510-3)에서 출력되는 비트들의 곱셈 연산을 수행할 수 있다. 곱셈기(520)가 포트(520-2)를 통해 수신하는 비트들은, 수치 값들 Wc0, Wc1이 결합기(510)에 의해 결합된 비트들에 대응할 수 있다. 곱셈기(520)는 포트(520-3)를 통해, 곱셈 연산을 수행한 결과를 출력할 수 있다.
도 6c를 참고하면, 상태(630)에서, 변환기(530)에 포함된 비트 선택기(540) 및 비트 조정기(550)가 활성화될 수 있다. 비트 선택기(540) 및 비트 조정기(550)는, 예를 들어, 연산 회로(410)가 제3 데이터 타입에 기반하는 수치 값들 Wc0, Wc1 및 Ic를 수신하는 것에 응답하여 활성화될 수 있다. 비트 선택기(540)는 포트(540-1)를 통해 포트(520-3)로부터 출력되는 비트들을 수신할 수 있다. 상기 비트들을 수신하는 것에 응답하여, 비트 선택기(540)는 수신된 비트들 중 일부분(예, LSB 및 LSB와 연접하는 7 개의 비트들을 포함하는 8 개의 비트들)을 추출할 수 있다. 비트 선택기(540)는 추출된 비트들을, 포트(540-2)를 통해 출력할 수 있다. 스위치(560)는, 포트(560-3)를 통해 수신되는 신호(SEL)에 기반하여, 포트들(560-1, 560-2) 중에서 포트(560-1)로부터 수신되는 비트들을, 포트(560-4)를 통해 출력할 수 있다. 스위치(560)의 포트(560-1)가 비트 선택기(540)의 포트(540-2)에 대응하므로, 스위치(560)는 비트 선택기(540)로부터 출력되는 비트들을, 포트(560-4)를 통해 출력할 수 있다. 예를 들어, 스위치(560)의 포트(560-3)로 입력되는 신호(SEL)는, 제3 데이터 타입에 기반하는 수치 값들 Wc0, Wc1 및 Ic를 연산 회로(410)에 입력하는 컨트롤러로부터 제공될 수 있다.
도 6c를 참고하면, 상태(630)에서, 덧셈기(580)가 비활성화될 수 있다. 덧셈기(580)가 비활성화됨에 따라, 시프트 레지스터(570)는, 포트(570-1)로부터 수신된 비트들을, 포트(570-3)를 통해 출력할 수 있다. 예를 들어, 덧셈기(580)의 비활성화는, 시프트 레지스터(570)에서의 시프트 동작을 적어도 일시적으로 중단하는 것을 야기할 수 있다. 포트(570-3)가 연산 회로(410)의 제1 채널(O1)에 대응하고, 포트(540-2)로부터 출력되는 비트들이 스위치(560) 및 시프트 레지스터(570)에 의해 조절되지 않으므로, 연산 회로(410)는 제1 채널(O1)을 통해, 비트 선택기(540)의 포트(540-2)로부터 출력되는 비트들을 출력할 수 있다. 제1 채널(O1)을 통해 출력되는 비트들은, 수치 값들 Wc0, Ic의 곱에 대응할 수 있다.
일 실시예에 따른 연산 회로(410)의 비트 조정기(550)는, 포트(550-1)를 통해 포트(520-3)로부터 출력되는 비트들을 수신하는 것에 응답하여, 수신된 비트들 중 적어도 하나(예, 지정된 자릿수에 대응하는 비트)에 기반하여 하나 이상의 다른 비트들을 조절할 수 있다. 비트 조정기(550)는 조절된 하나 이상의 다른 비트들을, 포트(550-2)를 통해 연산 회로(410)의 제2 채널(O2)로 출력할 수 있다. 상기 조절된 하나 이상의 다른 비트들은, 수치 값들 Wc1, Ic의 곱에 대응할 수 있다. 제1 채널(O1) 및 제2 채널(O2) 각각에서 출력되는 수치 값들은, 도 4a의 제1 누적 회로(430-1) 및 제2 누적 회로(430-2) 각각에 저장될 수 있다. 제1 누적 회로(430-1) 및 제2 누적 회로(430-2) 각각에 저장되는 상기 수치 값들 각각의 비트들의 수는, 제3 데이터 타입의 4 비트들 이상의 수(예, 8 비트들)일 수 있다.
상술한 바와 같이, 일 실시예에 따른 연산 회로(410)는 상태(530)의 제3 데이터 타입에 기반하는 곱셈 연산을 수행하는 상태에서, 복수의 피승수들(예, 수치 값들 Wc0, Wc1) 승수(예, 수치 값 Ic) 사이의 곱셈 연산을 수행하여, 복수의 피승수들 각각에 승수를 곱한 결과를, 상이한 채널들(예, 제1 채널(O1) 및 제2 채널(O2))을 통해 출력할 수 있다. 상기 제3 데이터 타입과 구별되는 데이터 타입(예, 상태들(610, 620) 각각에 대응하는 제1 데이터 타입 및 제2 데이터 타입)에 기반하는 곱셈 연산을 수행하는 상태에서, 연산 회로(410)는 단일 피승수 및 단일 승수 사이의 곱셈 연산을 수행한 결과를, 단일 채널(예, 제1 채널(O1))을 통해 출력할 수 있다.
이하에서는 도 6c의 상태(630)에서, 일 실시예에 따른 연산 회로(410)가 복수의 피승수들(예, 수치 값들 Wc0, Wc1) 및 승수(예, 수치 값 Ic) 사이의 곱셈 연산을 수행하는 동작의 일 예가 설명된다.
도 7은 도 5의 연산 회로에서 부동 소수점 수의 가수(mantissa)와 관련된 곱셈기를 이용하여, 정수들의 곱셈 연산을 수행하는 동작을 설명하기 위한 도면이다. 도 7의 전자 장치는 도 1 내지 도 2, 도 4a 내지 도 4b, 도 5 및 도 6a 내지 도 6c의 전자 장치(101), 및/또는 도 3의 전자 장치의 일 예에 대응할 수 있다.
이하에서는, 예를 들어, 도 6c의 상태(630)와 같이, 4 비트들을 따라 정수를 나타내기 위한 지정된 데이터 타입(예, 도 6c의 제3 데이터 타입)에 기반하는 곱셈 연산을 수행하는 상태에서의 전자 장치의 동작이 설명된다. 예를 들어, 일 실시예에 따른 전자 장치의 NPU(예, 도 2의 NPU(210))가 CNN에 기반하는 기능을 실행하는 상태에서, NPU는 CNN에 기반하는 복수의 곱셈 연산들을 수행할 수 있다.
예를 들어, 1 × 1의 콘볼루션 연산을 수행할 때에, NPU는 2 × 2 × 1의 제1 매트릭스에 기반하는 복수의 수치 값들 및 1 × 1 × 1 × 2의 제2 매트릭스에 기반하는 복수의 수치 값들 사이의 콘볼루션 연산을 수행하여, 2 × 2 × 2의 제3 매트릭스에 기반하는 복수의 수치 값들을 획득할 수 있다. 상기 예시에서, 상기 제1 매트릭스는, 입력 데이터를 나타내는 매트릭스에 대응하고, 상기 제2 매트릭스는, 가중치를 나타내는 매트릭스에 대응할 수 있다. 상기 예시에서, 일 실시예에 따른 NPU는, NPU에 포함된 복수의 뉴럴 엔진들(예, 도 2의 뉴럴 엔진(240))에 포함된 복수의 연산 회로들(예, 도 4 내지 도 5 및 도 6a 내지 도 6c의 연산 회로(410)) 각각을 제어하여, 제1 매트릭스에 포함된 수치 값들 및 제2 매트릭스에 포함된 수치 값들의 조합에 기반하는 곱셈 연산을 수행할 수 있다. 상기 예시에서, 제1 매트릭스 및 제2 매트릭스 각각이 4 비트들을 따라 정수를 나타내기 위한 지정된 데이터 타입에 대응하는 경우, 일 실시예에 따른 NPU는 단일 연산 회로로부터, 제1 매트릭스에 포함된 수치 값 I0에 제2 매트릭스에 포함된 가중치들 W0, W1 각각을 적용한 수치 값들(W0 x I0, W1 x I0)을 동시에 획득할 수 있다. 이하에서는, 일 실시예에 따른 NPU의 연산 회로가, 상기 수치 값 I0 및 상기 가중치들 W0, W1에 기반하는 곱셈 연산을 수행하는 동작이 설명된다.
도 7을 참고하면, 연산 회로의 결합기(예, 도 5, 도 6a 내지 도 6c의 결합기(510))는 상기 가중치들 W0, W1 각각을 나타내는 비트들을, 서로 다른 포트들(예, 도 5, 도 6a 내지 도 6c의 포트들(510-1, 510-2))을 통해 수신할 수 있다. 상기 가중치들 W0, W1 각각을 나타내는 비트들의 개수는, 지정된 데이터 타입에 따른 개수(예, 4)에 대응할 수 있다.
일 실시예에 따른 연산 회로의 결합기는, 부동 소수점 수의 가수들 사이의 곱셈 연산을 수행하는 곱셈기를 이용하여 상기 가수들 미만의 비트들을 따라 나타내어진 정수들 사이의 곱셈 연산을 수행하기 위하여, 상기 정수들을 나타내는 비트들을 결합할 수 있다. 도 7을 참고하면, 결합기가 상이한 포트들을 통해 수신한 4 비트들로 나타내어진 가중치들 W0, W1을 결합하여 출력하는 12 개의 비트들(710)이 도시된다. 도 7을 참고하면, 결합기가 출력하는 비트들(710)은, 4 비트들로 나타내어진 가중치 W0에 부호 확장을 수행하여 획득된 12 비트들(712), 및 가중치 W1을 나타내는 4 비트들을 시프트하여 획득된 12 비트들(714)에 이진 덧셈 연산을 수행한 결과에 대응할 수 있다.
예를 들어, 가중치 W0이 -8에 대응하는 경우, 가중치 W0에 대응하는 이진 수치 값은 4 비트들에 기반하는 지정된 데이터 타입을 따라 1000로 나타낼 수 있다. 가중치 W0를 나타내는 비트들 1000로부터, 결합기는 부호 확장을 이용하여 12 비트들(712)을 획득할 수 있다. 예를 들어, 1000로 나타내어진 가중치 W0에 대응하는 12 비트들(712)은 111111111000 일 수 있다. 예를 들어, 가중치 W1이 -7에 대응하는 경우, 가중치 W1에 대응하는 이진 수치 값은 1001로 나타낼 수 있다. 이 경우, 결합기가 W1에 대응하는 상기 4 비트들을 시프트하여 획득하는 12 비트들(714)은 100100000000 일 수 있다. 가중치 W0이 -8에 대응하고, 가중치 W1이 -7에 대응하는 경우, 결합기가 출력하는 비트들(710)은 111111111000 및 100100000000 의 합에 대응할 수 있다. 예를 들어, 비트들(710)은 가중치들 W0, W1에 대하여, {W0 + W1 << 8}에 대응할 수 있다.
일 실시예에 따른 연산 회로의 곱셈기(예, 도 5, 도 6a 내지 도 6c의 곱셈기(520))는, 가중치들 W0, W1을 수신한 결합기로부터 출력되는 비트들(710) 및 수치 값 I0에 대응하는 비트들(720) 사이의 이진 곱셈 연산을 수행하여, 비트들(730)을 출력할 수 있다. 비트들(720)은, 4 비트들을 따라 나타내어진 수치 값 I0에 부호 확장을 수행하여 획득된 12 비트들을 포함할 수 있다. 예를 들어, 수치 값 I0가 -8(4 비트들을 따라 1000으로 표시됨)에 대응하는 경우, 비트들(720)은 111111111000 일 수 있다. 이 경우, 곱셈기로부터 출력되는 24 개의 비트들(730)은, 000000000011100001000000 일 수 있다.
일 실시예에서, 결합기가 가중치들 W0, W1 로부터 {W0 + W1 << 8}을 나타내는 비트들을 출력하므로, 곱셈기가 결합기로부터 출력되는 비트들 및 수치 값 I0를 나타내는 비트들 사이의 곱셈 연산을 수행한 결과 P는 수학식 2와 같이 나타낼 수 있다.
Figure PCTKR2022009974-appb-img-000002
곱셈기로부터 출력되는 비트들을 수신하는 연산 회로의 변환기(예, 도 5, 도 6a 내지 도 6c의 변환기(530))에 포함된 비트 선택기 및 비트 조정기는, 상기 수신된 비트들로부터 가중치 W0 및 수치 값 I0를 곱한 결과에 대응하는 제1 정수 P0 및 가중치 W1 및 수치 값 I0를 곱한 결과에 대응하는 제2 정수 P1을 출력할 수 있다. 예를 들어, 수학식 2의 P에 대하여, 변환기의 비트 선택기가 출력하는 제1 정수 P0는, P를 나타내는 비트들 중 LSB 및 LSB에 인접하는 7 비트들을 포함하는 8 비트들(P[7:0])에 대응할 수 있다. 도 7을 참고하면, 곱셈기로부터 출력되는 비트들(730)이 수학식 2의 P에 대응하므로, 변환기의 비트 조정기는 비트들(730) 중 낮은 자릿수에 배치된 8 비트들(740)을 추출하여, 제1 정수 P0를 획득할 수 있다.
예를 들어, 수학식 2의 P에 대하여, 변환기의 비트 조정기가 출력하는 제2 정수 P1은, 수학식 3과 같이 나타낼 수 있다. 예를 들어, 비트 조정기는, 부호 확장에 의한 변화를 보상하여, 상기 제2 정수 P1을 획득할 수 있다.
Figure PCTKR2022009974-appb-img-000003
수학식 3의 P[15:8]은, 곱셈기로부터 출력되는 비트들(730) 중 일부분(750)에 대응할 수 있다. 변환기의 비트 조정기는 일부분(750)에, 비트들(730) 중 지정된 자릿수에 대응하는 비트(예, P[7])를 포함하는 비트들(760)을 더하여, 수학식 3의 P1에 대응하는 비트들(770)을 획득할 수 있다. 예를 들어, 제1 정수 P0를 나타내는 비트들(740) 및 제2 정수 P1을 나타내는 비트들(770) 각각이, 도 5 및/또는 도 6c에서 상술한 바와 같이, 연산 회로의 제1 채널(O1) 및 제2 채널(O2)을 통해 출력될 수 있다.
가중치 W0 = -8, 가중치 W1 = -7, 수치 값 I0 = -8을 수신하는 상기 예시에서, 곱셈기로부터 출력되는 24 개의 비트들(730)은, P = 000000000011100001000000이다. 상기 예시에서, 연산 회로가 제1 채널(O1)을 통해 출력하는 제1 정수 P0를 나타내는 비트들은 P[7:0] = 01000000 이다. 이진 수치 값 01000000은 64 = (-8) × (-8)에 대응하므로, W0 × I0에 대응한다. 상기 예시에서, 연산 회로가 제2 채널(O2)를 통해 출력하는 제2 정수 P1을 나타내는 비트들은 P[15:8] + P[7] = 00111000 이다. 이진 수치 값 00111000 은 56 = (-8) × (-7)에 대응하므로, W1 × I0에 대응한다. 예를 들어, 연산 회로는 복수의 피승수들 각각에 승수를 곱한 결과(W0 × I0, W1 × I0)를 동시에 출력할 수 있다.
제1 채널(O1) 및 제2 채널(O2)을 통해 출력되고, 8 비트들에 기반하여, 제1 정수 P0 및 제2 정수 P1 각각을 나타내는 비트들(740, 770) 각각은, 예를 들어, 도 4a의 제1 누적 회로(430-1) 및 제2 누적 회로(430-2)에 누적될 수 있다. 제1 누적 회로(430-1) 및 제2 누적 회로(430-2) 각각에 누적되고, 상기 8 비트들에 기반하여 나타내어진, 수치 값들은, 뉴럴 엔진(예, 도 4a의 뉴럴 엔진(240))에 의하여 4 비트들을 따라 정수를 나타내기 위한 상기 지정된 데이터 타입으로 변환될 수 있다. 상기 지정된 데이터 타입으로 변환된 상기 수치 값들은, 뉴럴 네트워크의 특정 레이어에 포함된 노드들의 가중합에 대응할 수 있다.
상술한 바와 같이, 일 실시예에 따른 전자 장치의 연산 회로는 상이한 데이터 타입들(예, FP16, INT8, INT4)에 기반하는 하나 이상의 피승수들 및 승수 사이의 곱셈 연산을 수행할 수 있다. 일 실시예에 따른 전자 장치의 연산 회로가 단일 처리 사이클에 수행 가능한 곱셈 연산의 수는, 데이터 타입들 중에서 선택된 데이터 타입에 기반하여 차별화될 수 있다. 예를 들어, 수치 값을 나타내는 비트들의 수가 데이터 타입들을 따라 구별되는 경우, 상대적으로 적은 수의 비트들을 따라 수치 값을 나타내는 데이터 타입에 기반하여 동작하는 상태(예, 도 6c의 상태(630))에서, 전자 장치는 다른 데이터 타입 보다 많은 수의 곱셈 연산을 동시에 수행할 수 있다.
이하에서는 도 8, 도 9a 내지 도 9d 및/또는 도 10을 참고하여, 일 실시예에 따른 전자 장치의 NPU에 포함된 연산 회로의 다른 일 예가 설명된다.
도 8은 일 실시예에 따른 전자 장치(101)의 연산 회로(410)의 다른 일 예를 설명하기 위한 블록도이다. 도 8의 전자 장치(101)는 도 1 내지 도 2 및 도 4a 내지 도 4b의 전자 장치(101), 및/또는 도 3의 전자 장치의 일 예에 대응할 수 있다. 예를 들어, 도 5의 연산 회로(410)는 도 4b의 연산 회로(410)의 일 예에 대응할 수 있다.
도 8을 참고하면, 일 실시예에 따른 연산 회로(410)는, 결합기들(810 815), 곱셈기(520), 변환기(820), 덧셈기(580) 또는 이들의 조합을 포함할 수 있다. 일 실시예에 따른 연산 회로(410)는 하나 이상의 승수들 및 하나 이상의 피승수들에 기반하는 곱셈 연산을 수행할 수 있다. 예를 들어, 도 3의 복수의 레이어들 사이를 연결하는 연결선들 각각에 할당된 가중치들이, 상기 하나 이상의 승수들의 일 예에 대응하고, 도 3의 복수의 레이어들에 포함된 노드들 각각에 할당된 수치 값들이, 상기 하나 이상의 피승수들의 일 예에 대응한다.
도 8을 참고하면, 연산 회로(410)는, 하나 이상의 피승수들을 나타내는 비트들을 수신하기 위한 포트들(810-1, 810-2), 및 상기 하나 이상의 피승수들이 결합된 비트들을 출력하기 위한 포트(810-3)를 포함하는 결합기(810)를 포함할 수 있다. 유사하게, 연산 회로(410)는 하나 이상의 승수들을 나타내는 비트들을 수신하기 위한 포트들(815-1, 815-2), 및 상기 하나 이상의 승수들이 결합된 비트들을 출력하기 위한 포트(815-3)를 포함하는 결합기(815)를 포함할 수 있다. 연산 회로(410)는, 결합기(810)의 포트(810-3)에 연결된 포트(520-1), 결합기(915)의 포트(815-3)에 연결된 포트(520-2), 및 포트들(520-1, 520-2)로부터 수신된 비트들에 대응하는 이진 곱셈 연산을 수행한 결과에 대응하는 비트들을 출력하기 위한 포트(520-3)를 포함하는 곱셈기(520)를 포함할 수 있다. 연산 회로(410)는, 피승수를 나타내는 비트들 중 일부분을 수신하기 위한 포트(580-1), 승수를 나타내는 비트들을 수신하기 위한 포트(580-2), 및 포트들(580-1, 580-2)로부터 수신된 비트들에 대응하는 이진 덧셈 연산을 수행한 결과를 나타내는 비트들을 출력하기 위한 포트(580-3)를 포함하는 덧셈기(580)를 포함할 수 있다. 예를 들어, 연산 회로(410)의 포트들(810-1, 810-2, 815-1, 815-2, 580-1, 580-2)이, 연산 회로(410)가 하나 이상의 수치 값들을 수신하는 포트들에 대응할 수 있다. 도 8의 곱셈기(520) 및 덧셈기(580)는 도 5의 곱셈기(520) 및 덧셈기(580) 각각에 대응할 수 있다.
도 8을 참고하면, 일 실시예에 따른 연산 회로(410)는 곱셈기(520)의 포트(520-3) 및 덧셈기(580)의 포트(580-3)에 연결되어, 포트들(520-3, 580-3)로부터 수신되는 비트들에 기반하여, 4 개의 채널들(예, 제1 채널(O1) 내지 제4 채널(O4)) 중 적어도 하나로, 하나 이상의 수치 값들을 나타내는 비트들을 출력하는 변환기(820)를 포함할 수 있다. 예를 들어, 변환기(820)는 포트(580-3)로부터 출력되는 비트들 및/또는 연산 회로(410)에 입력되는 상기 하나 이상의 승수들 및/또는 상기 하나 이상의 피승수들의 데이터 타입에 따라 포트(520-3)로부터 출력되는 비트들을 변환하여, 상기 4 개의 채널들 중 적어도 하나를 통해 출력될 하나 이상의 수치 값들을 획득할 수 있다.
도 8을 참고하면, 변환기(820)는 곱셈기(520)의 포트(520-3)로부터 출력되는 비트들을 수신하기 위한 포트(825-1), 및 상기 포트(825-1)를 통해 수신된 비트들 중 일부분에 대응하는 비트들을 출력하기 위한 포트(825-2)를 포함하는 비트 선택기(825)를 포함할 수 있다. 변환기(820)는 곱셈기(520)의 포트(520-3)로부터 출력되는 비트들을 수신하기 위한 포트(830-1), 및 상기 수신된 비트들 중 적어도 하나를 변경하여 출력하는 포트(830-2)를 포함하는 비트 조정기(830)를 포함할 수 있다. 도 8의 비트 선택기(825) 및 비트 조정기(830) 각각은 도 4의 비트 선택기(540) 및 비트 조정기(550)에 대응할 수 있다.
도 8을 참고하면, 변환기(820)는 비트 조정기(825)의 포트(825-2)에 연결된 포트(840-1) 및 연산 회로(410)의 제2 채널(O2)에 대응하는 포트(840-2)를 포함하는 비트 조정기(840)를 포함할 수 있다. 변환기(820)는 비트 조정기(825)의 포트(825-2)에 연결된 포트(835-1), 및 포트(835-1)를 통해 수신된 비트들 중에서 일부분을 선택하여 출력하는 포트(835-2)를 포함하는 비트 선택기(835)를 포함할 수 있다.
도 8을 참고하면, 변환기(820)는 곱셈기(520)의 포트(520-3)에 연결된 포트(570-1), 및 덧셈기(580)의 포트(580-3)에 연결된 포트(570-2), 및 포트(570-2)로부터 수신된 비트들에 기반하여 포트(570-1)를 통해 수신된 비트들을 시프트한 결과를 나타내는 비트들이 출력되는 포트(570-3)를 포함하는 시프트 레지스터(570)를 포함할 수 있다. 도 8을 참고하면, 변환기(820)는 비트 선택기(835)의 포트(835-2)에 연결된 포트(560-1), 시프트 레지스터(570)의 포트(570-3)에 연결된 포트(560-2), 연산 회로(410)에 대응하는 컨트롤러(예, 도 4a 내지 도 4b의 컨트롤러(420))로부터 신호(SEL)를 수신하기 위한 포트(560-3), 및 상기 포트(560-3)에 의해 수신된 신호에 기반하여, 포트들(560-1, 560-2) 중 어느 한 포트의 비트들을 출력하기 위한 포트(560-4)를 포함하는 스위치(560)를 포함할 수 있다. 도 8의 시프트 레지스터(570) 및 스위치(560) 각각은 도 5의 시프트 레지스터(570) 및 스위치(560)에 대응할 수 있다. 스위치(560)의 포트(560-4)는 연산 회로(410)의 제1 채널(O1)에 대응할 수 있다.
도 8을 참고하면, 변환기(820)는 비트 조정기(830)의 포트(830-2)에 연결된 포트(845-1) 및 연산 회로(410)의 제3 채널(O3)에 대응하는 포트(845-2)를 포함하는 비트 선택기(845)를 포함할 수 있다. 변환기(820)는 비트 조정기(830)의 포트(830-2)에 연결된 포트(850-1), 및 연산 회로(410)의 제4 채널(O4)에 대응하는 포트(850-2)를 비트 조정기(850)를 포함할 수 있다. 비트 조정기들(840, 850) 각각은 포트들(840-1, 850-1)로부터 수신된 비트들 중 적어도 하나를 변경한 결과를 포트들(840-2, 850-2)을 통해 출력할 수 있다. 비트 선택기들(835, 845) 각각은 포트들(835-1, 845-1)로부터 수신된 비트들 중 일부분을 선택하여, 포트들(835-2, 845-2)로 출력할 수 있다.
일 실시예에서, 변환기(820)가 연산 회로(410)의 컨트롤러(예, 도 4a 내지 도 4b의 컨트롤러(420))에 의해 제어됨에 따라, 곱셈기(520)의 포트(520-3)로부터 출력되는 비트들이, 연산 회로(410)로 입력되는 수치 값들에 대응하는 데이터 타입에 기반하여 조절되거나, 및/또는 분할될 수 있다. 예를 들어, 변환기(820) 내에서의 신호 경로가 상기 데이터 타입에 따라 변경될 수 있다. 연산 회로(410)에 대응하는 컨트롤러는 상기 데이터 타입에 따라 연산 회로(410)의 포트들(810-1, 810-2, 815-1, 815-2, 580-1, 580-2)로 입력되는 비트들을 변경할 수 있다. 연산 회로(410)에 대응하는 컨트롤러는 상기 데이터 타입에 따라 결합기들(810, 815) 및/또는 덧셈기(580)를 선택적으로 활성화할 수 있다.
이하에서는, 도 9a 내지 도 9d를 참고하여, 일 실시예에 따른 연산 회로(410)에서, 연산 회로(410)가 수신하는 수치 값들의 데이터 타입에 따라 조절되는 신호 경로들이 설명된다.
도 9a 내지 도 9d들은 도 5의 연산 회로의 서로 다른 상태들(910, 920, 930, 940)을 설명하기 위한 도면들이다. 도 9a 내지 도 9d들의 전자 장치(101)는 도 1 내지 도 2, 도 4a 내지 도 4b 및 도 8의 전자 장치(101), 및/또는 도 3의 전자 장치의 일 예에 대응할 수 있다. 예를 들어, 도 9a 내지 도 9d의 연산 회로(410)는 도 4b의 연산 회로(410) 및/또는 도 8의 연산 회로(410)의 일 예에 대응할 수 있다.
도 9a는 부동 소수점 수를 나타내기 위한 제1 데이터 타입에 기반하는 곱샘 연산을 수행하는 상태(910)에서의 연산 회로(410)의 동작을 설명하기 위한 예시적인 도면이다. 예를 들어, 상기 제1 데이터 타입은 도 6a에서 상술한 IEEE 754의 반-정밀도 부동 소수점 포맷의 데이터 타입(FP16)에 대응할 수 있다. 이하에서는, 상기 반-정밀도 부동 소수점 포맷에 대응하는 제1 데이터 타입에 기반하는 곱셈 연산을 수행하는 상태(910)에서, 전자 장치(101)가 연산 회로(410)를 이용하여 수치 값 Wa 및 수치 값 Ia의 곱셈 연산을 수행하는 동작이 설명된다. 예를 들어, 수치 값 Wa는 도 3의 연결선에 할당된 가중치 및/또는 CNN에서의 커널을 나타내는 매트릭스의 원소들 중 하나일 수 있다. 예를 들어, 수치 값 Ia는 도 3의 노드에 할당된 수치 값 및/또는 CNN에서의 커널을 나타내는 매트릭스에 적용될 다른 매트릭스의 원소들 중 하나일 수 있다. 이하에서는, 수치 값들 Wa_s, Wa_e, Wa_M 각각은 제1 데이터 타입에서 수치 값 Wa의 부호, 지수 및 가수에 대응하고, 수치 값들 Ia_s, Ia_e, Ia_M 각각은 제1 데이터 타입에서 수치 값 Ia의 부호, 지수 및 가수에 대응하는 것으로 가정한다.
도 9a를 참고하면, 상태(910)에서, 수치 값들 Wa, Ia 각각의 가수들 Wa_M 및 Ia_M들이, 곱셈기(520)의 포트들(520-1, 520-2)로 입력될 수 있다. 예를 들어, 연산 회로(410)의 결합기들(810, 815)이 상태(910)에서 비활성화됨에 따라, 결합기들(810, 815)의 포트들(810-1, 815-1) 각각으로 입력되는 가수들 Ia_M, Wa_M이, 결합기들(810, 815)을 바이패스하여, 곱셈기(520)의 포트들(520-1, 520-2)로 송신될 수 있다. 결합기들(810, 815)의 비활성화는, 연산 회로(410) 및/또는 연산 회로(410)에 연결된 컨트롤러(예, 도 4a 내지 도 4b의 컨트롤러(420)에 의해 제어될 수 있다.
일 실시예에 따른 곱셈기(520)는 13 비트들 및 12 비트들에 의해 각각 나타내어진(respectively indicated by) 수치 값들에 대한 곱셈 연산을 수행할 수 있다. 예를 들어, 포트(520-1)를 통하여, 곱셈기(520)는 13 비트들을 따라 나타낸 수치 값을 수신할 수 있다. 포트(520-2)를 통하여, 곱셈기(520)는 12 비트들을 따라 나타낸 수치 값을 수신할 수 있다. 포트들(520-1, 520-2) 각각을 통하여, 10 비트들에 기반하여 나타내어지는 Ia_M 및 Wa_M들을 수신하는 경우, 곱셈기(520)는 부호 확장을 이용하여 13 비트들에 의해 나타내어지는 Ia_M, 및 12 비트들에 의해 나타내어지는 Wa_M을 획득할 수 있다. 상기 부호 확장은, 예를 들어, 수치 값들 Wa, Ia 각각의 부호를 나타내는 Wa_s 및 Ia_s 각각에 기반하여 수행될 수 있다. 일 실시예에서, 곱셈기(520)는 13 비트들 및 12 비트들에 의해 각각 나타내어진 Ia_M 및 Wa_M에 대한 곱셈 연산을 수행할 수 있다. 곱셈기(520)는 포트(520-3)를 통하여, 예를 들어, 24 비트들에 의해 나타내어지는 Ia_M 및 Wa_M의 곱(product)을 출력할 수 있다.
도 9a를 참고하면, 상태(910)에서, 수치 값들 Wa, Ia 각각의 지수들 Wa_e 및 Ia_e들이, 덧셈기(580)의 포트들(580-1, 580-2)로 입력될 수 있다. 덧셈기(580)는 상태(610)에서 연산 회로(410) 및/또는 연산 회로(410)에 연결된 컨트롤러에 의해 활성화될 수 있다. 덧셈기(580)는, 5 비트들에 의해 나타내어진 Wa_e 및 Ia_e에 대한 덧셈 연산을 수행하여, 포트(580-3)를 통하여, Wa_e 및 Ia_e의 합(sum)을 출력할 수 있다.
도 9a를 참고하면, 시프트 레지스터(570)는 포트(570-1)를 통하여, 곱셈기(520)로부터 출력된 Ia_M 및 Wa_M의 곱을 수신할 수 있다. Ia_M 및 Wa_M의 곱을 수신한 상태에서, 포트(570-2)를 통해 Wa_e 및 Ia_e의 합을 수신함에 따라, 시프트 레지스터(570)는 수신된 Wa_e 및 Ia_e의 합에 기반하여, Ia_M 및 Wa_M의 곱을 시프트할 수 있다. Wa_e 및 Ia_e의 합에 기반하여 Ia_M 및 Wa_M의 곱을 시프트하는 것은, 부동 소수점 수의 가수를 정규화하는 동작에 대응할 수 있다. 시프트 레지스터(570)는, 상태(910)에서, 포트(570-2)를 통하여, 정규화된 Ia_M 및 Wa_M의 곱, 및 덧셈기(580)로부터 수신된 Wa_e 및 Ia_e의 합에 기반하여, 부동 소수점 수들 Wa 및 Ia의 곱을 나타내는 비트들을 출력할 수 있다.
도 9a를 참고하면, 상태(910)에서, 변환기(820)에 포함된 비트 선택기(825) 및 비트 조정기(830)가 비활성화될 수 있다. 비트 선택기(825) 및 비트 조정기(830)가 비활성화됨에 따라, 비트 선택기(825) 및 비트 조정기(830)에 연결된 비트 선택기들(835, 845) 및 비트 조정기들(840, 850)이 비활성화될 수 있다. 상태(910)에서 변환기(820)의 스위치(560)는, 포트들(560-1, 560-2) 중 시프트 레지스터(570)의 포트(570-3)에 대응하는 포트(560-2)를, 제1 채널(O1)에 대응하는 포트(560-4)로 연결할 수 있다. 스위치(560)에서의 포트들(560-2, 560-4) 사이의 연결은, 포트(560-3)를 통해 입력되고, 예를 들어, 연산 회로(410)에 대응하는 컨트롤러로부터 제공된, 신호(SEL)에 의해 수립될 수 있다. 포트들(560-2, 560-4)이 서로 연결됨에 따라, 곱셈기(520)의 포트(520-3)로부터 출력되는 비트들이 스위치(560)의 포트(560-4)를 통해 출력될 수 있다.
상술한 바와 같이, 상태(610)에서, 일 실시예에 따른 전자 장치(101)의 연산 회로(410)는 시프트 레지스터(570)에 저장된 비트들을, 제1 채널(O1)을 통해 출력할 수 있다. 예를 들어, 연산 회로(410)는 시프트된 Ia_M 및 Wa_M의 곱을 나타내는 비트들, Wa_e 및 Ia_e의 합을 나타내는 비트들 및 Ia_M 및 Wa_M의 곱의 부호를 나타내는 비트를 연접하여, 상기 제1 데이터 타입의 16 비트들 이상의 개수의 비트들(예, 32 비트들)에 따라 Wa 및 Ia의 곱을 나타내는 비트들을 출력할 수 있다. 제1 채널(O1)을 통해 출력되고, Wa 및 Ia의 곱을 나타내는, 비트들은, 예를 들어, 도 4b의 제1 누적 회로(430-1)에 저장될 수 있다.
도 9b는 정수를 나타내기 위한 제2 데이터 타입에 기반하는 곱셈 연산을 수행하는 상태(920)에서의 연산 회로(410)의 동작을 설명하기 위한 예시적인 도면이다. 예를 들어, 상기 제2 데이터 타입은 도 9b의 데이터 타입(INT8)에 대응할 수 있다.
이하에서는, 8 비트들을 따라 정수를 나타내기 위한 제2 데이터 타입에 기반하는 곱셈 연산을 수행하는 상태(920)에서, 전자 장치(101)가 연산 회로(410)를 이용하여 수치 값 Wb 및 수치 값 Ib의 곱셈 연산을 수행하는 동작이 설명된다. 예를 들어, 수치 값 Wb는 도 3의 연결선에 할당된 가중치 및/또는 CNN에서의 커널을 나타내는 매트릭스의 원소들 중 하나일 수 있다. 예를 들어, 수치 값 Ib는 도 3의 노드에 할당된 수치 값 및/또는 CNN에서의 커널을 나타내는 매트릭스에 적용될 다른 매트릭스의 원소들 중 하나일 수 있다.
도 9b를 참고하면, 상태(920)에서, 수치 값들 Wb, Ib이, 곱셈기(520)의 포트들(520-1, 520-2)로 입력될 수 있다. 도 9a의 상태(910)와 유사하게, 연산 회로(410)의 결합기들(810, 815)가 비활성화됨에 따라, 결합기들(810, 815)의 포트들(810-1, 815-1)로 입력되는 수치 값들 Ib, Wb이, 결합기들(810, 815)을 바이패스하여, 곱셈기(520)의 포트들(520-1, 520-2) 각각으로 송신될 수 있다.
일 실시예에 따른 곱셈기(520)는 부호 확장을 이용하여 13 비트들에 의해 나타내어지는 Ib, 및 12 비트들에 의해 나타내어지는 Wb를 획득할 수 있다. 상기 부호 확장은, 예를 들어, 수치 값들 Wb 및 Ib 각각의 부호를 나타내는 비트(예, 수치 값들 Wb 및 Ib를 나타내는 비트들의 MSB)에 기반하여 수행될 수 있다. 곱셈기(520)는 포트(520-3)를 통하여, 예를 들어, 24 비트들에 의해 나타내어지는 Wb 및 Ib의 곱을 출력할 수 있다.
도 9b를 참고하면, 상태(620)에서, 덧셈기(580)가 비활성화되거나, 또는 지정된 수치 값(예, 0)을 나타내는 비트들이 덧셈기(580)의 포트들(580-1, 580-2)로 입력될 수 있다. 덧셈기(580)의 비활성화는, 예를 들어, 제2 데이터 타입에 기반하는 곱셈 연산을 수행하라는 요청을 식별한 연산 회로(410) 및/또는 연산 회로(410)에 연결된 컨트롤러에 의해 수행될 수 있다. 덧셈기(580)가 비활성화됨에 따라, 덧셈기(580)가 시프트 레지스터(570)의 포트(570-2)로 송신하는 비트들은, 시프트 레지스터(570)에 의한 비트들의 시프트를 적어도 일시적으로 중단하는 지정된 수치 값(예, 0)을 나타낼 수 있다.
도 9b를 참고하면, 상태(920)에서, 상태(910)와 유사하게, 변환기(820)에 포함된 비트 선택기들(825, 835, 845) 및 비트 조정기들(830, 840, 850)이 비활성화될 수 있다. 상태(920)에서, 변환기(820)의 스위치(560)는, 시프트 레지스터(570)의 포트(570-3)에 대응하는 포트(560-2)를, 포트(560-3)를 통해 수신되는 신호(SEL)에 기반하여, 포트(560-4)로 연결할 수 있다. 이 경우, 시프트 레지스터(570)의 포트(570-3)로부터 출력되고, Wb 및 Ib의 곱을 나타내는 비트들이, 포트(560-4)를 통해 연산 회로(410)의 제1 채널(O1)로 출력될 수 있다. 덧셈기(580)가 비활성화됨에 따라, 시프트 레지스터(570)의 포트(570-3)에서, 포트(570-1)로 입력된 비트들이 시프트와 독립적으로 출력될 수 있다. 예를 들어, 연산 회로(410)의 제1 채널(O1)로, Wb 및 Ib의 곱을 나타내는 비트들(예, 제2 데이터 타입의 8 비트들 이상의 수의 비트들)이 출력될 수 있다. 제1 채널(O1)을 통해 출력되고, Wb 및 Ib의 곱을 나타내는, 비트들은, 예를 들어, 도 4a의 제1 누적 회로(430-1)에 저장될 수 있다.
도 9c는 도 9b의 제2 데이터 타입과 구별되고, 정수를 나타내기 위한, 제3 데이터 데이터 타입에 기반하는 곱셈 연산을 수행하는 상태(930)에서의 연산 회로(410)의 동작을 설명하기 위한 예시적인 도면이다. 상기 제3 데이터 타입은, 예를 들어, 도 6c의 데이터 타입(INT4)에 대응할 수 있다. 이하에서는, 4 비트들을 따라 정수를 나타내기 위한 제3 데이터 타입에 기반하는 곱셈 연산을 수행하는 상태(930)에서, 전자 장치(101)가 연산 회로(410)를 이용하여 수치 값 Wc0, 수치 값 Wc1 및 수치 값 Ic의 곱셈 연산을 수행하는 동작이 설명된다. 예를 들어, 수치 값 Wc0 및 수치 값 Wc1은 도 3의 연결선에 할당된 가중치 및/또는 CNN에서의 커널을 나타내는 매트릭스의 원소들 중 하나일 수 있다. 예를 들어, 수치 값 Ic는 도 3의 노드에 할당된 수치 값 및/또는 CNN에서의 커널을 나타내는 매트릭스에 적용될 다른 매트릭스의 원소들 중 하나일 수 있다. 제3 데이터 타입에 기반하는 곱셈 연산은, 제1 채널(O1) 및 제2 채널(O2) 중 제1 채널(O1)이 이용되는 상태들(910, 920)과 독립적으로, 제1 채널(O1) 및 제3 채널(O3) 전부의 활성화를 야기할 수 있다. 일 실시예에 따른 전자 장치(101)는 피승수들(예, 수치 값 Wc0, 수치 값 Wc1) 각각에 승수(예, 수치 값 Ic)를 적용한 결과에 대응하는 두 수치 값들(예, Wc0 Х Ic 및 Wc1 Х Ic)을, 제1 채널(O1) 및 제3 채널(O2)을 통해 출력할 수 있다.
도 9c를 참고하면, 상태(930)에서, 수치 값들 Wc0, Wc1이, 결합기(815)의 포트들(815-1, 815-2)로 입력될 수 있다. 제3 데이터 타입에 기반하는 곱셈 연산을 수행하라는 요청을 식별하는 것에 응답하여, 전자 장치(101)의 연산 회로(410) 및/또는 연산 회로(410)에 대응하는 컨트롤러는 결합기(815)를 활성화할 수 있다. 활성화된 상태에서, 일 실시예에 따른 결합기(815)는 포트들(815-1, 815-2) 각각을 통해 수신되고, 수치 값들 Wc0, Wc1 각각에 대응하는 비트들을 결합할 수 있다. 결합기(815)가 수치 값들 Wc0, Wc1 각각에 대응하는 비트들을 결합하는 것은 도 6c의 결합기(510)의 동작과 유사하게 수행될 수 있다.
도 9c를 참고하면, 상태(930)에서, 곱셈기(520)는 포트(520-1)를 통해 수신되는 수치 값 Ic를 나타내는 비트들, 및 포트(520-2)를 통해 수신되고, 결합기(815)의 포트(815-3)에서 출력되는 비트들의 곱셈 연산을 수행할 수 있다. 결합기(815)가 활성화된 상태(930)에서, 수치 값 Ic를 수신하는 결합기(810)는 비활성화될 수 있다. 결합기(810)가 비활성화됨에 따라, 포트(810-1)를 통해 수신된 수치 값 Ic는 결합기(810)를 바이패스하여 곱셈기(520)의 포트(520-1)로 송신될 수 있다. 곱셈기(520)는 포트(520-3)를 통해, 포트들(520-1, 520-2)을 통해 수신된 비트들의 곱셈 연산을 수행한 결과를 출력할 수 있다.
도 9c를 참고하면, 상태(930)에서, 변환기(820)에 포함된 비트 선택기들(825, 835, 845) 및 비트 조정기(830)가 활성화될 수 있다. 비트 선택기(825)는 포트(825-1)를 통해 곱셈기(502)의 포트(520-3)로부터 출력되는 비트들을 수신할 수 있다. 상기 비트들을 수신하는 것에 응답하여, 비트 선택기(825)는 수신된 비트들 중 일부분(예, LSB 및 LSB와 연접하는 7 개의 비트들을 포함하는 8 개의 비트들)을 추출할 수 있다. 비트 선택기(825)는 추출된 비트들을, 포트(825-2)를 통해 출력할 수 있다. 비트 선택기(835)는 비트 선택기(825)의 포트(825-2)에 연결된 포트(835-1)를 통해, 비트 선택기(825)에 의해 선택된 비트들을 수신할 수 있다. 비트 선택기(835)는 포트(835-1)를 통해 수신된 비트들 중 일부분(예, LSB 및 LSB와 연접하는 4 개의 비트들)을 추출하여, 포트(835-2)를 통해 출력할 수 있다. 스위치(560)는, 포트(560-3)를 통해 수신되는 신호(SEL)에 기반하여, 포트들(560-1, 560-2) 중에서 포트(560-1)로부터 수신되는 비트들을, 포트(560-4)를 통해 출력할 수 있다. 스위치(560)의 포트(560-1)가 비트 선택기(835)의 포트(835-2)에 대응하므로, 스위치(560)는 비트 선택기(835)로부터 출력되는 비트들을, 포트(560-4)를 통해 출력할 수 있다. 예를 들어, 제1 채널(O1)을 통해 출력되는 비트들은, 수치 값들 Wc0, Ic의 곱에 대응할 수 있다.
도 9c를 참고하면, 상태(930)에서, 덧셈기(580)가 비활성화될 수 있다. 덧셈기(580)가 비활성화됨에 따라, 시프트 레지스터(570)는, 포트(570-1)로부터 수신된 비트들을, 포트(570-3)를 통해 직접적으로 출력할 수 있다.
일 실시예에 따른 연산 회로(410)의 비트 조정기(830)는, 포트(830-1)를 통해 포트(520-3)로부터 출력되는 비트들을 수신하는 것에 응답하여, 수신된 비트들 중 적어도 하나(예, 지정된 자릿수에 대응하는 비트)에 기반하여 하나 이상의 다른 비트들을 조절할 수 있다. 비트 조정기(830)는 조절된 하나 이상의 다른 비트들을, 포트(830-2)를 통해 출력할 수 있다. 비트 조정기(830)의 포트(830-1)에 연결된 포트(845-1)를 포함하는 비트 선택기(845)는, 비트 조정기(830)에 의해 조정된 비트들 중 일부분(예, LSB 및 LSB와 연접하는 4 개의 비트들)을 추출하여, 제3 채널(O3)에 대응하는 포트(840-2)를 통해 출력할 수 있다. 제3 채널(O3)을 통해 출력되는 비트들은, 수치 값들 Wc1, Ic의 곱에 대응할 수 있다. 제1 채널(O1) 및 제3 채널(O3) 각각에서 출력되는 수치 값들은, 도 4b의 제1 누적 회로(430-1) 및 제3 누적 회로(430-3) 각각에 저장될 수 있다. 제1 누적 회로(430-1) 및 제3 누적 회로(430-3) 각각에 저장되는 상기 수치 값들 각각의 비트들의 수는, 제3 데이터 타입의 4 비트들 이상의 수(예, 8 비트들)일 수 있다.
상술한 바와 같이, 일 실시예에 따른 연산 회로(410)는 상태(930)의 제3 데이터 타입에 기반하는 곱셈 연산을 수행하는 상태에서, 복수의 피승수들(예, 수치 값들 Wc0, Wc1) 승수(예, 수치 값 Ic) 사이의 곱셈 연산을 수행하여, 복수의 피승수들 각각에 승수를 곱한 결과를, 상이한 채널들(예, 제1 채널(O1) 및 제2 채널(O2))을 통해 출력할 수 있다. 도 9c의 상태(930)에서, 연산 회로(410)가 복수의 피승수들(예, 수치 값들 Wc0, Wc1) 승수(예, 수치 값 Ic) 사이의 곱셈 연산을 수행하는 동작은 도 6c 및/또는 도 7과 유사하게 수행될 수 있다.
도 9d는 도 9c의 제2 데이터 타입과 구별되고, 정수를 나타내기 위한, 제4 데이터 타입에 기반하는 곱셈 연산을 수행 하는 상태(940)에서의 연산 회로(410)의 동작을 설명하기 위한 예시적인 도면이다. 상기 제4 데이터 타입은, 예를 들어, 2 비트들을 따라 고정 소수점 수 또는, 정수를 나타내기 위한 데이터 타입(INT2)에 대응할 수 있다. 이하에서는, 2 비트들을 따라 정수를 나타내기 위한 제4 데이터 타입에 기반하는 곱셈 연산을 수행하는 상태(940)에서, 전자 장치(101)가 연산 회로(410)를 이용하여 수치 값들 Wd0, Wd1 중 어느 하나 및 수치 값들 Id0, Id1 중 어느 하나의 조합의 곱들을 획득하는 동작이 설명된다. 예를 들어, 수치 값들 Id0, Id1는 뉴럴 네트워크의 복수의 레이어들 중 특정 레이어에 입력될 입력 데이터에 포함된 수치 값들이다. 예를 들어, 수치 값들 Wd0, Wd1은 상기 특정 레이어에 대응하는 가중치들이다. 일 실시예에 따른 전자 장치(101)는, 제4 데이터 타입에 기반하는 곱셈 연산들을 수행하는 상태(940)에서, 제1 채널(O1) 내지 제4 채널(O4) 전부를 활성화할 수 있다. 예를 들어, 전자 장치(101)는 피승수들(예, 수치 값들 Wd0, Wd1) 각각에 승수들(예, 수치 값들 Id0, Id1)을 적용한 결과에 대응하는 4 개의 수치 값들(예, Wd0 Х Id0, Wd1 × Id0, Wd0 × Id1 및 Wd1 Х Id1)을, 제1 채널(O1) 내지 제4 채널(O4) 각각을 통해 출력할 수 있다.
도 9d를 참고하면, 상태(940)에서, 결합기(810)가 활성화됨에 따라, 포트들(810-1, 810-2)로 입력되는 승수들(예, 수치 값들 Id0, Id1)이 결합기(810)에 의해 결합될 수 있다. 예를 들어, 결합기(810)의 포트(810-3)를 통해 출력되는 비트들은, 상기 승수들을 상이한 자릿수를 통해 나타낼 수 있다. 상태(940)에서, 결합기(815)가 활성화됨에 따라, 포트들(815-1, 815-2)로 입력되는 피승수들(예, 수치 값들 Wd0, Wd1)이 결합기(815)에 의해 결합될 수 있다. 예를 들어, 결합기(815)의 포트(815-3)를 통해 출력되는 비트들은, 상기 피승수들을 상이한 자릿수를 통해 나타낼 수 있다. 일 실시예에 따른 전자 장치(101)의 결합기들(810, 815)이 수치 값들을 결합하는 동작은 도 10에서 후술된다.
도 9d를 참고하면, 상태(940)에서, 곱셈기(520)는 포트들(520-1, 520-2) 각각을 통해 수신되는 피승수들의 결합 및 승수들의 결합 각각을 나타내는 비트들의 곱셈 연산을 수행할 수 있다. 곱셈기(520)는 포트(520-3)를 통해, 곱셈 연산을 수행한 결과를 출력할 수 있다. 상태(940)에서, 연산 회로(410)의 덧셈기(580)는 비활성화될 수 있다.
도 9d를 참고하면, 제4 데이터 타입에 기반하는 곱셈 연산을 수행하는 상태(940)에서, 비트 선택기들(825, 835, 845) 및 비트 조정기들(830, 840, 850)이 활성화될 수 있다. 비트 선택기(825)는, 도 9c의 상태(930)에서의 비트 선택기(825) 및/또는 도 6c의 비트 선택기(540)와 유사하게, 곱셈기(520)로부터 출력되는 비트들(예, 포트(520-3)로부터 출력되는 비트들 중 일부분(예, LSB 및 LSB와 연접하는 7 개의 비트들을 포함하는 8 개의 비트들)을 추출할 수 있다. 비트 선택기(825)는 추출된 비트들을, 포트(825-2)를 통해 출력할 수 있다.
도 9d를 참고하면, 비트 선택기(835)는, 도 9c의 상태(930)와 유사하게, 포트(835-1)를 통해 수신되고, 포트(825-2)로부터 출력되는, 비트들 중 일부분을 추출하여, 포트(835-2)를 통해 출력할 수 있다. 스위치(560)가 도 9c의 상태(930)와 유사하게 제어됨에 따라, 포트(835-2)를 통해 출력되는 비트들이, 연산 회로(410)의 제1 채널(O1)을 통해 출력될 수 있다. 예를 들어, 제1 채널(O1)을 통해 출력되는 비트들은, 수치 값들 Wd0 Х Id0의 곱을 나타낼 수 있다. 비트 조정기(840)는 포트(840-1)를 통해 수신되고, 포트(825-2)로부터 출력되는, 비트들 중 적어도 하나를 조정하여, 제2 채널(O2)에 대응하는 포트(840-2)를 통해 출력할 수 있다. 제2 채널(O2)을 통해 출력되는 비트들은, 수치 값들 Wd1 × Id0의 곱을 나타낼 수 있다.
도 9d를 참고하면, 비트 조정기(830)는 도 9c의 상태(930)에서의 비트 선택기(830) 및/또는 도 6c의 비트 조정기(550)와 유사하게, 곱셈기(520)로부터 출력되는 비트들 중 적어도 하나에 기반하여 하나 이상의 다른 비트들을 조절한 결과를, 포트(830-2)를 통해 출력할 수 있다. 포트(830-2)를 통해 출력된 비트들은, 비트 선택기(845)의 포트(845-1) 및 비트 조정기(850)의 포트(850-1)로 송신될 수 있다. 비트 선택기(845)는, 상태(930)와 유사하게, 포트(845-1)를 통해 수신된 비트들 중 일부분을 추출하여, 제3 채널(O3)에 대응하는 포트(840-2)로 출력할 수 있다. 제3 채널(O3)을 통해 출력되는 비트들은, 수치 값들 Wd0 × Id1의 곱을 나타낼 수 있다. 비트 조정기(850)는 포트(850-1)를 통해 수신된 비트들을 조정한 결과를 제4 채널(O4)에 대응하는 포트(850-2)를 통해 출력할 수 있다. 제4 채널(O4)을 통해 출력되는 비트들은, 수치 값들 Wd1 Х Id1의 곱을 나타낼 수 있다. 제1 채널(O1) 내지 제4 채널(O4) 각각에서 출력되는 수치 값들은, 도 4b의 제1 누적 회로(430-1) 내지 제4 누적 회로(430-4) 각각에 저장될 수 있다. 제1 누적 회로(430-1) 내지 제4 누적 회로(430-4) 각각에 저장되는 상기 수치 값들 각각의 비트들의 수는, 제4 데이터 타입의 제2 비트들 이상의 수(예, 4 비트들)일 수 있다.
이하에서는 도 9d의 상태(940)에서, 일 실시예에 따른 연산 회로(410)가 복수의 피승수들(예, 수치 값들 Wd0, Wd1) 및 복수의 승수들(예, 수치 값 Id0, Id1) 사이의 곱셈 연산을 수행하는 동작의 일 예가 설명된다.
도 10은 도 8의 연산 회로에서 부동 소수점 수의 가수와 관련된 곱셈기를 이용하여, 정수들의 곱셈 연산을 수행하는 동작을 설명하기 위한 도면이다. 도 10의 전자 장치는 도 1 내지 도 2, 도 4a 내지 도 4b, 도 8 및 도 9a 내지 도 9d의 전자 장치(101), 및/또는 도 3의 전자 장치의 일 예에 대응할 수 있다.
이하에서는, 예를 들어, 도 9d의 상태(940)와 같이, 2 비트들을 따라 정수를 나타내기 위한 지정된 데이터 타입(예, 도 9d의 제4 데이터 타입)에 기반하여, 일 실시예에 따른 전자 장치가 복수의 피승수들(예, 수치 값들 Wd0, Wd1) 및 복수의 승수들(예, 수치 값 Id0, Id1) 사이의 곱셈 연산을 수행하는 동작이 설명된다.
일 실시예 따른 연산 회로의 제1 결합기(예, 도 9d의 결합기(810))는, 복수의 승수들(예, 수치 값 Id0, Id1)을 수신하는 것에 응답하여, 복수의 승수들 각각을 나타내는 비트들을 결합할 수 있다. 도 10을 참고하면, 상기 제1 결합기가 2 비트들로 나타내어진 수치 값들 Id0, Id1을 결합하여 출력하는 12 개의 비트들(1020)이 도시된다. 제1 결합기가 출력하는 비트들(1020)은, 2 비트들로 나타내어진 수치 값 Id0에 부호 확장을 수행하여 획득된 11 비트들(1021), 및 수치 값 Id1을 나타내는 2 비트들을 시프트하여 획득된 11 비트들(1022)에 이진 덧셈 연산을 수행한 결과에 대응할 수 있다. 예를 들어, 상기 제1 결합기는 11 비트들에 기반하는 이진 덧셈 연산을 수행할 수 있다. 예를 들어, 수치 값들 Id0, Id1 각각이 1, -2에 대응하는 경우, 비트들(1021)은 수치 값 Id0에 부호 확장을 수행하여, 00000000001 이고, 비트들(1022)은 수치 값 Id1을 시프트하여, 10000000000 이다.
일 실시예 따른 연산 회로의 제2 결합기(예, 도 9d의 결합기(815))는 복수의 피승수들(예, 가중치 Wd0, Wd1)을 수신하는 것에 응답하여, 복수의 피승수들 각각을 나타내는 비트들을 결합할 수 있다. 도 10을 참고하면, 상기 제2 결합기가 2 비트들로 나타내어진 가중치들 Wd0, Wd1을 결합하여 출력하는 7 개의 비트들(1010)이 도시된다. 제2 결합기가 출력하는 비트들(1010)은, 2 비트들로 나타내어진 가중치 Wd0에 부호 확장을 수행하여 획득된 6 비트들(1011), 및 가중치 Wd1을 나타내는 2 비트들을 시프트하여 획득된 6 비트들(1012)에 이진 덧셈 연산을 수행한 결과에 대응할 수 있다. 예를 들어, 상기 제2 결합기는 6 비트들에 기반하는 이진 덧셈 연산을 수행할 수 있다. 예를 들어, 가중치들 Wd0, Wd1 각각이 -2, -1인 경우, 비트들(1011)은 가중치 Wd0의 부호 확장된 이진값 111110이고, 비트들(1012)은 가중치 Wd1을 시프트하여 획득된 이진 값 110000이다.
일 실시예에 따른 연산 회로의 곱셈기는, 제1 결합기 및 제2 결합기 각각에서 출력되는 비트들(1010, 1020) 사이의 이진 곱셈 연산을 수행하여, 비트들(1030)을 출력할 수 있다. 상기 예시에서(가중치들 Wd0, Wd1 각각이 -2, -1이고, 수치 값들 Id0, Id1 각각이 1, -2에 대응하는 일 예), 곱셈기로부터 출력되는 24 개의 비트들(1030)은, P = 000000000100011111101110 이다.
일 실시예에서, 곱셈기에 연결된 제1 비트 선택기(예, 도 8 및/또는 도 9d의 비트 선택기(825))는, 곱셈기의 출력 P를 나타내는 비트들(1030) 중 LSB 및 LSB에 인접하는 7 비트들을 포함하는 8 개의 비트들(1035)(예, P[7:0])을 추출할 수 있다. 곱셈기에 연결된 제1 비트 조정기(예, 도 8 및/또는 도 9d의 비트 조정기(830))는, 비트들(1030) 중 지정된 일부분(예, P[16:9])에 대응하는 비트들(1040)을, 상기 일부분과 상이한 비트(예, P[8])에 기반하여 조절할 수 있다. 예를 들어, 제1 비트 조정기는 비트들(1040)에, 상기 일부분과 상이한 비트에 기반하는 비트들(1045)(예, P[8]을 포함하고, 다른 자리는 0으로 채워진 비트들(1045))을 더한 결과(P1 = P[16:9] + P[8])를 나타내는 비트들(1050)을 출력할 수 있다. 상기 예시에서, 비트들(1050)은 P1 = 00100100 이다.
도 10을 참고하면, 제1 비트 선택기에 의하여 추출된 비트들(1035)은, 도 9d에서 상술한 바와 같이, 비트 선택기에 연결된 제2 비트 조정기(예, 도 9d의 비트 조정기(840)) 및 제2 비트 선택기(예, 도 9d의 비트 선택기(835))로 입력될 수 있다. 제2 비트 선택기는 비트들(1035) 중에서 일부분(예, 비트들(1035)의 LSB 및 LSB에 이웃하는 3 개의 비트들을 포함하는 4 개의 비트들(예, P[3:0])에 대응하는 비트들(1055)을 출력할 수 있다. 상기 비트들(1055)은, 예를 들어, 제1 채널(O1)을 통해 출력되는 Wd0 Х Id0의 곱에 대응할 수 있다. 상기 예시에서, 비트들(1055)은 1110으로, -2 = -2 × 1이므로, Wd0 Х Id0에 대응한다. 제2 비트 조정기는 비트들(1035) 중에서 MSB 및 MSB에 이웃하는 3 개의 비트들을 포함하는 4 개의 비트들(예, P[7:4])(1060)에, 비트들(1035) 중에서 지정된 자리의 비트(예, P[3])에 기반하는 비트들(1065)을 더한 결과를 나타내는 비트들(1070)을 출력할 수 있다. 상기 예시에서, 비트들(1070)은, P[7:4] + P[3] = 1111이므로, -1 = -1 × 1 = Wd1 × Id0에 대응한다. 비트들(1070)은, 제2 비트 조정기에 의해 제2 채널(O2)로 출력될 수 있다.
도 10을 참고하면, 제1 비트 조정기에 의하여 출력되는 비트들(1050)(예, P1 = P[16:9] + P[8]를 나타내는 비트들)은, 제1 비트 조정기에 연결된 제3 비트 조정기(예, 도 9d의 비트 조정기(850)) 및 제3 비트 선택기(예, 도 9d의 비트 선택기(845))로 입력될 수 있다. 제3 비트 선택기는 비트들(1050) 중에서 일부분(예, 비트들(1050)의 LSB 및 LSB에 이웃하는 3 개의 비트들을 포함하는 4 개의 비트들)(예, P1[3:0])에 대응하는 비트들(1075)을 출력할 수 있다. 상기 비트들(1075)은, 예를 들어, 제3 채널(O3)을 통해 출력되는 Wd0 × Id1의 곱에 대응할 수 있다. 상기 예시에서, 비트들(1075)은 P1[3:0] = 0100이므로, 4 = -2 × -2 = Wd0 × Id1에 대응한다. 비트들(1075)은, 제3 비트 선택기에 의해 제3 채널(O3)로 출력될 수 있다. 제3 비트 조정기는 비트들(1050) 중에서 MSB 및 MSB에 이웃하는 3 개의 비트들을 포함하는 4 개의 비트들(예, P1[7:4])(1080)에, 비트들(1050) 중 지정된 자리(예, P1[3])에 기반하는 비트들(1085)을 더한 결과를 나타내는 비트들(1090)을 출력할 수 있다. 상기 예시에서, 비트들(1090)은, P1[7:4] + P1[3] = 0010이므로, 2 = -1 × -2 = Wd1 × Id1에 대응한다. 예를 들어, 연산 회로는 2 개의 피승수들 및 2 개의 승수들 사이의 곱들 전부를 동시에 출력할 수 있다.
제1 채널(O1) 내지 제4 채널(O4)을 통해 출력되고, 4 비트들에 기반하여, 2 개의 피승수들 및 2 개의 승수들 사이의 곱들(products)을 나타내는, 비트들(1055, 1070, 1075, 1090) 각각은, 예를 들어, 도 4b의 제1 누적 회로(430-1) 내지 제4 누적 회로(430-4) 각각에 누적될 수 있다. 제1 누적 회로(430-1) 내지 제4 누적 회로(430-4) 각각에 누적되고, 상기 4 비트들에 기반하여 나타내어진, 상기 곱들은, 뉴럴 엔진(예, 도 4b의 뉴럴 엔진(240))에 의하여 2 비트들을 따라 정수를 나타내기 위한 상기 지정된 데이터 타입으로 변환될 수 있다. 상기 지정된 데이터 타입으로 변환된 상기 곱들은, 뉴럴 네트워크의 특정 레이어에 포함된 노드들의 가중합에 대응할 수 있다.
상술한 바와 같이, 일 실시예에 따른 전자 장치의 연산 회로는 상이한 데이터 타입들(예, FP16, INT8, INT4, INT2)에 기반하는 하나 이상의 피승수들 및 하나 이상의 승수들 사이의 곱셈 연산을 수행할 수 있다. 상기 데이터 타입들은, 뉴럴 네트워크에 포함된 복수의 레이어들 각각에서 독립적으로 설정될 수 있다. 일 실시예에 따른 전자 장치의 연산 회로가 복수의 레이어들 각각의 데이터 타입에 기반하는 곱셈 연산을 수행함에 따라, 연산 회로를 포함하는 NPU가 메모리로 입력 및/또는 출력하는 데이터의 크기가, 상기 데이터 타입에 따라 차별화될 수 있다. 데이터의 크기가 차별화됨에 따라, NPU 및 메모리 사이의 트래픽이 절감될 수 있다.
이하에서는 도 11 내지 도 15를 참고하여, 일 실시예에 따른 전자 장치의 동작들이 설명된다.
도 11은 일 실시예에 따른 전자 장치가 뉴럴 네트워크에 기반하여 입력 데이터를 처리하는 동작을 설명하기 위한 흐름도(1100)이다. 도 11의 전자 장치는 도 1 내지 도 10의 전자 장치의 일 예에 대응할 수 있다. 예를 들어, 도 11의 전자 장치의 동작은, 도 2의 전자 장치(101), NPU(210) 및/또는 컨트롤러(260)에 의해 수행될 수 있다.
도 11을 참고하면, 동작(1110)에서, 일 실시예에 따른 전자 장치는 입력 데이터를 이용하여, 뉴럴 네트워크로부터 출력 데이터를 획득하라는 요청을 식별할 수 있다. 상기 요청은, 예를 들어, 전자 장치의 프로세서(예, 도 1 및/또는 도 2의 프로세서(120))에서 실행되고 있는 어플리케이션에 의해 식별될 수 있다. 도 2를 참고하면, 프로세서(120)는, 인스트럭션들 중에서 NPU(210)와 관련된 기능과 관련된 API를 호출하기 위한 인스트럭션을 실행하는 것에 응답하여, 상기 실행된 인스트럭션에 기반하여, NPU(210)로 입력될 입력 데이터, 또는 상기 입력 데이터의 데이터 타입 중 적어도 하나를 식별할 수 있다. 상기 API는, 얼굴 인식(face recognition), 상시 구동 카메라(always on camera)에 기반하는 영상 인식, 음성 인식 및/또는 필기 인식과 같이 뉴럴 네트워크와 관련된 기능을 포함하는 어플리케이션(또는 운영 체제에 포함된 시스템 소프트웨어)에 의해 호출될 수 있다. 상기 API는, NPU(210)의 적어도 부분적인 활성화를 야기할 수 있다. 프로세서(120)는 NPU(210)로, 데이터 타입 및 입력 데이터를 송신하면서, 상기 입력 데이터에 대응하는 출력 데이터를 획득할 것을 요청할 수 있다. 일 실시예에서, NPU(210)와 관련된 기능과 관련된 API를 호출하기 위한 상기 인스트럭션은, NPU(210)를 위한 인스트럭션 세트를 생성하기 위한 컴파일러(예, 뉴럴 네트워크 컴파일러)에 의해 생성될 수 있다. 상기 인스트럭션은, 뉴럴 네트워크에 포함된 레이어들 각각의 데이터 타입을 나타낼 수 있다. 상기 인스트럭션은, 상기 레이어들에 포함된 노드들 사이의 연결들(connection)을 나타낼 수 있다(예, 그래프).
도 11을 참고하면, 동작(1120)에서, 일 실시예에 따른 전자 장치는 메모리 내에서, 뉴럴 네트워크의 복수의 레이어들에 의해 구별되는 복수의 가중치들을 식별할 수 있다. 예를 들어, 전자 장치는 메모리(예, 도 1 및/또는 도 2의 메모리(130))로부터, 뉴럴 네트워크를 나타내는 복수의 가중치들을 식별할 수 있다. 복수의 가중치들을 식별하는 것과 독립적으로, 전자 장치는 동작(1110)의 요청과 관련된 입력 데이터를 식별할 수 있다. 상기 입력 데이터는, 예를 들어, 상기 뉴럴 네트워크의 입력 레이어에 대응하는 데이터 세트를 포함할 수 있다.
도 11을 참고하면, 동작(1130)에서, 일 실시예에 따른 전자 장치는 NPU의 뉴럴 엔진들 중에서, 복수의 레이어들 중 특정 레이어에 대응하는 가중치들에 기반하는 연산을 수행할 적어도 하나의 뉴럴 엔진을 선택할 수 있다. 동작(1110)의 뉴럴 네트워크는 복수의 레이어들의 시퀀스를 포함할 수 있다. 후술되는 바와 같이, 상기 특정 레이어는 상기 복수의 레이어들의 시퀀스에서 맨 처음 레이어부터 점진적으로 선택될 수 있다. 일 실시예에 따른 전자 장치가 뉴럴 엔진을 선택하는 것은, 특정 레이어에 기반하는 가중합을 계산하는 횟수에 기반할 수 있다.
도 11을 참고하면, 동작(1140)에서, 일 실시예에 따른 전자 장치는 선택된 적어도 하나의 뉴럴 엔진으로, 특정 레이어에 대응하는 가중치들 중 적어도 일부분을 입력할 수 있다. 뉴럴 엔진에 입력되는 가중치는, 뉴럴 엔진에 포함된 하나 이상의 연산 회로들(예, 도 4a 내지 도 4b의 연산 회로(410))에 의해 식별 가능한 데이터 타입을 따라 표시된 수치 값일 수 있다.
도 11을 참고하면, 동작(1150)에서, 일 실시예에 따른 전자 장치는 선택된 적어도 하나의 뉴럴 엔진에 입력 데이터를 송신하여, 뉴럴 엔진에 입력된 가중치들에 기반하여 입력 데이터를 처리한 결과 데이터를 획득할 수 있다. 상기 입력 데이터는, 상기 요청과 관련된 입력 데이터에 대응하거나, 및/또는 상기 복수의 레이어들의 시퀀스에서 상기 특정 레이어의 앞 레이어에 포함된 노드들에 할당된 수치 값들을 포함할 수 있다. 뉴럴 엔진은, 동작(1140)의 하나 이상의 가중치들 및 동작(1150)의 입력 데이터를 수신하는 것에 응답하여 상기 뉴럴 엔진에 포함된 하나 이상의 연산 회로들을 이용하여, 상기 하나 이상의 가중치들 및 상기 입력 데이터의 가중합을 획득할 수 있다. 하나 이상의 연산 회로들이 상기 가중합을 획득하는 동작은, 예를 들어, 도 5 내지 도 10과 유사하게 수행될 수 있다.
도 11을 참고하면, 동작(1160)에서, 일 실시예에 따른 전자 장치는, 동작들(1130, 1140)의 특정 레이어가, 복수의 레이어들 중 마지막 레이어에 대응하는 지 여부를 판단할 수 있다. 상기 특정 레이어가 마지막 레이어에 대응하지 않는 경우(1160-아니오), 동작(1170)에서, 일 실시예에 따른 전자 장치는, 특정 레이어의 다음 레이어를, 결과 데이터를 획득하기 위한 특정 레이어로 선택할 수 있다. 상기 다음 레이어를 상기 특정 레이어로 선택한 이후, 전자 장치는 동작들(1130, 1140, 1150, 1160)을 반복적으로 수행할 수 있다.
상기 특정 레이어가 마지막 레이어에 대응하는 경우(1160-예), 동작(1180)에서, 일 실시예에 따른 전자 장치는 획득된 결과 데이터를 식별된 요청에 대응하는 출력 데이터로써 출력할 수 있다. 상기 출력 데이터는, 예를 들어, 동작(1110)의 뉴럴 네트워크와 관련된 복수의 레이어들의 시퀀스에서 마지막 레이어로부터 출력되는 데이터에 대응할 수 있다. 도 2를 참고하면, 일 실시예에 따른 전자 장치(101)의 NPU(210)는 프로세서(120)로, 동작(1180)의 출력 데이터를 출력할 수 있다. NPU(210)가 프로세서(120)로 출력 데이터를 출력하는 것은, 동작(1110)의 요청에 대응하는 출력 데이터의 생성을 알리는 이벤트(또는 소프트웨어 인터럽트)의 발생을 야기할 수 있다. 상기 이벤트의 발생을 식별하는 것에 응답하여, 프로세서(120)는 상기 이벤트에 대응하는 하나 이상의 인스트럭션들을 실행하여, 동작(1180)의 출력 데이터를 처리하기 위한 하나 이상의 기능들을 실행할 수 있다.
이하에서는 도 12를 참고하여, 동작들(1130, 1140, 1150)의 뉴럴 엔진의 동작이 상세히 설명된다.
도 12는 일 실시예에 따른 전자 장치가 하나 이상의 뉴럴 엔진들을 제어하는 동작을 설명하기 위한 흐름도(1200)이다. 도 12의 전자 장치는 도 1 내지 도 11의 전자 장치의 일 예에 대응할 수 있다. 예를 들어, 도 12의 전자 장치의 동작은, 도 2의 전자 장치(101), NPU(210), 도 4a 내지 도 4b의 뉴럴 엔진(240) 및/또는 컨트롤러(420)에 의해 수행될 수 있다. 도 12의 동작은, 예를 들어, 도 11의 동작들(1130, 1140, 1150)과 관련될 수 있다.
도 12를 참고하면, 동작(1210)에서, 일 실시예에 따른 전자 장치의 뉴럴 엔진은, 입력 데이터 및 하나 이상의 가중치들을 수신할 수 있다. 예를 들어, 전자 장치는 도 11의 동작들(1140, 1150) 중 적어도 하나를 수행하여, 뉴럴 엔진으로 입력 데이터 및 하나 이상의 가중치들을 입력할 수 있다. 뉴럴 엔진으로 입력된 입력 데이터 및 하나 이상의 가중치들은, 뉴럴 엔진의 버퍼(예, 도 2의 버퍼(250))에 저장될 수 있다.
도 12를 참고하면, 동작(1220)에서, 일 실시예에 따른 전자 장치의 뉴럴 엔진은, 수신된 입력 데이터 및 하나 이상의 가중치들의 데이터 타입을 식별할 수 있다. 상기 데이터 타입은, 상기 입력 데이터 및 상기 하나 이상의 가중치들을 나타내기 위해 이용되는 비트들의 개수와 관련될 수 있다. 상기 데이터 타입은, 상기 입력 데이터의 데이터 타입에 매칭되거나, 및/또는 전자 장치의 프로세서(예, 도 1 및/또는 도 2의 프로세서(120))에 의해 조절될 수 있다. 일 실시예에서, 상기 프로세서는 메모리(예, 도 2의 메모리(130))의 대역폭에 기반하여 상기 데이터 타입을 변경할 수 있다. 예를 들어, 상기 대역폭의 일부분이 상기 뉴럴 엔진을 포함하는 NPU(예, 도 2의 NPU(210))와 구별되는 다른 프로세서(예, 도 2의 프로세서(120), 및/또는 GPU(220))에 점유된 상태에서, 상기 NPU가 대역폭의 다른 일부분 미만을 점유하도록, 상기 프로세서는 상기 데이터 타입을, 상대적으로 적은 수의 비트들이 이용되는 다른 데이터 타입으로 변경할 수 있다. 예를 들어, 상기 프로세서는 SoC(State of Charge)와 같이 배터리의 상태를 나타내는 파라미터에 기반하여 상기 데이터 타입을 변경할 수 있다. 예를 들어, 배터리가 지정된 임계치 미만의 SoC를 가지는 경우, 전자 장치는 도 12의 동작들에 의한 상기 NPU 및 상기 메모리의 소비 전력을 절감하기 위하여, 상기 데이터 타입을 변경할 수 있다.
도 12를 참고하면, 동작(1230)에서, 일 실시예에 따른 전자 장치의 뉴럴 엔진은, 식별된 데이터 타입에 기반하여, 뉴럴 엔진에 포함된 복수의 연산 회로들의 신호 경로들을 조절할 수 있다. 뉴럴 엔진이 연산 회로의 신호 경로를 변경하는 것은, 예를 들어, 연산 회로에 포함된 결합기(예, 도 5 및/또는 도 8의 결합기들(510, 810, 815)), 스위치(예, 도 5 및/또는 도 8의 스위치(560)), 덧셈기(예, 도 5 및/또는 도 8의 덧셈기(580)) 및/또는 변환기(예, 도 5 및/또는 도 8의 변환기들(530, 820))을 제어하거나, 활성화하거나, 또는 비활성화하는 동작을 포함할 수 있다. 일 실시예에 따른 뉴럴 엔진이 데이터 타입에 따라 신호 경로를 조절하는 일 예가, 도 6a 내지 도 6c 및/또는 도 9a 내지 도 9d에 대응할 수 있다.
도 12를 참고하면, 동작(1240)에서, 일 실시예에 따른 전자 장치의 뉴럴 엔진은, 조절된 신호 경로들에 기반하여 복수의 연산 회로들을 제어하여, 복수의 연산 회로들로부터 입력 데이터 및 하나 이상의 가중치들에 기반하는 연산을 수행한 결과 데이터를 획득할 수 있다. 도 12를 참고하면, 동작(1250)에서, 일 실시예에 따른 전자 장치는, 동작(1240)에 기반하여 획득된 결과 데이터를, 하나 이상의 누적 회로들에 누적하여 저장할 수 있다. 예를 들어, 뉴럴 엔진은 누적 회로(예, 도 4a 내지 도 4b의 누적 회로(430))에, 복수의 연산 회로들 각각에서 출력된 수치 값들을 누적할 수 있다. 뉴럴 엔진이 누적 회로에 결과 데이터를 저장하는 동작은, 동작(1220)에서 식별된 데이터 타입에 따라 차별화될 수 있다.
도 12를 참고하면, 동작(1260)에서, 일 실시예에 따른 전자 장치의 뉴럴 엔진은, 하나 이상의 누적 회로들에 누적된 결과 데이터를 출력할 수 있다. 예를 들어, 도 11의 동작(1150)의 결과 데이터로써, 동작(1260)의 결과 데이터를 출력할 수 있다. 전자 장치의 뉴럴 엔진이 출력하는 결과 데이터는, 예를 들어, 뉴럴 네트워크에 포함된 복수의 레이어들 중에서 하나의 레이어에 포함된 노드들 각각에 할당된 수치 값들을 포함할 수 있다.
도 13은 일 실시예에 따른 전자 장치가, 상이한 데이터 타입들에 기반하는 연산을 수행하는 동작을 설명하기 위한 흐름도(1300)이다. 도 13의 전자 장치는 도 1 내지 도 12의 전자 장치의 일 예에 대응할 수 있다. 예를 들어, 도 13의 전자 장치의 동작은, 도 2의 전자 장치(101), NPU(210), 뉴럴 엔진(240), 도 4a 내지 도 4b의 연산 회로(410) 및/또는 컨트롤러(420)에 의해 수행될 수 있다. 도 13의 동작은, 예를 들어, 도 12의 동작(1240)과 관련될 수 있다.
도 13을 참고하면, 동작(1310)에서, 일 실시예에 따른 전자 장치의 NPU의 연산 회로는, 입력 데이터 및 가중치를 수신할 수 있다. 동작(1320)에서, 일 실시예에 따른 전자 장치의 NPU의 연산 회로는, 동작(1310)에서, 부동 소수점 수를 나타내기 위한 제1 데이터 타입의 입력 데이터 및 가중치를 수신하였는 지 여부를 판단할 수 있다.
부동 소수점 수를 나타내기 위한 제1 데이터 타입의 입력 데이터 및 가중치를 수신하는 것에 응답하여(1320-예), 동작(1330)에서, 일 실시예에 따른 전자 장치의 NPU의 연산 회로는, 연산 회로의 곱셈기의 제1 포트 및 제2 포트 각각에, 입력 데이터에 의해 나타내어지는 제1 부동 소수점 수의 가수 및 가중치에 대응하는 제2 부동 소수점 수의 가수를 입력하여, 곱셈기의 제3 포트의 비트들로부터 가수들을 곱한 결과를 획득할 수 있다. 연산 회로의 곱셈기는, 예를 들어, 도 5 및/또는 도 8의 곱셈기(520)를 포함할 수 있다.
도 13을 참고하면, 동작(1340)에서, 일 실시예에 따른 전자 장치의 NPU의 연산 회로는, 덧셈기의 제1 포트 및 제2 포트 각각에, 제1 부동 소수점 수의 지수 및 제2 부동 소수점 수의 지수를 입력하여, 덧셈기로부터 지수들을 더한 결과를 획득할 수 있다. 연산 회로의 덧셈기는, 예를 들어, 도 5 및/또는 도 8의 덧셈기(580)를 포함할 수 있다.
도 13을 참고하면, 동작(1350)에서, 일 실시예에 따른 전자 장치의 NPU의 연산 회로는, 덧셈기로부터 획득된 결과에 기반하여, 곱셈기로부터 획득된 결과를 시프트하여(shifting), 제1 부동 소수점 수 및 제2 부동 소수점 수를 곱한 결과에 대응하는 제3 부동 소수점 수를 획득할 수 있다. 연산 회로가 곱셈기로부터 획득된 결과를 시프트하는 것은, 곱셈기로부터 출력되는 가수들을 곱한 결과를 정규화하는 동작의 일 예에 대응할 수 있다.
부동 소수점 수를 나타내기 위한 제1 데이터 타입의 입력 데이터 및 가중치를 수신하지 않은 것에 응답하여(1320-아니오), 동작(1360)에서, 일 실시예에 따른 전자 장치의 NPU의 연산 회로는, 곱셈기의 제1 포트에, 제2 데이터 타입에 기반하는 입력 데이터에 의해 나타내어지는 제1 정수 및 제2 정수가 결합된 제3 정수를 입력하고, 제2 포트에, 제2 데이터 타입에 의해 나타내어지는 제4 정수를 입력할 수 있다. 예를 들어, 상기 제1 데이터 타입과 구별되는 제2 데이터 타입에 기반하는 제1 정수, 제2 정수 및 제4 정수를 수신한 상태에서, 연산 회로는 동작(1360)을 수행할 수 있다. 곱셈기의 제1 포트에 입력될 상기 제3 정수는, 예를 들어, 도 5의 결합기(510)에 기반하여 획득될 수 있다.
도 13을 참고하면, 동작(1370)에서, 일 실시예에 따른 전자 장치의 NPU의 연산 회로는, 곱셈기의 제3 포트의 비트들에 기반하여, 제1 정수 및 제4 정수를 곱한 결과 및 제2 정수 및 제4 정수를 곱한 결과를 획득할 수 있다. 예를 들어, 연산 회로는 변환기(예, 도 5의 변환기(530) 및/또는 도 8의 변환기(820))를 이용하여 제1 정수 및 제4 정수를 곱한 결과를 나타내는 제5 정수, 및 제2 정수 및 제4 정수를 곱한 결과를 나타내는 제6 정수를 획득할 수 있다.
도 13을 참고하면, 동작(1380)에서, 일 실시예에 따른 전자 장치의 NPU의 연산 회로는, 입력 데이터 및 가중치와 관련된 연산을 수행한 결과를 출력할 수 있다. 제1 데이터 타입의 입력 데이터 및 가중치를 수신한 상태에서(1320-예), 동작(1380)에 기반하여 연산 회로가 출력하는 결과는, 동작(1350)의 제3 부동 소수점 수를 포함할 수 있다. 제1 데이터 타입과 구별되는 제2 데이터 타입의 입력 데이터(예, 상기 제4 정수) 및 가중치들(예, 상기 제1 정수 및 상기 제2 정수)을 수신한 상태에서, 전자 장치는 동작(1370)의 상기 제5 정수 및 상기 제6 정수를 출력할 수 있다. 예를 들어, 동작들(1330, 1340, 1350)은 도 6a의 상태(610) 및/또는 도 9a의 상태(910)에 대응할 수 있다.
도 14는 일 실시예에 따른 전자 장치가, 부동 소수점 수의 가수와 관련된 곱셈기로 입력될 하나 이상의 정수들을 획득하기 위하여 수행하는 동작을 설명하기 위한 흐름도(1400)이다. 도 14의 전자 장치는 도 1 내지 도 13의 전자 장치의 일 예에 대응할 수 있다. 예를 들어, 도 14의 전자 장치의 동작은, 도 5의 결합기(510), 및/또는 도 8의 결합기들(810, 815)에 의해 수행될 수 있다.
도 14를 참고하면, 동작(1410)에서, 일 실시예에 따른 전자 장치의 연산 회로에 포함된 결합기는, 부동 소수점 수를 나타내기 위한 제1 데이터 타입과 상이한 제2 데이터 타입에 기반하는 제1 정수로부터, 제1 정수의 부호를 나타내는 비트를 식별할 수 있다. 결합기는 동작(1410)을, 상기 제2 데이터 타입에 기반하는 상기 제1 정수를 수신하는 것에 응답하여 선택적으로 수행할 수 있다.
도 14를 참고하면, 동작(1420)에서, 일 실시예에 따른 전자 장치의 연산 회로에 포함된 결합기는, 제2 데이터 타입에 기반하여 제1 정수를 나타내는 비트들에 식별된 비트에 기반하는 하나 이상의 비트들을 연접하여, 제1 데이터 타입의 부동 소수점 수의 가수를 나타내는 비트들의 수를 따라, 제2 데이터 타입의 제1 정수를 나타낸 제2 정수를 획득할 수 있다. 예를 들어, 4 비트들을 따라 나타낸 제1 정수를 수신하는 것에 응답하여, 결합기는 부동 소수점 수의 가수를 나타내는 비트들의 수에 대응하는 12 비트들을 따라 상기 제1 정수를 나타낸 제2 정수를 획득할 수 있다. 결합기가 동작(1420)에 기반하여 하나 이상의 비트들을 연접하는 것은, 제1 정수의 부호 확장과 관련될 수 있다. 결합기가 동작(1420)에 기반하여 획득하는 상기 제2 정수는, 예를 들어, 도 7의 비트들(712)에 의해 나타내어지는 정수에 대응할 수 있다.
도 14를 참고하면, 동작(1430)에서, 일 실시예에 따른 전자 장치의 연산 회로에 포함된 결합기는, 제2 데이터 타입에 기반하는 제3 정수를 나타내는 비트들을 시프트하여, 제4 정수를 획득할 수 있다. 예를 들어, 결합기는 부동 소수점 수의 가수를 나타내는 비트들의 수에 기반하여 제3 정수를 나타내는 비트들을 시프트하여, 상기 제4 정수를 획득할 수 있다. 결합기가 동작(1430)에 기반하여 획득하는 상기 제4 정수는, 예를 들어, 도 7의 비트들(714)에 의해 나타내어지는 정수에 대응할 수 있다.
도 14를 참고하면, 동작(1440)에서, 일 실시예에 따른 전자 장치의 연산 회로에 포함된 결합기는, 동작들(1420, 1430) 각각의 제2 정수 및 제4 정수를 더하여, 곱셈기의 포트로 입력될 제5 정수를 획득할 수 있다. 결합기가 동작(1440)에 기반하여 획득하는 상기 제5 정수는, 예를 들어, 도 7의 비트들(710)에 의해 나타내어지는 정수에 대응할 수 있다.
도 15는 일 실시예에 따른 전자 장치가, 연산 회로의 곱셈기로부터 출력된 비트들에 기반하여 수행하는 동작을 설명하기 위한 흐름도(1500)이다. 도 15의 전자 장치는 도 1 내지 도 14의 전자 장치의 일 예에 대응할 수 있다. 예를 들어, 도 14의 전자 장치의 동작은, 도 5의 변환기(530), 및/또는 도 8의 변환기(820)에 의해 수행될 수 있다.
도 15를 참고하면, 동작(1510)에서, 일 실시예에 따른 전자 장치의 연산 회로의 변환기는, 곱셈기의 제1 포트 및 제2 포트 각각으로 입력된 비트들의 곱을 나타내는 복수의 비트들을, 곱셈기의 제3 포트로부터 획득할 수 있다. 동작(1520)에서, 일 실시예에 따른 전자 장치의 변환기는, 부동 소수점 수를 나타내기 위한 제1 데이터 타입에 기반하는 제1 부동 소수점 수의 가수 및 제2 부동 소수점 수의 가수들이, 곱셈기의 제1 포트 및 제2 포트 각각으로 입력되었는지 여부를 판단할 수 있다.
제1 데이터 타입에 기반하는 제1 부동 소수점 수의 가수 및 제2 부동 소수점 수의 가수들이, 곱셈기의 제1 포트 및 제2 포트 각각으로 입력된 상태에서(1520-예), 동작(1530)에서, 일 실시예에 따른 전자 장치의 연산 회로의 변환기는 덧셈기의 제1 포트 및 제2 포트 각각으로 입력된 비트들의 합을 나타내는 복수의 비트들을, 덧셈기의 제3 포트로부터 획득할 수 있다. 예를 들어, 전자 장치는 도 13의 동작(1340)과 유사하게 동작(1530)을 수행할 수 있다.
도 15를 참고하면, 동작(1540)에서, 일 실시예에 따른 전자 장치의 연산 회로의 변환기는, 덧셈기의 제3 포트로부터 획득된 복수의 비트들에 기반하여, 곱셈기의 제3 포트로부터 획득된 복수의 비트들을 시프트할 수 있다. 예를 들어, 전자 장치는 도 13의 동작(1350)과 유사하게, 동작(1540)을 수행할 수 있다. 동작(1550)에서, 일 실시예에 따른 전자 장치는, 시프트된 복수의 비트들 및 덧셈기의 제3 포트로부터 획득된 복수의 비트들에 기반하여, 제1 부동 소수점 수 및 제2 부동 소수점 수의 곱을 나타낸 제3 부동 소수점 수를 출력할 수 있다. 상기 제3 부동 소수점는 제1 데이터 타입에 의해 나타내어진 수의 비트들 또는 그 이상의 수의 비트들에 기반하여 나타내어질 수 수 있다. 전자 장치가 동작들(1530, 1540, 1550)을 수행하는 것은, 도 6a의 상태(610) 및/또는 도 9a의 상태(910)에 대응할 수 있다.
곱셈기의 제1 포트 및 제2 포트에 상기 제1 데이터 타입과 상이한 제2 데이터 타입에 기반하는 비트들이 입력된 상태에서(1520-아니오), 동작(1560)에서, 일 실시예에 따른 전자 장치의 연산 회로의 변환기는 동작(1510)에 기반하여 곱셈기의 제3 포트로부터 획득된 복수의 비트들 중에서, 최하위 비트를 포함하는 제1 부분에 대응하는 비트들을 추출할 수 있다. 동작(1570)에서, 전자 장치의 연산 회로의 변환기는, 동작(1560)에 기반하여 추출된 제1 부분에 포함된 비트들로부터, 정수를 나타내기 위한 제2 데이터 타입에 기반하는 정수들 사이의 곱셈 연산을 수행한 결과를 출력할 수 있다. 예를 들어, 연산 회로가 4 비트들을 따라 나타내어진 피승수들(예, 도 6c 및/또는 도 9c의 가중치들 Wc0, Wc1) 및 승수(예, 도 6c 및/또는 도 9c의 수치 값들 Ic)를 수신한 경우, 전자 장치는 추출된 제1 부분에 포함된 비트들을, 상기 피승수들 중 제1 피승수 및 승수의 곱으로써 출력할 수 있다. 다른 예를 들어, 연산 회로가 2 비트들을 따라 나타내어진 피승수들(예, 도 9d의 가중치들 Wd0, Wd1) 및 승수들(예, 도 9d의 수치 값들 Id0, Id1)을 수신한 경우, 전자 장치는 추출된 제1 부분에 포함된 비트들로부터, 상기 피승수들 중 제1 피승수 및 제1 승수의 곱 및 제2 피승수 및 제1 승수의 곱을 출력할 수 있다. 상기 제1 피승수 및 제2 승수의 곱 및 제2 피승수 및 제1 승수의 곱 각각은, 제2 데이터 타입의 상기 4 비트들 이상의 비트들(예, 8 비트들)에 기반하여 나타내어질 수 있다.
도 15를 참고하면, 동작(1580)에서, 일 실시예에 따른 전자 장치의 연산 회로의 변환기는, 곱셈기의 제3 포트로부터 획득된 복수의 비트들 중에서, 제1 부분에 연접하는 제2 부분에 대응하는 비트들을 추출할 수 있다. 동작(1590)에서, 전자 장치의 연산 회로의 변환기는, 추출된 제2 부분에 포함된 비트들로부터, 제2 데이터 타입에 기반하는 정수들 사이의 곱셈 연산을 수행한 결과를 출력할 수 있다. 연산 회로가 4 비트들을 따라 나타내어진 피승수들(예, 도 6c 및/또는 도 9c의 가중치들 Wc0, Wc1) 및 승수(예, 도 6c 및/또는 도 9c의 수치 값들 Ic)를 수신한 상기 예시에서, 전자 장치는 추출된 제2 부분에 포함된 비트들을, 상기 피승수들 중 제2 피승수 및 승수의 곱으로써 출력할 수 있다. 연산 회로가 2 비트들을 따라 나타내어진 피승수들(예, 도 9d의 가중치들 Wd0, Wd1) 및 승수들(예, 도 9d의 수치 값들 Id0, Id1)을 수신한 상기 다른 예시에서, 전자 장치는 추출된 제2 부분에 포함된 비트들로부터, 상기 피승수들 중 제1 피승수 및 제2 승수의 곱 및 제2 피승수 및 제2 승수의 곱을 출력할 수 있다. 상기 제1 피승수 및 제2 승수의 곱 및 제2 피승수 및 제2 승수의 곱 각각은, 제2 데이터 타입의 상기 4 비트들 이상의 비트들(예, 8 비트들)에 기반하여 나타내어질 수 있다.
상술한 바와 같은, 일 실시예에 따른 전자 장치(electronic device)는, 부동 소수점 수(floating point number)를 나타내기 위한 제1 데이터 타입과 상이하고, 정수를 나타내기 위한 제2 데이터 타입의 복수의 정수들(integer numbers)에 기반하는 곱셈 연산(multiplication)을 수행하기 위한 요청을 수신하는 것에 응답하여, 상기 복수의 정수들 중 제1 정수 및 제2 정수를 결합하는 결합기, 상기 제1 데이터 타입에 의해 구별되는 상기 부동 소수점 수의 가수들(mantissas)에 대응하는 비트들의 곱(product)을 획득하기 위한 곱셈기, 상기 복수의 정수들 중 제3 정수가 상기 곱셈기의 제1 포트로 입력되고, 상기 결합기에 의한 상기 제1 정수 및 상기 제2 정수의 결합을 나타내는 제4 정수가 상기 곱셈기의 제2 포트로 입력됨, 상기 곱셈기의 상기 제1 포트 및 상기 제2 포트와 상이한 제3 포트로부터, 상기 제3 정수 및 상기 제4 정수의 곱을 나타내는 제5 정수를 식별하는 것에 응답하여, 상기 식별된 제5 정수에 기반하여, 상기 제1 정수 및 상기 제3 정수의 곱을 나타내는 제6 정수, 및 상기 제2 정수 및 상기 제4 정수의 곱을 나타내는 제7 정수를 출력하는 변환기 (converter)를 포함하는 연산 회로를 포함할 수 있다.
예를 들어, 상기 결합기는, 부호 확장(sign extension)을 이용하여, 상기 제1 데이터 타입의 부동 소수점 수의 가수를 나타내는 비트들의 수를 따라 나타낸, 상기 제1 정수 및 상기 제2 데이터 타입의 정수를 나타내는 비트들의 수에 기반하여 시프트된(shifted) 상기 제2 정수를 결합하여, 상기 제4 정수를 출력할 수 있다.
예를 들어, 상기 변환기는, 상기 제5 정수를 나타내는 상기 제3 포트의 비트들 중 제1 부분에 대응하는 비트들을 추출하여, 상기 제6 정수를 획득하는 비트 선택기(bit selector) , 및 상기 제6 정수를 나타내는 비트들 중 적어도 하나의 비트 및 상기 제3 포트의 비트들 중에서 상기 제1 부분과 상이한 제2 부분에 대응하는 비트들에 기반하여, 상기 제7 정수를 획득하는 비트 조정기(bit adjuster)를 포함할 수 있다.
예를 들어, 상기 변환기의 상기 비트 조정기는, 상기 제1 부분에 대응하는 비트들 중 최상위 비트(most significant bit, MSB) 및 상기 제2 부분에 대응하는 하나 이상의 비트들을 결합하여, 상기 제7 정수를 획득할 수 있다.
예를 들어, 상기 전자 장치는, 시프트 레지스터를 더 포함하고, 상기 변환기는, 상기 요청을 수신한 상태에서, 상기 제6 정수 또는 상기 제5 정수 중 상기 제6 정수를, 상기 시프트 레지스터로 송신하고, 및 상기 요청과 상이한 다른 요청을 수신한 상태에서, 상기 제6 정수 또는 상기 제5 정수 중 상기 제5 정수를, 상기 시프트 레지스터로 송신하는 스위치를 더 포함할 수 있다.
예를 들어, 상기 곱셈기는, 상기 결합기로부터 출력된 상기 제4 정수를 식별하는 것에 응답하여, 상기 식별된 제4 정수, 및 부호 확장을 이용하여 상기 제1 데이터 타입의 부동 소수점 수의 가수를 나타내는 비트들의 수를 따라 나타낸 상기 제3 정수의 곱셈 연산을 수행하여, 상기 제5 정수를 출력할 수 있다.
예를 들어, 상기 곱셈기는, 상기 요청과 상이한, 상기 제1 데이터 타입에 기반하는 제1 부동 소수점 수 및 제2 부동 소수점 수의 곱셈 연산을 수행하라는 다른 요청을 수신하는 것에 응답하여, 상기 제1 부동 소수점 수의 제1 가수 및 상기 제2 부동 소수점 수의 제2 가수의 곱셈 연산을 수행하여, 제3 가수를 출력하고, 상기 제1 가수 및 상기 제2 가수는, 상기 결합기를 바이패스하여 상기 곱셈기에 입력될 수 있다.
예를 들어, 상기 연산 회로는, 상기 제1 부동 소수점 수의 제1 지수 및 상기 제2 부동 소수점 수의 제2 지수의 덧셈 연산을 수행하여, 제3 지수를 출력하는 덧셈기, 및 상기 덧셈기로부터 출력되는 상기 제3 지수에 기반하여, 상기 제3 가수를 시프트하는 시프트 레지스터를 더 포함할 수 있다.
상술한 바와 같은, 일 실시예에 따른 전자 장치의 방법은, 부동 소수점 수를 나타내기 위한 제1 데이터 타입과 상이하고, 정수를 나타내기 위한 제2 데이터 타입의 복수의 정수들에 기반하는 곱셈 연산을 수행하라는 요청을 수신하는 것에 응답하여, 상기 복수의 정수들 중 제1 정수 및 제2 정수를 결합하는 동작, 상기 제1 데이터 타입에 의해 구별되는 상기 부동 소수점 수의 가수들에 대응하는 비트들의 곱(product)을 획득하기 위한 곱셈기의 제1 포트로, 상기 가수의 비트들의 수에 기반하여 상기 복수의 정수들 중 제3 정수를 송신하는 동작, 상기 제1 포트로 상기 제3 정수를 송신하는 상태에서, 상기 곱셈기의 상기 제1 포트와 구별되는 제2 포트로, 상기 제1 정수 및 상기 제2 정수의 결합을 나타내는 제4 정수를 송신하는 동작, 상기 곱셈기의 상기 제1 포트 및 상기 제2 포트와 상이한 제3 포트로부터, 상기 제3 정수 및 상기 제4 정수의 곱을 나타내는 제5 정수를 식별하는 것에 응답하여, 상기 획득된 제5 정수에 기반하여, 상기 제1 정수 및 상기 제3 정수의 곱을 나타내는 제6 정수 및 상기 제2 정수 및 상기 제4 정수의 곱을 나타내는 제7 정수를 획득하는 동작을 포함할 수 있다.
예를 들어, 상기 결합하는 동작은, 상기 제1 정수를, 부호 확장(sign extension)을 이용하여, 상기 제1 데이터 타입의 부동 소수점 수의 가수를 나타내는 비트들의 수를 따라 나타내는 동작, 상기 제2 정수를, 상기 제1 정수 및 상기 제2 데이터 타입의 정수를 나타내는 비트들의 수에 기반하여 시프트하는(shifting) 동작, 및 상기 부동 소수점 수의 가수를 따라 나타내어진 상기 제1 정수 및 상기 시프트된 제2 정수를 더하여, 상기 제4 정수를 획득하는 동작을 포함할 수 있다.
예를 들어, 상기 획득하는 동작은, 상기 제5 정수를 나타내는 상기 제3 포트의 비트들 중 제1 부분에 대응하는 비트들을 추출하여, 상기 제6 정수를 획득하는 동작, 및 상기 제6 정수를 나타내는 비트들 중 적어도 하나의 비트 및 상기 제3 포트의 비트들 중에서 상기 제1 부분과 상이한 제2 부분에 대응하는 비트들에 기반하여, 상기 제7 정수를 획득하는 동작을 포함할 수 있다.
예를 들어, 상기 제7 정수를 획득하는 동작은, 상기 제1 부분에 대응하는 비트들 중 최상위 비트 및 상기 제2 부분에 대응하는 하나 이상의 비트들을 결합하여, 상기 제7 정수를 획득하는 동작을 포함할 수 있다.
예를 들어, 상기 제3 정수를 송신하는 동작은, 상기 제1 포트로, 부호 확장을 이용하여 상기 제1 데이터 타입의 부동 소수점의 가수를 나타내는 비트들의 수를 따라 나타낸 상기 제3 정수를 송신하는 동작을 더 포함할 수 있다.
예를 들어, 상기 전자 장치의 방법은, 상기 요청과 상이한, 상기 제1 데이터 타입에 기반하는 제1 부동 소수점 수 및 제2 부동 소수점 수의 곱셈 연산을 수행하라는 다른 요청을 수신하는 것에 응답하여, 상기 곱셈기의 상기 제1 포트로 상기 제1 부동 소수점 수의 제1 가수를 입력하고, 상기 곱셈기의 상기 제2 포트로 상기 제2 부동 소수점 수의 제2 가수를 입력하는 동작, 상기 제1 포트로 상기 제1 가수를 입력하고, 상기 제2 포트로 상기 제2 가수를 입력한 상태에서, 상기 곱셈기의 상기 제3 포트로부터 상기 제1 가수 및 상기 제2 가수의 곱에 대응하는 제3 가수를 획득하는 동작을 더 포함할 수 있다.
예를 들어, 상기 전자 장치의 방법은, 상기 다른 요청을 수신하는 것에 응답하여, 상기 제1 부동 소수점 수의 제1 지수 및 상기 제2 부동 소수점 수의 제2 지수의 덧셈 연산을 수행하여, 제3 지수를 획득하는 동작, 및 상기 획득된 제3 지수에 기반하여, 상기 제3 가수를 시프트하는 동작을 더 포함할 수 있다.
상술한 바와 같은, 일 실시예에 따른 전자 장치(electronic device)는, 부동 소수점 수를 나타내기 위한 제1 데이터 타입과 상이하고, 정수를 나타내기 위한 제2 데이터 타입의 복수의 정수들에 기반하는 곱셈 연산을 수행하기 위한 요청을 수신하는 것에 응답하여, 상기 복수의 정수들 중 제1 정수 및 제2 정수를 결합하는 제1 결합기, 상기 요청을 수신하는 것에 응답하여, 상기 복수의 정수들 중 제3 정수 및 제4 정수를 결합하는 제2 결합기, 상기 제1 데이터 타입에 의해 구별되는 상기 부동 소수점 수의 가수들에 대응하는 비트들의 곱을 획득하기 위한 곱셈기, 상기 제1 결합기의 상기 제1 정수 및 상기 제2 정수의 결합을 나타내는 제5 정수가 상기 곱셈기의 제1 포트로 입력되고, 상기 제2 결합기의 상기 제3 정수 및 상기 제4 정수의 결합을 나타내는 제6 정수가 상기 곱셈기의 제2 포트로 입력됨, 상기 곱셈기의 상기 제1 포트 및 상기 제2 포트와 상이한 제3 포트로부터, 상기 제5 정수 및 상기 제6 정수의 곱을 나타내는 제7 정수를 식별하는 것에 응답하여, 상기 식별된 제7 정수에 기반하여, 상기 제1 정수 또는 상기 제2 정수 중 어느 한 정수 및 상기 제3 정수 또는 상기 제4 정수 중 어느 한 정수의 조합의 곱들을 획득하는 변환기를 포함할 수 있다.
예를 들어, 상기 곱셈기는, 상기 요청과 상이한, 상기 제1 데이터 타입의 제1 부동 소수점 수 및 제2 부동 소수점 수에 대한 곱셈 연산을 수행하기 위한 다른 요청을 식별하는 것에 응답하여, 상기 제1 결합기 및 상기 제2 결합기를 바이패스하여, 상기 제1 부동 소수점 수의 제1 가수를 상기 제1 포트를 통해 수신하고, 상기 제2 부동 소수점 수의 제2 가수를 상기 제2 포트를 통해 수신할 수 있다.
예를 들어, 상기 전자 장치는, 상기 다른 요청을 식별하는 것에 응답하여, 상기 제1 부동 소수점 수의 제1 지수 및 상기 제2 부동 소수점 수의 제2 지수의 덧셈 연산을 수행하여, 제3 지수를 출력하는 덧셈기, 및 상기 덧셈기로부터 출력되는 상기 제3 지수에 기반하여, 상기 곱셈기로부터 출력되고, 상기 제1 가수 및 상기 제2 가수의 곱에 대응하는, 제3 가수를 시프트하는 시프트 레지스터를 더 포함할 수 있다.
예를 들어, 상기 제1 결합기는, 부호 확장을 이용하여, 상기 제2 데이터 타입의 정수를 나타내는 비트들의 수를 초과하는 비트들에 기반하여 나타낸, 상기 제1 정수 및 상기 제2 데이터 타입의 정수를 나타내기 위한 비트들의 수에 기반하여 시프트된 상기 제2 정수를 결합하여, 상기 제5 정수를 출력할 수 있다.
예를 들어, 상기 변환기는, 상기 제7 정수를 나타내는 상기 제3 포트의 비트들 중 제1 부분에 대응하는 비트들을 추출하는 제1 비트 선택기, 상기 제1 비트 선택기로부터 추출된 비트들 중에서, 최하위 비트(least significant bit, LSB)를 포함하는 제3 부분에 대응하는 비트들을 추출하여, 상기 제1 정수 및 상기 제3 정수의 곱을 획득하는 제2 비트 선택기, 상기 제3 부분에 대응하는 비트들 중 적어도 하나에 기반하여, 상기 제1 비트 선택기로부터 추출된 비트들 중에서, 상기 제3 부분과 구별되는 제4 부분에 대응하는 비트들을 조정하여, 상기 제1 정수 및 상기 제4 정수의 곱을 획득하는 제1 비트 조정기, 상기 제1 부분에 대응하는 비트들 중 적어도 하나에 기반하여, 상기 제3 포트의 비트들 중 상기 제1 부분과 상이한 제2 부분에 대응하는 비트들을 조정하는 제2 비트 조정기, 상기 제2 비트 조정기에 의해 조정된 비트들 중에서, 최하위 비트를 포함하는 제5 부분에 대응하는 비트들을 추출하여, 상기 제2 정수 및 상기 제3 정수의 곱을 획득하는 제3 비트 선택기, 및 상기 제5 부분에 대응하는 비트들 중 적어도 하나에 기반하여, 상기 제2 비트 조정기에 의해 조정된 비트들 중에서, 상기 제5 부분과 구별되는 제6 부분에 대응하는 비트들을 조정하여, 상기 제2 정수 및 상기 제4 정수의 곱을 획득하는 제3 비트 조정기를 포함할 수 있다.
상술한 바와 같은, 일 실시예에 따른 전자 장치의 방법은, 부동 소수점 수를 나타내기 위한 제1 데이터 타입과 상이하고, 정수를 나타내기 위한 제2 데이터 타입의 복수의 정수들에 기반하는 곱셈 연산을 수행하기 위한 요청을 수신하는 것에 응답하여 상기 복수의 정수들 중 제1 정수 및 제2 정수를 결합하는 동작, 상기 정수를 수신하는 것에 응답하여, 상기 복수의 정수들 중 제3 정수 및 제4 정수를 결합하는 동작, 상기 제1 정수 및 상기 제2 정수의 결합을 나타내는 제5 정수, 및 상기 제3 정수 및 상기 제4 정수의 결합을 나타내는 제6 정수 각각을, 상기 제1 데이터 타입에 의해 구별되는 상기 부동 소수점 수의 가수들에 대응하는 비트들의 곱을 획득하기 위한 곱셈기의 제1 포트 및 제2 포트로 입력하는 동작, 상기 곱셈기의 상기 제1 포트 및 상기 제2 포트와 상이한 제3 포트로부터, 상기 제5 정수 및 상기 제6 정수의 곱을 나타내는 제7 정수를 식별하는 것에 응답하여, 상기 식별된 제7 정수에 기반하여, 상기 제1 정수 또는 상기 제2 정수 중 어느 한 정수 및 상기 제3 정수 또는 상기 제4 정수 중 어느 한 정수의 조합의 곱들을 획득하는 동작을 포함할 수 있다.
일 실시예에 따른, 전자 장치는, 프로세서, 메모리, 및 복수의 레이어들을 가지는 뉴럴 네트워크를 트레이닝하기 위한 뉴럴 엔진을 포함하는 NPU(neural processing unit)를 포함하고, 상기 뉴럴 엔진은, 누적 회로(accumulation circuit), 및 결합기, 곱셈기, 덧셈기, 및 변환기를 포함하는 연산 회로, 상기 변환기는 비트 선택기, 비트 조절기, 스위치, 및 쉬프트 레지스터를 포함함, 및 누적 및 저장하는 컨트롤러를 포함할 수 있다. 상기 컨트롤러는, 상기 누적 회로 내에, 상기 뉴럴 네트워크의 특정 레이어 내에 포함된 노드들에 대응하는 가중 합을 계산하기 위하여 상기 연산 회로의 상이한 채널들로부터 출력된 수치 값들을, 누적, 및 저장할 수 있다. 상기 컨트롤러는 동작 상태에 적어도 부분적으로 기반하여 상기 결합기, 상기 덧셈기, 상기 비트 선택기, 또는 상기 비트 조절기 중 적어도 하나를 선택적으로 활성화할 수 있다.
예를 들어, 상기 뉴럴 엔진은, 부동 소수점 수를 나타내기 위한 제1 데이터 타입과 상이하고 정수를 나타내기 위한 제2 데이터 타입의 복수의 정수들에 기반하는 곱셈을 수행하기 위한 요청을 수신하는 것에 응답하여, 결합기를 이용하여, 상기 복수의 정수들 중에서 제1 정수, 및 제2 정수를 결합할 수 있다. 상기 뉴럴 엔진은, 상기 곱셈기를 이용하여, 상기 부동 소수점 수의 가수에 대응하는 비트들의 곱(product)을 획득할 수 있고, 상기 비트들은 제1 데이터 타입에 의해 구분되고, 상기 복수의 정수들 중 제3 정수가 상기 곱셈기의 제1 포트로 입력되고, 상기 곱셈기의 제2 포트로 상기 제1 정수, 및 상기 제2 정수의 결합을 나타내는 제4 정수가 입력된다. 상기 뉴럴 엔진은, 상기 변환기를 이용하여, 상기 제1 포트, 및 상기 제2 포트와 다른 상기 곱셈기의 제3 포트로부터 상기 제3 정수, 및 상기 제4 정수의 곱을 나타내는 제5 정수를 식별하는 것에 응답하여, 상기 식별된 제5 정수에 기반하여, 상기 제1 정수, 및 상기 제3 정수의 곱을 나타내는 제6 정수, 및 상기 제2 정수, 및 상기 제3 정수의 곱을 나타내는 제7 정수를 출력할 수 있다.
이상에서 설명된 장치는 하드웨어 구성요소, 소프트웨어 구성요소, 및/또는 하드웨어 구성요소 및 소프트웨어 구성요소의 조합으로 구현될 수 있다. 예를 들어, 실시예들에서 설명된 장치 및 구성요소는, 프로세서, 콘트롤러, ALU(arithmetic logic unit), 디지털 신호 프로세서(digital signal processor), 마이크로컴퓨터, FPGA(field programmable gate array), PLU(programmable logic unit), 마이크로프로세서, 또는 명령(instruction)을 실행하고 응답할 수 있는 다른 어떠한 장치와 같이, 하나 이상의 범용 컴퓨터 또는 특수 목적 컴퓨터를 이용하여 구현될 수 있다. 처리 장치는 운영 체제(OS) 및 상기 운영 체제 상에서 수행되는 하나 이상의 소프트웨어 어플리케이션을 수행할 수 있다. 또한, 처리 장치는 소프트웨어의 실행에 응답하여, 데이터를 접근, 저장, 조작, 처리 및 생성할 수도 있다. 이해의 편의를 위하여, 처리 장치는 하나가 사용되는 것으로 설명된 경우도 있지만, 해당 기술분야에서 통상의 지식을 가진 자는, 처리 장치가 복수 개의 처리 요소(processing element) 및/또는 복수 유형의 처리 요소를 포함할 수 있음을 알 수 있다. 예를 들어, 처리 장치는 복수 개의 프로세서 또는 하나의 프로세서 및 하나의 콘트롤러를 포함할 수 있다. 또한, 병렬 프로세서(parallel processor)와 같은, 다른 처리 구성(processing configuration)도 가능하다.
소프트웨어는 컴퓨터 프로그램(computer program), 코드(code), 명령(instruction), 또는 이들 중 하나 이상의 조합을 포함할 수 있으며, 원하는 대로 동작하도록 처리 장치를 구성하거나 독립적으로 또는 결합적으로(collectively) 처리 장치를 명령할 수 있다. 소프트웨어 및/또는 데이터는, 처리 장치에 의하여 해석되거나 처리 장치에 명령 또는 데이터를 제공하기 위하여, 어떤 유형의 기계, 구성요소(component), 물리적 장치, 컴퓨터 저장 매체 또는 장치에 구체화(embody)될 수 있다. 소프트웨어는 네트워크로 연결된 컴퓨터 시스템 상에 분산되어서, 분산된 방법으로 저장되거나 실행될 수도 있다. 소프트웨어 및 데이터는 하나 이상의 컴퓨터 판독 가능 기록 매체에 저장될 수 있다.
실시예에 따른 방법은 다양한 컴퓨터 수단을 통하여 수행될 수 있는 프로그램 명령 형태로 구현되어 컴퓨터 판독 가능 매체에 기록될 수 있다. 이때, 매체는 컴퓨터로 실행 가능한 프로그램을 계속 저장하거나, 실행 또는 다운로드를 위해 임시 저장하는 것일 수도 있다. 또한, 매체는 단일 또는 수 개의 하드웨어가 결합된 형태의 다양한 기록수단 또는 저장수단일 수 있는데, 어떤 컴퓨터 시스템에 직접 접속되는 매체에 한정되지 않고, 네트워크 상에 분산 존재하는 것일 수도 있다. 매체의 예시로는, 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체, CD-ROM 및 DVD와 같은 광기록 매체, 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical medium), 및 ROM, RAM, 플래시 메모리 등을 포함하여 프로그램 명령어가 저장되도록 구성된 것이 있을 수 있다. 또한, 다른 매체의 예시로, 어플리케이션을 유통하는 앱 스토어나 기타 다양한 소프트웨어를 공급 내지 유통하는 사이트, 서버 등에서 관리하는 기록매체 내지 저장매체도 들 수 있다.
이상과 같이 실시예들이 비록 한정된 실시예와 도면에 의해 설명되었으나, 해당 기술분야에서 통상의 지식을 가진 자라면 상기의 기재로부터 다양한 수정 및 변형이 가능하다. 예를 들어, 설명된 기술들이 설명된 방법과 다른 순서로 수행되거나, 및/또는 설명된 시스템, 구조, 장치, 회로 등의 구성요소들이 설명된 방법과 다른 형태로 결합 또는 조합되거나, 다른 구성요소 또는 균등물에 의하여 대치되거나 치환되더라도 적절한 결과가 달성될 수 있다.
그러므로, 다른 구현들, 다른 실시예들 및 특허청구범위와 균등한 것들도 후술하는 특허청구범위의 범위에 속한다.

Claims (15)

  1. 전자 장치(electronic device)에 있어서,
    부동 소수점 수(floating point number)를 나타내기 위한 제1 데이터 타입과 상이하고, 정수를 나타내기 위한 제2 데이터 타입의 복수의 정수들(integer numbers)에 기반하는 곱셈 연산(multiplication)을 수행하기 위한 요청을 수신하는 것에 응답하여, 상기 복수의 정수들 중 제1 정수 및 제2 정수를 결합하는 결합기;
    상기 제1 데이터 타입에 의해 구별되는 상기 부동 소수점 수의 가수들(mantissas)에 대응하는 비트들의 곱(product)을 획득하기 위한 곱셈기, 상기 복수의 정수들 중 제3 정수가 상기 곱셈기의 제1 포트로 입력되고, 상기 결합기에 의한 상기 제1 정수 및 상기 제2 정수의 결합을 나타내는 제4 정수가 상기 곱셈기의 제2 포트로 입력됨;
    상기 곱셈기의 상기 제1 포트 및 상기 제2 포트와 상이한 제3 포트로부터, 상기 제3 정수 및 상기 제4 정수의 곱을 나타내는 제5 정수를 식별하는 것에 응답하여, 상기 식별된 제5 정수에 기반하여, 상기 제1 정수 및 상기 제3 정수의 곱을 나타내는 제6 정수, 및 상기 제2 정수 및 상기 제3 정수의 곱을 나타내는 제7 정수를 출력하는 변환기(converter)를 포함하는 연산 회로를 포함하는 전자 장치.
  2. 제1항에 있어서,
    상기 결합기는,
    부호 확장(sign extension)을 이용하여, 상기 제1 데이터 타입의 부동 소수점 수의 가수를 나타내는 비트들의 수를 따라 나타낸, 상기 제1 정수 및 상기 제2 데이터 타입의 정수를 나타내는 비트들의 수에 기반하여 시프트된(shifted) 상기 제2 정수를 결합하여, 상기 제4 정수를 출력하는 전자 장치.
  3. 제1항에 있어서,
    상기 변환기는,
    상기 제5 정수를 나타내는 상기 제3 포트의 비트들 중 제1 부분에 대응하는 비트들을 추출하여, 상기 제6 정수를 획득하는 비트 선택기(bit selector); 및
    상기 제6 정수를 나타내는 비트들 중 적어도 하나의 비트 및 상기 제3 포트의 비트들 중에서 상기 제1 부분과 상이한 제2 부분에 대응하는 비트들에 기반하여, 상기 제7 정수를 획득하는 비트 조정기(bit adjuster)를 포함하는 전자 장치.
  4. 제3항에 있어서,
    상기 변환기의 상기 비트 조정기는,
    상기 제1 부분에 대응하는 비트들 중 최상위 비트(most significant bit, MSB) 및 상기 제2 부분에 대응하는 하나 이상의 비트들을 결합하여, 상기 제7 정수를 획득하는 전자 장치.
  5. 제3항에 있어서,
    상기 전자 장치는,
    시프트 레지스터를 더 포함하고,
    상기 변환기는,
    상기 요청을 수신한 상태에서, 상기 제6 정수 또는 상기 제5 정수 중 상기 제6 정수를, 상기 시프트 레지스터로 송신하고, 및 상기 요청과 상이한 다른 요청을 수신한 상태에서, 상기 제6 정수 또는 상기 제5 정수 중 상기 제5 정수를, 상기 시프트 레지스터로 송신하는 스위치
    를 더 포함하는 전자 장치.
  6. 제1항에 있어서,
    상기 곱셈기는,
    상기 결합기로부터 출력된 상기 제4 정수를 식별하는 것에 응답하여, 상기 식별된 제4 정수, 및 부호 확장을 이용하여 상기 제1 데이터 타입의 부동 소수점 수의 가수를 나타내는 비트들의 수를 따라 나타낸 상기 제3 정수의 곱셈 연산을 수행하여, 상기 제5 정수를 출력하는 전자 장치.
  7. 제1항에 있어서,
    상기 곱셈기는,
    상기 요청과 상이한, 상기 제1 데이터 타입에 기반하는 제1 부동 소수점 수 및 제2 부동 소수점 수의 곱셈 연산을 수행하라는 다른 요청을 수신하는 것에 응답하여, 상기 제1 부동 소수점 수의 제1 가수 및 상기 제2 부동 소수점 수의 제2 가수의 곱셈 연산을 수행하여, 제3 가수를 출력하고,
    상기 제1 가수 및 상기 제2 가수는, 상기 결합기를 바이패스하여 상기 곱셈기에 입력되는 전자 장치.
  8. 제7항에 있어서,
    상기 연산 회로는,
    상기 제1 부동 소수점 수의 제1 지수 및 상기 제2 부동 소수점 수의 제2 지수의 덧셈 연산을 수행하여, 제3 지수를 출력하는 덧셈기; 및
    상기 덧셈기로부터 출력되는 상기 제3 지수에 기반하여, 상기 제3 가수를 시프트하는 시프트 레지스터를 더 포함하는 전자 장치.
  9. 전자 장치의 방법에 있어서,
    부동 소수점 수를 나타내기 위한 제1 데이터 타입과 상이하고, 정수를 나타내기 위한 제2 데이터 타입의 복수의 정수들에 기반하는 곱셈 연산을 수행하라는 요청을 수신하는 것에 응답하여, 상기 복수의 정수들 중 제1 정수 및 제2 정수를 결합하는 동작;
    상기 제1 데이터 타입에 의해 구별되는 상기 부동 소수점 수의 가수들에 대응하는 비트들의 곱(product)을 획득하기 위한 곱셈기의 제1 포트로, 상기 가수의 비트들의 수에 기반하여 상기 복수의 정수들 중 제3 정수를 송신하는 동작;
    상기 제1 포트로 상기 제3 정수를 송신하는 상태에서, 상기 곱셈기의 상기 제1 포트와 구별되는 제2 포트로, 상기 제1 정수 및 상기 제2 정수의 결합을 나타내는 제4 정수를 송신하는 동작;
    상기 곱셈기의 상기 제1 포트 및 상기 제2 포트와 상이한 제3 포트로부터, 상기 제3 정수 및 상기 제4 정수의 곱을 나타내는 제5 정수를 식별하는 것에 응답하여, 상기 획득된 제5 정수에 기반하여, 상기 제1 정수 및 상기 제3 정수의 곱을 나타내는 제6 정수 및 상기 제2 정수 및 상기 제3 정수의 곱을 나타내는 제7 정수를 획득하는 동작을 포함하는 방법.
  10. 제9항에 있어서,
    상기 결합하는 동작은,
    상기 제1 정수를, 부호 확장(sign extension)을 이용하여, 상기 제1 데이터 타입의 부동 소수점 수의 가수를 나타내는 비트들의 수를 따라 나타내는 동작;
    상기 제2 정수를, 상기 제1 정수 및 상기 제2 데이터 타입의 정수를 나타내는 비트들의 수에 기반하여 시프트하는(shifting) 동작; 및
    상기 부동 소수점 수의 가수를 따라 나타내어진 상기 제1 정수 및 상기 시프트된 제2 정수를 더하여, 상기 제4 정수를 획득하는 동작을 포함하는 방법.
  11. 제9항에 있어서,
    상기 획득하는 동작은,
    상기 제5 정수를 나타내는 상기 제3 포트의 비트들 중 제1 부분에 대응하는 비트들을 추출하여, 상기 제6 정수를 획득하는 동작; 및
    상기 제6 정수를 나타내는 비트들 중 적어도 하나의 비트 및 상기 제3 포트의 비트들 중에서 상기 제1 부분과 상이한 제2 부분에 대응하는 비트들에 기반하여, 상기 제7 정수를 획득하는 동작을 포함하는 전자 장치.
  12. 제11항에 있어서,
    상기 제7 정수를 획득하는 동작은,
    상기 제1 부분에 대응하는 비트들 중 최상위 비트 및 상기 제2 부분에 대응하는 하나 이상의 비트들을 결합하여, 상기 제7 정수를 획득하는 동작을 포함하는 전자 장치.
  13. 제9항에 있어서,
    상기 제3 정수를 송신하는 동작은,
    상기 제1 포트로, 부호 확장을 이용하여 상기 제1 데이터 타입의 부동 소수점의 가수를 나타내는 비트들의 수를 따라 나타낸 상기 제3 정수를 송신하는 동작을 더 포함하는 방법.
  14. 제9항에 있어서,
    상기 요청과 상이한, 상기 제1 데이터 타입에 기반하는 제1 부동 소수점 수 및 제2 부동 소수점 수의 곱셈 연산을 수행하라는 다른 요청을 수신하는 것에 응답하여, 상기 곱셈기의 상기 제1 포트로 상기 제1 부동 소수점 수의 제1 가수를 입력하고, 상기 곱셈기의 상기 제2 포트로 상기 제2 부동 소수점 수의 제2 가수를 입력하는 동작;
    상기 제1 포트로 상기 제1 가수를 입력하고, 상기 제2 포트로 상기 제2 가수를 입력한 상태에서, 상기 곱셈기의 상기 제3 포트로부터 상기 제1 가수 및 상기 제2 가수의 곱에 대응하는 제3 가수를 획득하는 동작을 더 포함하는 방법.
  15. 제14항에 있어서,
    상기 다른 요청을 수신하는 것에 응답하여, 상기 제1 부동 소수점 수의 제1 지수 및 상기 제2 부동 소수점 수의 제2 지수의 덧셈 연산을 수행하여, 제3 지수를 획득하는 동작; 및
    상기 획득된 제3 지수에 기반하여, 상기 제3 가수를 시프트하는 동작을 더 포함하는 방법.
PCT/KR2022/009974 2021-10-18 2022-07-08 상이한 데이터 타입들을 지원하는 npu를 포함하는 전자 장치 및 그 제어 방법 WO2023068489A1 (ko)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP22883719.1A EP4390661A1 (en) 2021-10-18 2022-07-08 Electronic device comprising npu supporting different data types, and control method thereof
US17/877,149 US20230123312A1 (en) 2021-10-18 2022-07-29 Electronic device including neural processing unit supporting different data types and method for controlling the same

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
KR20210138723 2021-10-18
KR10-2021-0138723 2021-10-18
KR10-2021-0164971 2021-11-25
KR1020210164971A KR20230055315A (ko) 2021-10-18 2021-11-25 상이한 데이터 타입들을 지원하는 npu를 포함하는 전자 장치 및 그 방법

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/877,149 Continuation US20230123312A1 (en) 2021-10-18 2022-07-29 Electronic device including neural processing unit supporting different data types and method for controlling the same

Publications (1)

Publication Number Publication Date
WO2023068489A1 true WO2023068489A1 (ko) 2023-04-27

Family

ID=86059285

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2022/009974 WO2023068489A1 (ko) 2021-10-18 2022-07-08 상이한 데이터 타입들을 지원하는 npu를 포함하는 전자 장치 및 그 제어 방법

Country Status (1)

Country Link
WO (1) WO2023068489A1 (ko)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05128284A (ja) * 1991-11-07 1993-05-25 Matsushita Electric Ind Co Ltd ニユーロプロセツサ
US20180285727A1 (en) * 2017-04-04 2018-10-04 Hailo Technologies Ltd. Neural Network Processing Element Incorporating Compute And Local Memory Elements
KR20200129666A (ko) * 2019-05-09 2020-11-18 한국전자통신연구원 신경망 연산 장치 및 그것의 요소 기반 레이어에 대한 처리 방법
KR20210057158A (ko) * 2018-09-19 2021-05-20 자일링크스 인코포레이티드 곱셈 및 누산 회로
KR20210124888A (ko) * 2020-04-07 2021-10-15 삼성전자주식회사 뉴럴 네트워크 연산 수행을 위한 뉴럴 네트워크 장치, 뉴럴 네트워크 장치의 동작 방법 및 뉴럴 네트워크 장치를 포함하는 애플리케이션 프로세서

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05128284A (ja) * 1991-11-07 1993-05-25 Matsushita Electric Ind Co Ltd ニユーロプロセツサ
US20180285727A1 (en) * 2017-04-04 2018-10-04 Hailo Technologies Ltd. Neural Network Processing Element Incorporating Compute And Local Memory Elements
KR20210057158A (ko) * 2018-09-19 2021-05-20 자일링크스 인코포레이티드 곱셈 및 누산 회로
KR20200129666A (ko) * 2019-05-09 2020-11-18 한국전자통신연구원 신경망 연산 장치 및 그것의 요소 기반 레이어에 대한 처리 방법
KR20210124888A (ko) * 2020-04-07 2021-10-15 삼성전자주식회사 뉴럴 네트워크 연산 수행을 위한 뉴럴 네트워크 장치, 뉴럴 네트워크 장치의 동작 방법 및 뉴럴 네트워크 장치를 포함하는 애플리케이션 프로세서

Similar Documents

Publication Publication Date Title
WO2022080617A1 (en) Electronic device including flexible display and method for operating screen of electronic device
WO2022131521A1 (ko) 터치스크린을 포함하는 입력 장치와 이의 동작 방법
WO2021177695A1 (en) Electronic device for providing transaction information and operating method thereof
WO2020213935A1 (en) Electronic device and method for controlling flexible display
WO2022045490A1 (en) Method for providing three dimensional input and electronic device supporting the same
WO2023068489A1 (ko) 상이한 데이터 타입들을 지원하는 npu를 포함하는 전자 장치 및 그 제어 방법
WO2023096189A1 (ko) 안테나를 포함하는 전자 장치
WO2022131818A1 (ko) 전기적 스트레스를 제거하는 구조를 포함하는 전자 장치 및 인쇄 회로 기판
WO2022119219A1 (ko) 전자 장치 및 전자 장치의 동작 방법
WO2022154166A1 (ko) 콘텐츠 생성 기능을 제공하기 위한 방법 및 이를 지원하는 전자 장치
WO2022025526A1 (ko) 입력 데이터를 제공하는 방법 및 이를 지원하는 전자 장치
WO2024043696A1 (ko) 인공지능 모델을 이용하여 연산을 수행하는 전자 장치 및 전자 장치의 동작 방법
WO2023043035A1 (ko) 적어도 하나의 웨어러블 장치를 제어하기 위한 전자 장치, 방법, 및 비일시적 컴퓨터 판독가능 저장 매체
WO2024112157A1 (ko) 공동 편집 명령어를 처리하는 전자 장치 및 그 방법
WO2023018230A1 (ko) 전자 장치 및 전자 장치의 동작 방법
WO2023249206A1 (ko) 스케줄 관리를 위한 소프트웨어 어플리케이션에 관한 동작을 수행하기 위한 전자 장치 및 방법
WO2024063432A1 (ko) 전자 장치의 어플리케이션 실행 화면 제어 방법 및 그 전자 장치
WO2022270885A1 (ko) 플렉서블 디스플레이 및 그 플렉서블 디스플레이를 포함하는 전자 장치
WO2024029732A1 (ko) 시각적 왜곡 보정을 위한 전자 장치 및 방법
WO2024029716A1 (ko) 플렉서블 디스플레이를 통해 화면을 표시하기 위한 전자 장치 및 방법
WO2022108213A1 (ko) 스피커를 포함하는 전자 장치 및 그 전자 장치의 동작 방법
WO2023204471A1 (ko) 전자 장치 및 그의 충전 제어 방법
WO2023043148A1 (ko) 송신 신호에 공급되는 전력 제어 방법 및 전자 장치
WO2022177134A1 (ko) 전자 장치 및 전자 장치에서 광학 센서의 인식률을 개선시키는 방법
WO2023068468A1 (ko) 전자 장치의 그립 상태를 식별하기 위한 전자 장치 및 방법

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22883719

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2022883719

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2022883719

Country of ref document: EP

Effective date: 20240318

NENP Non-entry into the national phase

Ref country code: DE