Model instance management method and device for large model, equipment and medium
By receiving and rearranging the order of sample data and storing it using a message queue, the data consistency problem in model instance updates is solved, achieving efficient synchronous updates of model instances and ensuring model consistency and user experience.
Patent Information
- Application Number
- CN202411358467.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-01-10
AI Technical Summary
When updating multiple model instances, existing technologies struggle to guarantee data consistency, especially when transmission link delays and congestion cause sample data to become disordered, affecting the effectiveness of model updates and user experience.
By receiving and rearranging sample data with sequential identifiers, storing it in a message queue, and sending it sequentially to an inference service with independent computing resources for training, the system ensures that each model instance reads sample data in order, thus achieving synchronous updates.
During the model instance update process, data consistency was ensured, service interruption was avoided, and the efficiency and consistency of model updates were improved.
Smart Images

Figure CN119294363A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, especially to technical fields such as machine learning and deep learning, and can be used in application scenarios such as generative search, intelligent document editing, intelligent assistants, virtual assistants, and intelligent e-commerce. It specifically relates to a model instance management method, device, electronic device, computer-readable storage medium, and computer program product for large models. Background Art
[0002] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.
[0003] At present, AI-Generated Content (AIGC) technology based on big models is rapidly empowering all walks of life, and the demand for scenario-based and customized AIGC is becoming more and more vigorous. For example, for scenarios such as medical Q&A and legal consultation, they all expect to have big model services that fit the business scenarios.
[0004] The methods described in this section are not necessarily methods that have been previously conceived or employed. Unless otherwise indicated, it should not be assumed that any method described in this section is considered to be prior art simply because it is included in this section. Similarly, unless otherwise indicated, the issues mentioned in this section should not be considered to have been recognized in any prior art. Summary of the invention
[0005] The present disclosure provides a model instance management method, apparatus, electronic device, computer-readable storage medium, and computer program product for a large model.
[0006] According to one aspect of the present disclosure, a model instance management method for a large model is provided, comprising: receiving a plurality of first sample data for training a first large model, each of the plurality of first sample data comprising a sequence identifier; rearranging the plurality of first sample data according to their respective sequence identifiers to obtain a plurality of second sample data; and sending a first instruction to a plurality of inference services running a first model instance, so that each of the plurality of inference services sequentially reads each of the plurality of second sample data, and trains a corresponding first model instance based on the second sample data, wherein the first model instance is a model instance corresponding to the first large model, and the plurality of inference services are respectively configured with independent computing resources.
[0007] According to another aspect of the present disclosure, a model instance management device for a large model is provided, comprising: a receiving unit, configured to receive a plurality of first sample data for training a first large model, each of the plurality of first sample data comprising a sequence identifier; a rearrangement unit, configured to rearrange the plurality of first sample data according to their respective sequence identifiers to obtain a plurality of second sample data; and a sending unit, configured to send a first instruction to a plurality of inference services running a first model instance, so that each of the plurality of inference services sequentially reads each of the plurality of second sample data, and trains a corresponding first model instance based on the second sample data, wherein the first model instance is a model instance corresponding to the first large model, and the plurality of inference services are respectively configured with independent computing resources.
[0008] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the above-mentioned model instance management method for large models.
[0009] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the above-mentioned model instance management method for a large model.
[0010] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein the computer program implements the above-mentioned model instance management method for a large model when executed by a processor.
[0011] According to one or more embodiments of the present disclosure, the received multiple first sample data can be rearranged according to sequential identifiers so that each inference service running a first model instance reads each sample data in sequence to complete the training of the corresponding first model instance, thereby ensuring data consistency of multiple model instances when updating the multiple model instances.
[0012] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0014] Figure 1 A schematic diagram showing an exemplary system in which the various methods described herein may be implemented according to an embodiment of the present disclosure;
[0015] Figure 2 A flowchart of a model instance management method for a large model according to an embodiment of the present disclosure is shown;
[0016] Figure 3 A flowchart of training a first model instance based on second sample data according to an embodiment of the present disclosure is shown;
[0017] Figure 4 A schematic diagram showing a model instance management method for a large model according to an exemplary embodiment of the present disclosure is shown;
[0018] Figure 5 A structural block diagram of a model instance management device for a large model according to an embodiment of the present disclosure is shown;
[0019] Figure 6 A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0020] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0021] In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, temporal relationship, or importance relationship of these elements, and such terms are only used to distinguish one element from another element. In some examples, the first element and the second element may refer to the same instance of the element, and in some cases, based on the description of the context, they may also refer to different instances.
[0022] The terms used in the description of various examples in this disclosure are only for the purpose of describing specific examples and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element can be one or more. In addition, the term "and / or" used in this disclosure covers any one of the listed items and all possible combinations.
[0023] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
[0024] Figure 1 FIG. 1 is a schematic diagram of an exemplary system 100 in which various methods and apparatuses described herein may be implemented according to an embodiment of the present disclosure. Figure 1 , the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.
[0025] In an embodiment of the present disclosure, the server 120 may run one or more services or software applications that enable execution of the model instance management method for a large model.
[0026] In some embodiments, server 120 may also provide other services or software applications, which may include non-virtualized environments and virtualized environments. In some embodiments, these services may be provided as web-based services or cloud services, such as provided to users of client devices 101, 102, 103, 104, 105, and / or 106 under a software as a service (SaaS) model.
[0027] exist Figure 1In the configuration shown, the server 120 may include one or more components that implement the functions performed by the server 120. These components may include software components, hardware components, or a combination thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 may in turn utilize one or more client applications to interact with the server 120 to utilize the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from the system 100. Therefore, Figure 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.
[0028] The user may use client devices 101, 102, 103, 104, 105 and / or 106 to send sample data. The client device may provide an interface that enables the user of the client device to interact with the client device. The client device may also output information to the user via the interface. Figure 1 Only six client devices are depicted, but one skilled in the art will appreciate that the present disclosure may support any number of client devices.
[0029] Client devices 101, 102, 103, 104, 105 and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptop computers), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, game systems, thin clients, various messaging devices, sensors or other sensing devices, etc. These computer devices may run various types and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as GOOGLE Chrome OS); or include various mobile operating systems, such as MICROSOFT Windows Mobile OS, iOS, Windows Phone, Android. Portable handheld devices may include cellular phones, smart phones, tablet computers, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Game systems may include various handheld game devices, Internet-enabled game devices, etc. Client devices are capable of executing various different applications, such as various Internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and may use various communication protocols.
[0030] The network 110 may be any type of network known to those skilled in the art that may support data communications using any of a variety of available protocols, including but not limited to TCP / IP, SNA, IPX, etc. By way of example only, the one or more networks 110 may be a local area network (LAN), an Ethernet-based network, a token ring, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.
[0031] Server 120 may include one or more general purpose computers, dedicated server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running virtual operating systems, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that may be virtualized to maintain a server's virtual storage device). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.
[0032] The computing units in the server 120 may run one or more operating systems including any of the above operating systems and any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and / or middle-tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.
[0033] In some implementations, server 120 may include one or more applications to analyze and consolidate data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and / or 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and / or 106.
[0034] In some embodiments, the server 120 may be a server of a distributed system, or a server combined with a blockchain. The server 120 may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in a cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services.
[0035] The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. The databases 130 may reside in various locations. For example, the database used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. The databases 130 may be of different types. In some embodiments, the databases used by the server 120 may be, for example, relational databases. One or more of these databases may store, update, and retrieve data to and from the databases in response to commands.
[0036] In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the applications may be different types of databases, such as a key-value store, an object store, or a conventional store backed by a file system.
[0037] Figure 1 The system 100 may be configured and operated in various ways to enable the application of various methods and apparatuses described in the present disclosure.
[0038] According to the embodiments of the present disclosure, Figure 2 As shown, a model instance management method for a large model is provided, including: step S201, receiving multiple first sample data for training a first large model, each of the multiple first sample data including a sequence identifier; step S202, rearranging the multiple first sample data according to their respective sequence identifiers to obtain multiple second sample data; and step S203, sending a first instruction to multiple inference services running the first model instance, so that each of the multiple inference services reads each of the multiple second sample data in sequence, and trains the corresponding first model instance based on the second sample data, wherein the first model instance is a model instance corresponding to the first large model, and the multiple inference services are respectively configured with independent computing resources.
[0039] Therefore, by rearranging the received multiple first sample data according to sequential identifiers, each inference service running the first model instance reads each sample data in sequence to complete the training of the corresponding first model instance, thereby ensuring the data consistency of multiple model instances when updating multiple model instances.
[0040] The above-mentioned inference service (Agent) refers to a service obtained by encapsulating a large model. The large model itself is just a file with parameters, so the large model needs to be encapsulated as an inference service and computing resources need to be configured for the inference service before the large model can be used for model inference.
[0041] The inference service has various interfaces. When calling the service, you can call various interfaces exposed by the inference service to perform various operations. For example, in the process of responding to user requests, you can call the input interface of the inference service. The inference service uses computing resources to obtain the data to be processed through the input interface. After the large model performs model inference on the input data, you can obtain the model inference result from the output interface of the inference service.
[0042] When encapsulating a large model as an inference service, the parameter file of the large model can be input into a pre-built service framework to obtain a model instance corresponding to the large model, and inference services can be provided based on the model instance.
[0043] In addition, for the same large model, one or more inference services (that is, corresponding to multiple model instances) can be encapsulated. When multiple inference services are encapsulated, independent computing resources can be configured for each inference service (for example, deployed on different devices respectively). In this way, when multiple requests are received, multiple inference services can be called, and their respective model instances and configured computing resources can be used to process multiple requests in parallel.
[0044] After obtaining multiple first model instances corresponding to the first large model and running on multiple reasoning services respectively in the above manner, if the provider of the first large model further trains and updates the first large model, it is necessary to synchronize and update each first model instance in the multiple reasoning services. Since a large model usually has tens of millions of parameters, if each first model instance is synchronized and updated directly by copying the parameter file, it will take up a lot of additional memory space, consume a lot of data copying and transmission time, and when reloading the parameter file, it is also necessary to stop providing external services, affecting the user experience.
[0045] In some embodiments, the update of the first large model is usually performed by training the first large model with new samples, thereby obtaining an updated first large model with better performance. Therefore, the above new samples (i.e., multiple first sample data) can be used to train each first model instance respectively, thereby achieving synchronous update of each first model instance.
[0046] When the provider transmits multiple first sample data, due to possible delays and congestion in the transmission link, even if the multiple first sample data are sent in sequence, the order in which they are received may be completely disrupted. Training different first model instances with first sample data in different orders will inevitably lead to the inability to guarantee data consistency of the updated first model instances.
[0047] In some embodiments, the provider first transmits multiple first sample data to the model instance management service respectively. After receiving the first sample data, the model instance management service first rearranges the multiple first sample data according to the sequence identifier corresponding to each first sample data to obtain multiple second sample data; then, a first instruction is sent to multiple inference services running the first model instance, so that each inference service reads each second sample data in turn, and applies the second sample data to train the first model instance running in the inference service to complete the synchronous update of the first model instance.
[0048] Therefore, through the method provided by the above embodiment, it is possible to ensure that the order of the first sample data applied to each first model instance is consistent and the same as the order of multiple sample data used to train the first large model, thereby ensuring the data consistency of multiple model instances when updating multiple model instances.
[0049] In some embodiments, each sample included in the plurality of first sample data may include a question text and a corresponding answer text.
[0050] In some embodiments, the sequence identifier may be, for example, a number used to mark the sequence.
[0051] In some embodiments, the sequence identifier may be a time identifier.
[0052] In some embodiments, the time identifier may be a timestamp automatically annotated when the first sample data is generated. In some embodiments, the time identifier may also be a timestamp automatically annotated when the first sample data is sent. Since this type of time identifier is an objective time automatically annotated in response to a specific operation on the first sample data, it does not require manual operation, can further avoid errors that occur during manual annotation, and further ensure the data consistency of the updated multiple first model instances and the updated first large model.
[0053] In some embodiments, rearranging the plurality of first sample data according to their respective sequence identifiers to obtain the plurality of second sample data may include: writing the plurality of first sample data into a message queue in sequence according to their respective sequence identifiers to obtain the plurality of second sample data stored in the message queue.
[0054] Therefore, by applying a message queue to store the second sample data, it is possible to further ensure that each first model instance can read the sample data in sequence, thereby further ensuring the data consistency of multiple model instances.
[0055] In some embodiments, the message queue may be a distributed message queue based on a publish / subscribe model, such as Kafka.
[0056] In some embodiments, each first sample data corresponds to a sample, and each first sample data can be written into Kafka in sequence according to a sequence identifier (time identifier), wherein each first sample data is a string.
[0057] In some embodiments, the multiple first sample data may include both sample data corresponding to a single sample and compressed data based on multiple samples. Each first sample data may be written into Kafka in sequence according to a sequence identifier (time identifier), wherein each sample data may be stored in the form of "type (tpye) + data", wherein type 0 indicates that the sample data only includes a single sample, and type 1 indicates that the sample data is a collection of multiple samples.
[0058] In some embodiments, Figure 3 As shown, training the corresponding first model instance based on the second sample data may include: step S301, in response to the second sample data being a compressed package consisting of multiple samples, decompressing the second sample data to obtain multiple first samples, wherein each first sample in the multiple first samples includes a sequence identifier; step S302, rearranging the multiple first samples according to their respective sequence identifiers to obtain multiple second samples; and step S303, training the corresponding first model instance based on each second sample in the multiple second samples in turn.
[0059] In this way, the form of uploading sample data can be further expanded; at the same time, by further marking the sequence identifier of each sample in the compressed data, the data consistency of multiple model instances can be guaranteed under the sample data uploading method.
[0060] In some embodiments, for the compressed data in the first sample data, each first sample contained therein is also marked with a sequential identifier (for example, a time identifier); after reading the first sample data, the inference service can first decompress the first sample data to obtain multiple first samples contained in the first sample data and the sequential identifiers corresponding to each first sample; then, the inference service can send each sample to the first model instance in sequence according to the order indicated by the sequential identifier to train the first model instance.
[0061] In some embodiments, each inference service can continue to provide external services based on the first model instance being trained during the synchronization update operation, thereby avoiding service interruption caused by the model synchronization process.
[0062] Figure 4 A schematic diagram of a model instance management method for a large model according to an exemplary embodiment of the present disclosure is shown.
[0063] In some exemplary embodiments, Figure 4 As shown, the sample data can come from the sample data provider 410; the model instance management service 420 is used to manage the data consistency of multiple first model instances (first model instance 451, first model instance 452 and first model instance 453) corresponding to multiple reasoning services (inference service 441, reasoning service 442 and reasoning service 443).
[0064] In some exemplary embodiments, after receiving multiple first sample data transmitted by the sample data provider 410, the model instance management service 420 can first organize the first sample data based on the time stamp of each first sample data, and write them into the message queue 430 in sequence according to the order of the time stamps, and send a first instruction to each inference service to enable each inference service to perform a sample data reading operation and an update operation on the corresponding model instance.
[0065] In some exemplary embodiments, after receiving the first instruction, each inference service can read each sample data from the message queue 430 in sequence, and determine whether the sample data needs to be decompressed according to the type corresponding to each sample data. If decompression is not required, the sample data is directly input into the corresponding first model instance for model training; if decompression is required, the sample data is first decompressed to obtain multiple samples, and then, according to the time stamp corresponding to each sample, each sample is sequentially sent into the corresponding first model instance for model training.
[0066] Therefore, by controlling the order of sample data in each link, the data consistency between each first model instance and the data consistency between each first model instance and the first large model are guaranteed.
[0067] In some embodiments, Figure 5As shown, a model instance management device 500 for a large model is provided, comprising: a receiving unit 510, configured to receive multiple first sample data for training a first large model, each of the multiple first sample data comprising a sequence identifier; a rearrangement unit 520, configured to rearrange the multiple first sample data according to their respective sequence identifiers to obtain multiple second sample data; and a sending unit 530, configured to send a first instruction to multiple inference services running a first model instance, so that each of the multiple inference services reads each of the multiple second sample data in sequence, and trains the corresponding first model instance based on the second sample data, wherein the first model instance is a model instance corresponding to the first large model, and the multiple inference services are respectively configured with independent computing resources.
[0068] Among them, the operations performed by units 510 to 530 in the above-mentioned device 500 and the effects that can be achieved are similar to steps S201 to S203 in the above-mentioned model instance management method for large models, and will not be repeated here.
[0069] In some embodiments, the rearrangement unit may be further configured to: write the plurality of first sample data into the message queue in sequence according to their respective sequence identifiers, so as to obtain the plurality of second sample data stored in the message queue.
[0070] In some embodiments, training a corresponding first model instance based on the second sample data may include: in response to the second sample data being a compressed package consisting of multiple samples, decompressing the second sample data to obtain multiple first samples, wherein each first sample in the multiple first samples includes a sequence identifier; rearranging the multiple first samples according to their respective sequence identifiers to obtain multiple second samples; and training the corresponding first model instance based on each second sample in the multiple second samples in turn.
[0071] In some embodiments, the sequence identifier may be a time identifier.
[0072] In some embodiments, each sample included in the plurality of first sample data may include a question text and a corresponding answer text.
[0073] According to an embodiment of the present disclosure, an electronic device, a readable storage medium and a computer program product are also provided.
[0074] refer to Figure 6, a block diagram of an electronic device 600 that can be used as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0075] like Figure 6 As shown, the electronic device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0076] Multiple components in the electronic device 600 are connected to the I / O interface 605, including: an input unit 606, an output unit 607, a storage unit 608, and a communication unit 609. The input unit 606 can be any type of device that can input information to the electronic device 600. The input unit 606 can receive input digital or character information and generate key signal input related to user settings and / or function control of the electronic device, and can include but is not limited to a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and / or a remote controller. The output unit 607 can be any type of device that can present information, and can include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 608 can include but is not limited to a disk, an optical disk. The communication unit 609 allows the electronic device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth device, an 802.11 device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0077] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as the above-mentioned model instance management method for a large model. For example, in some embodiments, the above-mentioned model instance management method for a large model may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the above-mentioned model instance management method for a large model may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to execute the above-mentioned model instance management method for a large model in any other appropriate manner (for example, by means of firmware).
[0078] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0079] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0080] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0081] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0082] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0083] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0084] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0085] Although the embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-mentioned methods, systems and devices are merely exemplary embodiments or examples, and the scope of the present invention is not limited by these embodiments or examples, but only by the claims after authorization and their equivalent scope. Various elements in the embodiments or examples can be omitted or replaced by their equivalent elements. In addition, each step can be performed in an order different from that described in the present disclosure. Further, the various elements in the embodiments or examples can be combined in various ways. It is important that with the evolution of technology, many elements described herein can be replaced by equivalent elements that appear after the present disclosure.
Claims
1. A model instance management method for a large model, the method comprising: Receiving a plurality of first sample data for training a first large model, each of the plurality of first sample data comprising a sequence identifier; Rearranging the plurality of first sample data according to their respective sequence identifiers to obtain a plurality of second sample data; as well as A first instruction is sent to multiple inference services running a first model instance, so that each of the multiple inference services sequentially reads each of the multiple second sample data and trains a corresponding first model instance based on the second sample data, wherein the first model instance is a model instance corresponding to the first large model, and the multiple inference services are respectively configured with independent computing resources.
2. The method according to claim 1, wherein: The re-arranging the plurality of first sample data according to their respective sequence identifiers to obtain a plurality of second sample data comprises: The multiple first sample data are sequentially written into the message queue according to their respective sequence identifiers to obtain the multiple second sample data stored in the message queue.
3. The method according to any one of claims 1 or 2, wherein: The training of the corresponding first model instance based on the second sample data includes: In response to the second sample data being a compressed package consisting of a plurality of samples, decompressing the second sample data to obtain a plurality of first samples, wherein each first sample in the plurality of first samples includes a sequence identifier; Rearranging the plurality of first samples according to their respective sequence identifiers to obtain a plurality of second samples; and Based on each second sample in the plurality of second samples, a corresponding first model instance is trained in turn.
4. The method according to any one of claims 1 to 3, wherein: The sequence identifier is a time identifier.
5. The method according to any one of claims 1 to 4, wherein: Each sample included in the plurality of first sample data includes a question text and a corresponding answer text.
6. A model instance management device for a large model, the device comprising: A receiving unit, configured to receive a plurality of first sample data for training a first large model, each of the plurality of first sample data comprising a sequence identifier; a rearrangement unit, configured to rearrange the plurality of first sample data according to their respective sequence identifiers to obtain a plurality of second sample data; as well as A sending unit is configured to send a first instruction to multiple inference services running a first model instance, so that each of the multiple inference services reads each of the multiple second sample data in sequence, and trains a corresponding first model instance based on the second sample data, wherein the first model instance is a model instance corresponding to the first large model, and the multiple inference services are respectively configured with independent computing resources.
7. The device according to claim 6, wherein: The rearrangement unit is further configured to: The multiple first sample data are sequentially written into the message queue according to their respective sequence identifiers to obtain the multiple second sample data stored in the message queue.
8. The device according to any one of claims 6 or 7, wherein: The training of the corresponding first model instance based on the second sample data includes: In response to the second sample data being a compressed package consisting of a plurality of samples, decompressing the second sample data to obtain a plurality of first samples, wherein each first sample in the plurality of first samples includes a sequence identifier; Rearranging the plurality of first samples according to their respective sequence identifiers to obtain a plurality of second samples; and Based on each second sample in the plurality of second samples, a corresponding first model instance is trained in turn.
9. The device according to any one of claims 6 to 8, wherein: The sequence identifier is a time identifier.
10. The device according to any one of claims 6 to 9, wherein: Each sample included in the plurality of first sample data includes a question text and a corresponding answer text.
11. An electronic device, comprising: at least one processor; as well as a memory communicatively coupled to the at least one processor; in The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.
12. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to make a computer execute the method according to any one of claims 1-5.
13. A computer program product comprising a computer program, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.