WO2024007787A1 - 模型训练系统、模型训练方法及装置 - Google Patents

模型训练系统、模型训练方法及装置 Download PDF

Info

Publication number
WO2024007787A1
WO2024007787A1 PCT/CN2023/098217 CN2023098217W WO2024007787A1 WO 2024007787 A1 WO2024007787 A1 WO 2024007787A1 CN 2023098217 W CN2023098217 W CN 2023098217W WO 2024007787 A1 WO2024007787 A1 WO 2024007787A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
training
module
format
target
Prior art date
Application number
PCT/CN2023/098217
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
Application filed by 北京火山引擎科技有限公司 filed Critical 北京火山引擎科技有限公司
Publication of WO2024007787A1 publication Critical patent/WO2024007787A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems

Definitions

  • the present disclosure relates to the field of data processing technology, and in particular, to a model training system, model training method and device.
  • training speed is one of the most important evaluation indicators for evaluating the performance of the training framework.
  • the training framework includes a large number of heterogeneous components, such as multiple types of trainers.
  • the storage type and data format of the training data There are also many types.
  • the present disclosure provides a model training system, model training method and device.
  • embodiments of the present disclosure provide a model training system, including:
  • the source data processing module is used to convert the data set corresponding to the input business requirements into a preset general format, and use the data set conforming to the preset general format as initial training data and transfer it to the model training system and the Target training adaptation module corresponding to business needs;
  • the target training adaptation module is used to convert the initial training data into a specified data format supported by the target training module corresponding to the business requirements to obtain target training data that conforms to the specified data format, and convert the target training data Output to the target training module;
  • the target training module is used to perform model training according to the business requirements and the received target training data, so as to train a model that satisfies training end conditions.
  • the preset general format includes: a data packet header, metadata and a data part; the data packet header is used to indicate the attribute information of the data set, and the metadata is used to indicate the initial training data.
  • the data type of the characteristics of the data, the data part is used to store the characteristics of the initial training data;
  • the attribute information includes: one or more of the size of the data set, a data encoding method pre-specified by the target training module, a protocol version number, and a magic number.
  • the target training adaptation module is specifically used to perform data analysis on the initial training data, and obtain the attribute information of the data set, the characteristics of the sample data, and the data type of the characteristics; based on the training module
  • the data encapsulation rules corresponding to the supported specified data format encapsulate the attribute information of the data set, the characteristics of the sample data, and the data type of the characteristics to obtain the target training data.
  • the source data processing module is specifically configured to perform data analysis on the data set, obtain attribute information of the data set, characteristics of sample data, and data types of the characteristics; and, according to the predetermined Set the data encapsulation rules corresponding to the general format, encapsulate the attribute information of the data set, the characteristics of the sample data and the data type of the characteristics to obtain the initial training data, and send the initial training data to the target training adaptation module .
  • the source data processing module sends the initial training data in the preset universal format to the target training adaptation module through any of anonymous pipes, named pipes, sockets, and shared memory. .
  • a source data reading module used to support access to multiple types of data sources, and read the data sets required by the business requirements from designated data sources corresponding to the business requirements. , and output the read data set to the source data processing module for data format conversion.
  • the source data reading module is specifically configured to call the software toolkit corresponding to the specified data source, access the specified data source by running the software toolkit, and read the business requirements. required data set.
  • the present disclosure provides a training method, including:
  • the source data processing module is called to convert the input data set corresponding to the business requirements into a preset universal format, and the data set conforming to the preset universal format is used as the initial training data and passed to the model training system corresponding to the business requirements.
  • training adaptation module ;
  • the training adaptation module to convert the initial training data into a specified data format supported by the training module corresponding to the business requirements in the model training system to obtain target training data that conforms to the specified data format, and convert the The target training data is output to the training module;
  • the training module is called to perform model training according to the business requirements and the received target training data, so as to train a model that satisfies the training end condition.
  • the preset general format includes: a data packet header, metadata and a data part; the data packet header is used to indicate the attribute information of the data set, and the metadata is used to indicate the characteristics of the initial training data.
  • the data type is used to store the characteristics of the initial training data;
  • the attribute information includes: one or more of the size of the data set, a data encoding method pre-specified by the training module, a protocol version number, and a magic number.
  • the present disclosure provides an electronic device, including: a memory and a processor;
  • the memory is configured to store computer program instructions
  • the processor is configured to execute the computer program instructions, so that the electronic device implements the second aspect and the model training method described in any one of the second aspects.
  • the present disclosure provides a readable storage medium, including: computer program instructions; an electronic device executes the computer program instructions, so that the electronic device implements the second aspect and any one of the second aspects. Model training methods.
  • the present disclosure provides a computer program that includes instructions that, when executed by a processor, implement the second aspect and the model training method described in any one of the second aspects.
  • Figure 3 is a schematic diagram of the data structure of a preset universal format provided by some embodiments of the present disclosure
  • Figure 5 is a flow chart of a model training method provided by some embodiments of the present disclosure.
  • Figure 6 is a schematic structural diagram of an electronic device provided by some embodiments of the present disclosure.
  • the present disclosure provides a model training system, model training method and device, wherein the system includes: a source data processing module and one or more training frameworks, the training framework includes a training adaptation module and a training module; Among them, the source data processing module is used to perform data format conversion on the data set corresponding to the input business requirements to obtain initial training data in a preset universal format, and output it to the target training framework corresponding to the business requirements; included in the target training framework
  • the target training adaptation module converts the initial training data in the preset universal format to obtain target training data that conforms to the specified data format supported by the target training module, and outputs the target training data to the target training module for model training, so that the training is satisfied. Model of the end condition.
  • FIG. 1 is a schematic diagram of the overall architecture of the model training system provided by the present disclosure. Please refer to FIG. 1 .
  • the model training system 100 provided in this embodiment includes: a source data processing module 101 and a variety of training frameworks 102 .
  • Each training framework 102 includes a training adaptation module 102a and a training module 102b.
  • the source data processing module 101 can send data in a preset universal format to the training framework 102 through an anonymous pipe, a named pipe, a socket method, or a shared memory method.
  • Named pipes are also a simple inter-process communication mechanism.
  • the model training system creates a named pipe, it specifies a name for the pipe.
  • Any process (including the process called by the source data processing module for data format conversion and the process called by the training framework for The process that performs data format conversion) can open the other end of the pipe through this name, which allows the process to be called in different ways, making it more flexible.
  • Shared memory is a large-capacity memory that can be accessed by different central processors in a multi-processor computing system.
  • Shared memory is a communication method between multiple processes. This method is usually used for communication between multiple processes of a program. In fact, multiple programs can also transfer information through shared memory.
  • business requirements reach the model training system, the creation of a shared memory area can be triggered.
  • the process called by the source data processing module for data format conversion writes the initial training data in the preset universal format into the shared memory area.
  • the training framework calls The process used for data format conversion reads the required initial training data in a preset common format from the shared memory area.
  • Shared memory is currently the most efficient communication mechanism.
  • corresponding data transmission methods can be configured in advance based on different types of business requirements.
  • the model training system receives the business requirements, the initial training data is transmitted to the training framework in a pre-configured manner. And when configuring, you can consider the throughput requirements of different types of business needs.
  • the source data processing module 101 may include multiple data format conversion modules, each data format conversion module is used to support converting a preset data format into a preset universal format, and the multiple data format conversion modules The corresponding preset data formats are different.
  • the present disclosure does not limit the specific data structure of the preset universal format, and reference may be made to the detailed description of the embodiment shown in Figure 3 below.
  • the source data processing module 101 supports the conversion of five data formats: csv, parquet, text, json, and tfrecord into preset universal formats.
  • the source data processing module 101 can include five data format conversion modules, one for data format conversion. Modules 1 to 5, among which the data format conversion module 1 is used to convert the csv format into a preset universal format, the data format conversion module 2 is used to convert the parquet format into a preset universal format, and the data format conversion module 3 is used to convert text The format is converted into a preset universal format.
  • the data format conversion module 4 is used to convert the json format into a preset universal format.
  • the data format conversion module 5 is used to convert the tfrecord format into a preset universal format.
  • the data format conversion module performs data analysis on the data set in the corresponding data format to obtain the attribute information of the data set, the characteristics of each sample data included in the data set, and the data type of the characteristics. After that, Based on the data encapsulation rules of the preset general format, the attribute information of the data set, the characteristics of each sample data included in the data set, and the data type of the characteristics are encapsulated to obtain initial training data in the preset general format.
  • the attribute information of the data set may include but is not limited to: the size of the data set, the data encoding method specified by the corresponding target training module, magic number, protocol version number, etc.
  • the protocol version number mentioned here is the protocol version number of the data transmission protocol used for data transmission between the source data processing module and the training framework.
  • a batch of data can be read out by directly calling the API.
  • the read data conforms to the preset universal format.
  • the Text format is similar to the CSV format. You can first read the data one by one according to the newline character, then split the data according to the delimiter to obtain multi-column data, and then fill the divided multi-column data into the preset universal format. , thereby completing the data format conversion.
  • the user needs to first define the data description document (schema), then read the json data one by one, and use jsonparser to parse the data according to the user-defined schema, and then fill it into the preset universal format to complete the data format conversion.
  • multi-threads can be used to concurrently write the required data to the source data processing module 101.
  • Format converted data set when writing, it can be implemented through thread locking to avoid the phenomenon of data writing chaos caused by multi-threaded writing; of course, it can also be implemented using a lock-free queue, and each thread will start from the specified data source.
  • the data set read in is written into the data queue.
  • the source data processing module 101 reads the data set from the data queue and calls the data format conversion module that matches the data format used by the data set to perform data format conversion processing. It is understood that the model training system can also solve the problem of chaotic data writing through other methods, and this disclosure does not limit this.
  • the data format conversion module corresponding to the new data format can be deployed in the source data processing module 101 to complete the conversion of the new data format into the preset universal format without any need to modify any back-end
  • the training adaptation module 102a and the training module 102b in the training framework 102 are modified.
  • the training adaptation module 102 is mainly responsible for converting the initial training data from a preset universal format into a specified data format supported by the training module 102b, and inputting it into the connected training module 102b for model training.
  • the training adaptation module 102a reads a preset universal format from an anonymous pipe, a named pipe, a socket or a shared memory based on the interaction method (which can also be understood as a communication mechanism) defined by the source data processing module 101.
  • Initial training data and then perform data analysis on the initial training data in a preset universal format to obtain the attribute information of the data set, the characteristics of the sample data, and the data type of the characteristics; based on the support of the training module 102b connected to the training adaptation module 102a Specify the data encapsulation rules corresponding to the data format, encapsulate the attribute information of the data set, the characteristics of the sample data, and the data type of the characteristics to obtain the target training data in the specified data format supported by the training module 102b. After that, the target training data can be input Go to the training module 102b for model training.
  • the model training system includes two training frameworks: tensorflow and pytorch. Then tensorflow includes training adaptation module 1 corresponding to tensorflow, and pytorch includes training adaptation module 2 corresponding to pytorch.
  • Any type of training framework can be deployed in the model training system 100, and a training adaptation module capable of converting a preset universal format into a specified data format supported by the corresponding training module in the training framework is deployed.
  • a system that can convert the preset general format into a specified data format supported by the corresponding training module in the training framework is developed and deployed in the training framework.
  • the training adaptation module can realize the adaptation between the data in the preset general format and the training module included in the new training framework, meeting the user's demand for flexible expansion of the training framework, and without the need for the front-end source data processing module 101. Any modifications.
  • Figure 2 is a schematic diagram of the overall architecture of a model training system provided by other embodiments of the present disclosure. Please refer to Figure 2.
  • the model training system provided in this embodiment based on the embodiment shown in Figure 1, also includes: a source data reading module 103.
  • the source data reading module 103 is provided at the front end of the source data processing module 101 to support multiple types of Access to data sources, read the data sets required by business requirements from the data sources and input them to the source data processing module for data format conversion. Based on the introduction of the embodiment shown in Figure 1, the scheduling module in the model training system can issue a data reading task to the source data reading module 103 based on business requirements. After the source data reading module 103 receives the data reading task, Read the required data set from the specified data source corresponding to the business requirements.
  • a library can be configured in the model training system to store software development kits (SDK) provided by different types of data sources respectively.
  • SDK software development kits
  • the source data reading module 103 can be based on business needs.
  • the SDK of the designated data source corresponding to the business requirements stored in the library is called, and the source data reading module 103 accesses the designated data source and reads the data in the designated data source by running the SDK.
  • data can be stored in one or more data formats in the data source. Therefore, the data reading module can be connected to multiple back-end data format conversion modules.
  • the SDK corresponding to the new types of data sources can be deployed in the library of the model training system to realize source data reading.
  • Module 103 successfully reads data without any modification to the back-end source data processing module 101 and training framework 102, which facilitates users to flexibly expand and access data sources.
  • model training system provided by the present disclosure can realize multi-threaded data reading, which can not only improve the training speed, but also break the limitations of single-thread training in the existing training framework.
  • FIG. 3 is a schematic diagram of the data structure of a preset universal format provided by some embodiments of the present disclosure. Please refer to Figure 3.
  • the default common formats include: Data packet header (header), metadata (metadata) and data (data) parts.
  • the header describes the attribute information of the data set.
  • the attribute information can include the size of the data set, the data encoding method specified by the target training module corresponding to the business requirements, the protocol version number, and one or more of the magic number. item. Among them, magic number can solve the problem that the entire data cannot be parsed due to incorrect placement of data bits. It is understandable that as the model training method is continuously optimized, the attribute information of the data set stored in the header can be adjusted. For example, new attribute information can be added or some attribute information can be reduced.
  • Metadata is a data type mainly used to describe the characteristics of each sample data included in the data set.
  • the data types of the characteristics mentioned here may include but are not limited to: integer, floating point, short integer, etc.
  • the data part is used to store the characteristics of the sample data, where each sample data is composed of multiple characteristics described by the aforementioned metadata.
  • the data structure of the preset universal format is not limited to the example in the embodiment shown in FIG. 3 , and can also be implemented for other data structures. This disclosure does not limit the specific data structure used in the preset universal format.
  • Figure 4 is a flow chart of a model training method provided by some embodiments of the present disclosure. This method can be implemented through the model training system of the embodiment shown in Figure 1 or Figure 2. Please refer to Figure 4. The method provided by this embodiment includes:
  • S401 Call the source data processing module to convert the data set corresponding to the input business requirement into a preset universal format, use the data set conforming to the preset universal format as initial training data and pass it to the model training system corresponding to the business requirement.
  • Target training adaptation module Call the source data processing module to convert the data set corresponding to the input business requirement into a preset universal format, use the data set conforming to the preset universal format as initial training data and pass it to the model training system corresponding to the business requirement.
  • Business requirements are used to refer to the model training requirements corresponding to the business.
  • Business requirements can be, but are not limited to, generated based on operating instructions input by users.
  • the service can be any service, and the present disclosure does not limit the service type.
  • it can be an image recognition service, a speech recognition service, a text processing service, and so on.
  • the data sets required by different businesses are different.
  • the data set required by the image recognition business includes sample image data
  • the data set required by the speech recognition business includes audio sample data
  • the data set required by the text processing business is text sample data.
  • the data set can be obtained by the source data reading module in the model training system calling the SDK corresponding to the specified data source corresponding to the business requirements, and then reading from the specified data source.
  • business needs are
  • the corresponding specified data source can be one or more.
  • the source data processing module can be called to perform data analysis on the sample data included in the data set to obtain the attribute information of the data set, the characteristics of the sample data, and the characteristic data type.
  • the data encapsulation rules in a general format to write the attribute information of the data set into the data packet header, write the characteristics of the sample data into the data part, and write the data type of the characteristics into the metadata part, and then re-encapsulate the initial training data.
  • the source data processing module can send initial training data to the target training adaptation module in the target training framework corresponding to the business requirements through any method such as anonymous pipes, named pipes, sockets, or shared memory.
  • the specific method used to send the initial training data to the target training adaptation module can be determined by, but is not limited to, the occupancy of the hardware resources of the user-based model training system, the data processing capabilities of the hardware resources, etc., or it can also be determined by the model training system. Determine for yourself.
  • S402. Call the target training adaptation module to convert the initial training data into the specified data format supported by the target training module corresponding to the business requirements in the model training system to obtain target training data that conforms to the specified data format, and output the target training data to the target training module.
  • the method provided in this embodiment implements training acceleration by using a model training system that decouples data reading and training frameworks for model training.
  • the source data processing module supports the access of multiple different types of data sources.
  • the required data sets read from the specified data sources are converted into data formats based on business requirements to obtain a preset universal format.
  • the initial training data is output to the target training framework corresponding to the business requirements; the target training adaptation module included in the target training framework converts the initial training data in the preset universal format to obtain the specified data format that conforms to the target training module.
  • Target training data and output the target training data to the target training module for model training, so as to train a model that meets the training end conditions.
  • the source data reading module of the model training system can read the data required by business requirements by calling the SDK corresponding to the three data sources.
  • the data of storage type A is read in data format x
  • the data of storage type B is read out.
  • the data of storage type C is read out as data format z.
  • the data sets of data format x, data format y, and data format z are converted into a preset universal format through the source data processing module in the model training system.
  • the source data processing module stores the initial training data required by training framework 2 into the designated pipeline/socket/specified shared memory corresponding to training framework 2, and the training adaptation module in training framework 2 obtains the data from the corresponding pipeline/socket. / Specify the initial training data required to be read out from the shared memory to re-parse and encapsulate it before inputting it into the training module included in the back-end training framework 2 for model training.
  • the existing model training system is used, 6 types of codes need to be deployed in the entire model training system for data reading.
  • data reading can be achieved through 5 types of codes.
  • the model training system provided by the present disclosure will have a greater training speed improvement effect than the existing model training system. obvious.
  • the source data processing module and training framework are deployed in a hierarchical manner, which is conducive to the integration of The maintenance and flexible expansion of a model training system can meet users' increasing model training needs.
  • Figure 6 is a schematic structural diagram of an electronic device provided by some embodiments of the present disclosure.
  • the electronic device 600 provided in this embodiment includes: a memory 601 and a processor 602 .
  • the memory 601 may be an independent physical unit, and may be connected to the processor 602 through a bus 603 .
  • the memory 601 and the processor 602 can also be integrated together and implemented through hardware.
  • the memory 601 is used to store program instructions, and the processor 602 calls the program instructions to execute the model training method provided by any of the above method embodiments.
  • the above electronic device 600 may also include only the processor 602.
  • the memory 601 for storing programs is located outside the electronic device 600, and the processor 602 is connected to the memory through circuits/wires for reading and executing the programs stored in the memory.
  • the processor 602 may be a central processing unit (CPU), a network processor (NP), or a combination of CPU and NP.
  • CPU central processing unit
  • NP network processor
  • the memory 601 may include volatile memory (volatile memory), such as random-access memory (RAM); the memory may also include non-volatile memory (non-volatile memory), such as flash memory (flash memory). ), hard disk drive (hard disk drive, HDD) or solid-state drive (solid-state drive, SSD); the memory can also include a combination of the above types of memory.
  • volatile memory volatile memory
  • non-volatile memory non-volatile memory
  • flash memory flash memory
  • HDD hard disk drive
  • solid-state drive solid-state drive
  • SSD solid-state drive
  • the present disclosure also provides a readable storage medium, including: computer program instructions.
  • the computer program instructions When the computer program instructions are executed by at least one processor of an electronic device, the electronic device implements the model training method provided by any of the above method embodiments. .
  • the present disclosure also provides a computer program product.
  • the computer program product When the computer program product is run on a computer
  • the computer When, the computer is caused to implement the model training method provided by any of the above method embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Communication Control (AREA)
  • Feedback Control In General (AREA)

Abstract

一种模型训练系统(100)、模型训练方法及装置,其中,该模型训练系统(100)包括:源数据处理模块(101)以及一种或多种训练框架(102),训练框架包括训练适配模块(102a)和训练模块(102b);其中,由源数据处理模块(101)对输入的业务需求对应的数据集进行数据格式转换得到预设通用格式的初始训练数据,并输出至业务需求所对应的目标训练框架(102);由目标训练框架(102)包括的目标训练适配模块(102a)对初始训练数据进行转换得到符合目标训练模块(102b)支持的指定数据格式的目标训练数据,并将目标训练数据输出至目标训练模块(102b)进行模型训练,以训练得到满足训练结束条件的模型。

Description

模型训练系统、模型训练方法及装置
相关申请的交叉引用
本申请要求于2022年7月5日递交、申请号为202210792462.6、名称为“模型训练系统、模型训练方法及装置”的中国专利申请的优先权,其全部内容通过引用并入本文。
技术领域
本公开涉及数据处理技术领域,尤其涉及一种模型训练系统、模型训练方法及装置。
背景技术
在模型训练场景中,训练速度是用于评价训练框架性能极其重要的评价指标之一,训练框架包括大量的异构组件,如多种类型的训练器,此外,训练数据的存储类型以及数据格式种类也较多。
发明内容
本公开提供了一种模型训练系统、模型训练方法及装置。
第一方面,本公开实施例提供了一种模型训练系统,包括:
源数据处理模块,用于将输入的业务需求对应的数据集转换成预设通用格式,将符合所述预设通用格式的数据集作为初始训练数据并传递给所述模型训练系统中与所述业务需求对应的目标训练适配模块;
所述目标训练适配模块,用于将所述初始训练数据转换成所述业务需求对应的目标训练模块支持的指定数据格式得到符合所述指定数据格式的目标训练数据,将所述目标训练数据输出至所述目标训练模块;
所述目标训练模块,用于根据所述业务需求和接收到的所述目标训练数据进行模型训练,以训练得到满足训练结束条件的模型。
在一些实施例中,所述预设通用格式包括:数据包头、元数据以及数据部分;数据包头用于指示所述数据集的属性信息,所述元数据用于指示所述初始训练数 据的特征的数据类型,所述数据部分用于存储所述初始训练数据的特征;
其中,所述属性信息包括:所述数据集的大小、所述目标训练模块预先指定的数据编码方式、协议版本号以及魔数中的一项或多项。
在一些实施例中,所述目标训练适配模块具体用于对所述初始训练数据进行数据解析,获取所述数据集的属性信息、样本数据的特征以及特征的数据类型;基于所述训练模块支持的指定数据格式对应的数据封装规则,将所述数据集的属性信息、样本数据的特征以及特征的数据类型封装得到所述目标训练数据。
在一些实施例中,所述源数据处理模块,具体用于对所述数据集进行数据解析,获取所述数据集的属性信息、样本数据的特征以及特征的数据类型;以及,按照所述预设通用格式对应的数据封装规则,将所述数据集的属性信息、样本数据的特征以及特征的数据类型封装得到所述初始训练数据,并向所述目标训练适配模块发送所述初始训练数据。
在一些实施例中,所述源数据处理模块通过匿名管道、命名管道、套接字方式以及共享内存方式中任一方式向所述目标训练适配模块发送所述预设通用格式的初始训练数据。
在一些实施例中,还包括:源数据读取模块,用于支持多种类型的数据源的接入,从所述业务需求对应的指定数据源中读取所述业务需求所需的数据集,并将读取的数据集输出至所述源数据处理模块进行数据格式转换。
在一些实施例中,所述源数据读取模块,具体用于调用所述指定数据源对应的软件工具包,通过运行所述软件工具包访问所述指定数据源,读取所述业务需求所需的数据集。
第二方面,本公开提供了一种训练方法,包括:
调用源数据处理模块将输入的业务需求对应数据集转换成预设通用格式,将符合所述预设通用格式的数据集作为初始训练数据并传递给模型训练系统中的与所述业务需求相对应的训练适配模块;
调用所述训练适配模块将所述初始训练数据转换成所述模型训练系统中的与所述业务需求对应的训练模块支持的指定数据格式得到符合所述指定数据格式的目标训练数据,将所述目标训练数据输出至所述训练模块;
调用所述训练模块根据所述业务需求和接收到的所述目标训练数据进行模型训练,以训练得到满足训练结束条件的模型。
在一些实施例中,所述预设通用格式包括:数据包头、元数据以及数据部分;数据包头用于指示所述数据集的属性信息,所述元数据用于指示所述初始训练数据的特征的数据类型,所述数据部分用于存储所述初始训练数据的特征;
其中,所述属性信息包括:所述数据集的大小、所述训练模块预先指定的数据编码方式、协议版本号以及魔数中的一项或多项。
第三方面,本公开提供了一种电子设备,包括:存储器和处理器;
所述存储器被配置为存储计算机程序指令;
所述处理器被配置为执行所述计算机程序指令,使得所述电子设备实现如第二方面以及第二方面任一项所述的模型训练方法。
第四方面,本公开提供了一种可读存储介质,包括:计算机程序指令;电子设备执行所述计算机程序指令,使得所述电子设备实现如第二方面以及第二方面任一项所述的模型训练方法。
第五方面,本公开提供了一种计算机程序产品,包括:电子设备的至少一个处理器执行所述计算机程序产品,使得所述电子设备实现如第二方面以及第二方面任一项所述的模型训练方法。
第六方面,本公开提供了一种计算机程序,该计算机程序包括指令,该指令被处理器执行时实现如第二方面以及第二方面任一项所述的模型训练方法。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。
为了更清楚地说明本公开实施例或相关技术中的技术方案,下面将对实施例或相关技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本公开一些实施例提供的模型训练系统的整体架构示意图;
图2为本公开另一些实施例提供的模型训练系统的整体架构示意图;
图3为本公开一些实施例提供的预设通用格式的数据结构示意图;
图4为本公开一些实施例提供的模型训练方法的流程图;
图5为本公开一些实施例提供的模型训练方法的流程图;
图6为本公开一些实施例提供的电子设备的结构示意图。
具体实施方式
为了能够更清楚地理解本公开的上述目的、特征和优点,下面将对本公开的方案进行进一步描述。需要说明的是,在不冲突的情况下,本公开的实施例及实施例中的特征可以相互组合。
在下面的描述中阐述了很多具体细节以便于充分理解本公开,但本公开还可以采用其他不同于在此描述的方式来实施;显然,说明书中的实施例只是本公开的一部分实施例,而不是全部的实施例。
目前的训练框架针对不同数据格式的数据读取有各自的实现方式,且训练框架就中存在大量的异构组件需要适配,例如,tensorflow、pytorch等等,此外,数据存储类型和数据格式种类也较多,例如,数据存储类型有对象存储、流式存储等等多种类型,数据格式有csv、parquet、text等。而目前的训练框架的重心在于训练的算法,对于框架的通用性关注度较低,这导致用户需要针对每种存储类型、每种数据格式在每种训练框架上单独实现一套代码,这导致整个训练框架执行训练时数据的读取复杂度较高,数据读取耗时严重,也严重影响训练速度。
基于此,本公开提供一种模型训练系统、模型训练方法及装置,其中,该系统包括:源数据处理模块以及一种或多种训练框架,所述训练框架包括训练适配模块和训练模块;其中,源数据处理模块用于对输入的业务需求对应的数据集进行数据格式转换得到预设通用格式的初始训练数据,并输出至业务需求所对应的目标训练框架中;由目标训练框架包括的目标训练适配模块对预设通用格式的初始训练数据进行转换得到符合目标训练模块支持的指定数据格式的目标训练数据,并将目标训练数据输出至目标训练模块进行模型训练,以训练得到满足训练结束条件的模型。
该系统通过将数据的读取与训练框架解耦,使训练框架更加专注训练本身,无需关注所需的训练数据在前端的数据格式,由模型训练系统中的源数据处理模块完成多种不同的数据格式到预设通用格式的转换,由训练框架中的训练适配模块完成预设通用格式到与训练框架中的训练模块所匹配的指定数据格式的转换,提高了训练速度,极大降低了训练框架中用于实现数据读取代码的复杂度。
举例说明复杂度的变化,假设有M个数据格式、N个训练框架,目前已有的模型训练系统实现数据读取的复杂度为M*N,而本公开提供的模型训练系统实现数据读取的复杂度为M+N,对比而言,本公开提供的模型训练系统的复杂度较低,对于训练速度的提升也极其明显。
接下来将通过几个具体实施例结合实际场景以及附图,对本公开提供的模型训练系统以及模型训练方法进行举例介绍。
图1为本公开提供的模型训练系统的整体架构示意图。请参阅图1所示,本实施例提供的模型训练系统100包括:源数据处理模块101以及多种训练框架102。其中,每种训练框架102包括训练适配模块102a以及训练模块102b。
其中,模型训练系统100中可以部署调度模块(也可以理解为任务调度模块,图1中未示出),用于基于接收到业务需求进行任务的调度,示例性地,调度模块可以基于业务需求向执行数据读取的模块、源数据处理模块101及模型训练系统包括的多个训练框架中与业务需求匹配的目标训练框架102分别下发相应的任务。接收到任务的各个模块执行相应的操作。
其中,当业务需求对应的数据集从业务需求对应的指定数据源中读出并输入至源数据处理模块101,源数据处理模块101主要负责将输入的不同数据格式的数据集转换为预设通用格式后发送给下游的训练框架102。其中,不同数据格式可以包括但不限于csv、parquet、text、json、tfrecord等等。其中,csv(Comma-Separated Values)表示逗号分隔值文件格式,parquet是一种列存储格式,text表示文本格式,json(JavaScript Object Notation,JS对象简谱)是一种轻量级的数据交换格式,tfrecord是tensorflow使用的一种二进制数据格式。
在一些实施例中,源数据处理模块101可以通过匿名管道、命名管道、套接字(socket)方式或者共享内存方式向训练框架102发送预设通用格式的数据。
其中,匿名管道可以用于进程之间的通信,且仅限于本地父子进程之间的通信,可以通过文件的方式实现,即模型训练系统可以创建一个文件,源数据处理模块调用的用于进行数据格式转换的进程以及训练框架调用的用于进行数据格式转换的进程均可以访问该文件,其中源数据处理模块调用的用于进行数据格式转换的进程可以向文件中写入输入,训练框架调用的用于进行数据格式转换的进程可以从文件中读取数据,不需要提供额外的端口、文件等权限,匿名管道的结构简单且占用小。
命名管道也是一种简单的进程间通信机制,模型训练系统创建命名管道时为管道指定一个名字,任何进程(包括源数据处理模块调用的用于进行数据格式转换的进程以及训练框架调用的用于进行数据格式转换的进程)可以通过该名字打开管道的另一端,可以实现进程以不同的方式调用,更加灵活。
套接字(socket)是对于不同应用进程之间进行双向通信的端口的抽象,一个套接字就是网络上进程通信的一端,提供了应用层进程利用网络协议交换数据的机制。源数据处理模块可以将预设通用格式的初始训练数据写入它对应的socket中,该socket通过传输介质将这些数据传输至目标训练框架对应的socket中,使得目标训练框架能够接收到这段信息。
共享内存(shared memory)在多处理器的计算系统中,可以被不同中央处理器访问的大容量内存。共享内存是一种多进程之间的通信方法,这种方法通常用于一个程序的多进程间通信,实际上多个程序间也可以通过共享内存来传递信息。当业务需求到达模型训练系统,可以触发创建一个共享内存区,源数据处理模块调用的用于进行数据格式转换的进程将预设通用格式的初始训练数据写入共享内存区中,训练框架调用的用于进行数据格式转换的进程从共享内存区中读取所需的预设通用格式的初始训练数据。共享内存方式是目前效率最高的通信机制。
在一些实施例中,可以主要通过匿名管道的方式传输数据,这种方式实现简单,不要额外的端口,文件等权限,但是如果遇到了管道缓存上限的话,会导致数据读写速度慢,这时切换至套接字方式,这种方式需要支持端口相关的调度,防止冲突,且设备上不能运行太多服务,否则会绑定失败。共享内存方式,也是需要本地的一些权限,并且开发复杂,因此可以设置一些指定的任务采用共享内 存方式。
或者,在一些实施例中,可以预先基于不同类型的业务需求配置相应的是数据传输方式,当模型训练系统接收到业务需求时,采用预先配置的方式向训练框架传输初始训练数据。且在配置时,可以考虑不同类型的业务需求对于吞吐量的需求。
需要说明的是,用户可根据其他策略选择合适的方式进行初始训练数据的传输。
在一些实施例中,源数据处理模块101可以包括多个数据格式转换模块,每个数据格式转换模块用于支持将预先设定的数据格式转换为预设通用格式,且多个数据格式转换模块分别对应的预先设定的数据格式不同。其中,本公开对于预设通用格式的具体数据结构不做限定,可参照后文中图3所示实施例的详细描述。
例如,源数据处理模块101支持csv、parquet、text、json以及tfrecord这5种数据格式到预设通用格式的转换,则源数据处理模块101可以包括5个数据格式转换模块,分别为数据格式转换模块1至5,其中,数据格式转换模块1用于将csv格式转换为预设通用格式,数据格式转换模块2用于将parquet格式转换为预设通用格式,数据格式转换模块3用于将text格式转换为预设通用格式,数据格式转换模块4用于将json格式转换为预设通用格式,数据格式转换模块5用于将tfrecord格式转换为预设通用格式。
在数据格式转换的过程中,数据格式转换模块通过对对应的数据格式的数据集进行数据解析,获取数据集的属性信息、数据集包括的各样本数据的特征以及特征的数据类型,之后,再基于预设通用格式的数据封装规则,将数据集的属性信息、数据集包括的各样本数据的特征以及特征的数据类型封装得到预设通用格式的初始训练数据。
其中,数据集的属性信息可以包括但不限于:数据集的大小、相应的目标训练模块指定的数据编码方式、幻数、协议版本号等等。此处提及的协议版本号为源数据处理模块与训练框架之间进行数据传输所使用的数据传输协议的协议版本号。
示例性地,以csv、parquet、text、json以及tfrecord这几种数据格式为例,举 例说明源数据处理模块实现数据格式转换的方式。
1、csv格式转换为预设通用格式
可以先根据换行符,读出一条一条的数据,然后再根据分割符,将数据切分得到多列数据,再将切分得到的多列数据填充至预设通用格式中,从而完成数据格式转换。
2、parquet格式转换为预设通用格式
通过parquet提供的API实现的接口转换逻辑以后,直接调用API就能读出一个批(batch)的数据,读出的数据符合预设通用格式。
3、text格式转换为预设通用格式
Text格式与csv格式类似,可以先根据换行符,读出一条一条的数据,然后再根据分割符,将数据切分得到多列数据,再将切分得到的多列数据填充至预设通用格式中,从而完成数据格式转换。
4、json格式转换为预设通用格式
其中,用户需要先定义数据描述文档(schema),接下来逐条读取json数据,并使用jsonparser根据用户定义的schema将数据解析,再填充至预设通用格式中,从而完成数据格式转换。
5、tfrecord格式转换为预设通用格式
可以通过调用tfrecord提供的API,对数据进行解析,读出每行每列的数据,再将读出的数据填充至预设通用格式中,从而完成数据格式转换。
在一些实施例中,基于业务需求可能需要从多个指定数据源中读取数据,为了提高源数据处理模块101的处理效率,可以通过多线程并发向源数据处理模块101中写入需要进行数据格式转换的数据集。其中,在写入时,可以通过线程加锁的方式实现,以避免多线程写入导致数据写入混乱的现象出现;当然,也可以使用无锁队列的方式实现,各线程将从指定数据源中读取的数据集写入数据队列中,源数据处理模块101从数据队列中读取数据集,并调用与数据集所采用的数据格式相匹配的数据格式转换模块进行数据格式转换处理,可以理解的是,模型训练系统还可以通过其他方式解决数据写入混乱的问题,本公开对此不做限定。
采用本公开提供的模型训练系统,当有新的数据格式的数据集需要作为训练 数据进行模型训练时,可以通过在源数据处理模块101中部署新增的数据格式对应的数据格式转换模块,以完成新增的数据格式到预设通用格式的转换,且无需对后端的任一训练框架102中的训练适配模块102a以及训练模块102b进行修改。
训练适配模块102,主要负责将初始训练数据由预设通用格式转换为训练模块102b支持的指定数据格式,并输入至相连接的训练模块102b进行模型训练。
在一些实施例中,训练适配模块102a具体基于源数据处理模块101定义的交互方式(也可以理解为通信机制),从匿名管道、命名管道、socket或者共享内存中读取预设通用格式的初始训练数据,再对预设通用格式的初始训练数据进行数据解析,获取数据集的属性信息、样本数据的特征以及特征的数据类型;基于与训练适配模块102a相连接的训练模块102b支持的指定数据格式对应的数据封装规则,将数据集的属性信息、样本数据的特征以及特征的数据类型封装得到训练模块102b所支持的指定数据格式的目标训练数据,之后,便可以将目标训练数据输入至训练模块102b中进行模型训练。
例如,模型训练系统包括:tensorflow和pytorch两种训练框架,则tensorflow中包括tensorflow对应的训练适配模块1,pytorch中包括pytorch对应的训练适配模块2。
模型训练系统100中可以部署任意类型的训练框架,在训练框架中部署能够将预设通用格式到训练框架中相应训练模块所支持的指定数据格式转换的训练适配模块。
基于上述介绍,可知,当有新增的训练框架102需要部署至模型训练系统时,在训练框架中开发并部署能够将预设通用格式转换为训练框架中相应训练模块所支持的指定数据格式的训练适配模块,便可以实现预设通用格式的数据与新增训练框架包括的训练模块之间的适配,满足用户对于训练框架灵活扩展的需求,且无需对前端的源数据处理模块101进行任何修改。
图2为本公开另一些实施例提供的模型训练系统的整体架构示意图。请参阅图2所示,本实施例提供的模型训练系统在图1所示实施例的基础上,还包括:源数据读取模块103。
源数据读取模块103设置在源数据处理模块101的前端,用于支持多种类型 的数据源的接入,从数据源中读取业务需求所需的数据集并输入至源数据处理模块以进行数据格式转换。结合前述图1所示实施例的介绍,模型训练系统中的调度模块可以基于业务需求向源数据读取模块103下发数据读取任务,源数据读取模块103接收到数据读取任务后,从业务需求对应的指定数据源中读取所需的数据集。
作为一种可能的实施方式,模型训练系统中可以配置一个库,用于存储不同类型的数据源分别提供的软件工具开发包(Software Development Kit,SDK),源数据读取模块103可以基于业务需求调用库中所存储与业务需求所对应的指定数据源的SDK,源数据读取模块103通过运行SDK,从而访问指定数据源,读取指定数据源中的数据。
例如,模型训练系统支持从HDFS、S3、Kafka三种数据源中读取数据,则库中可以存储HDFS、S3、Kafka三种类型的数据源分别提供的SDK,使得源数据读取模块103能够通过调用相应数据源对应的SDK成功读取数据源中的数据。
其中,为了提高数据读取效率,源数据读取模块103中可以包括多个数据读取模块,多个数据读取模块可以并行执行数据读取,且多个数据读取模块可以分别支持调用不同类型的数据源的SDK,并将数据读取模块与后端源数据处理模块101中相应类型的数据格式转换模块对应连接。
需要说明的是,在数据源中数据可以以一种或多种数据格式存储,因此,数据读取模块可以与后端多个数据格式转换模块连接。
在一些实施例中,若模型训练系统需要支持从新增类型的数据源中读取数据,则可以在模型训练系统的库中部署新增类型的数据源对应的SDK即可实现源数据读取模块103成功读取数据,且无需对后端的源数据处理模块101以及训练框架102进行任何修改,方便用户灵活地进行数据源的扩展及接入。
结合图1以及图2所示实施例,采用本公开提供的模型训练系统能够实现多线程的数据读取,不仅能够提升训练速度,还能够打破现有的训练框架中单线程训练的限制。
接下来,举例介绍预设通用格式的数据结构。其中,图3为本公开一些实施例提供的预设通用格式的数据结构示意图。请参阅图3所示,预设通用格式包括: 数据包头(header)、元数据(metadata)以及数据(data)部分。
header描述了数据集的属性信息,其中,属性信息可以包括数据集的大小、业务需求所对应的目标训练模块指定的数据编码方式、协议版本号以及魔数(magic number)中的一项或多项。其中,magic number能够解决由于放置数据位错误导致整个数据无法解析的问题。可以理解的是,随着模型训练方式的不断优化,header中存储的数据集的属性信息可以进行调整,如,可以增加新的属性信息或者减少一些属性信息。
metadata主要用于描述数据集中包括的各样本数据的特征的数据类型。此处提及的特征的数据类型可以包括但不限于:整型、浮点型、短整型等等。
data部分用于存储样本数据的特征,其中,每个样本数据均是由多个前述metadata描述的特征组成的。
需要说明的是,预设通用格式的数据结构并不限于图3所示实施例中的示例,还可以为其他数据结构实现。本公开对于预设通用格式所采用的具体数据结构不做限定。
图4为本公开一些实施例提供的模型训练方法的流程图。该方法可以通过前述图1或者图2所示实施例的模型训练系统实现。请参阅图4所示,本实施例提供的方法包括:
S401、调用源数据处理模块将输入的业务需求对应的数据集转换成预设通用格式,将符合预设通用格式的数据集作为初始训练数据并传递给模型训练系统中的与业务需求相对应的目标训练适配模块。
业务需求用于指业务对应的模型训练需求,业务需求可以但不限于是基于用户输入的操作指令生成的。其中,业务可以为任意业务,本公开不限定业务类型,例如,可以为图像识别业务、语音识别业务、文本处理业务等等。不同业务所需的数据集不同,例如,图像识别业务所需的数据集包括样本图像数据,语音识别业务所需的数据集包括音频样本数据,文本处理业务所需的数据集为文本样本数据。
其中,数据集可以是模型训练系统中的源数据读取模块调用业务需求所对应的指定数据源对应的SDK,进而从指定数据源读取得到的。其中,业务需求所对 应的指定数据源可以为一个或者多个。
若指定数据源的数量为多个,则可以调用源数据读取模块中的多个数据读取子模块用于并发执行从多个指定数据源读取业务需求所需的数据集,以提高数据读取效率。
结合前述模型训练系统的介绍可知,本实施例可以调用源数据处理模块对数据集中包括的样本数据进行数据解析,得到数据集的属性信息、样本数据的特征以及特征数据类型,之后,再按照预设通用格式的数据封装规则将数据集的属性信息写入数据包头、将样本数据的特征写入数据部分,以及将特征的数据类型写入元数据部分,重新封装得到初始训练数据。
此外,源数据处理模块可以通过匿名管道、命名管道、socket或者共享内存中任一种方式向业务需求对应的目标训练框架中的目标训练适配模块发送初始训练数据。具体通过何种方式向目标训练适配模块发送初始训练数据,可以但不限于由用户基于模型训练系统所搭载的硬件资源占用情况、硬件资源的数据处理能力等等决定,也可以由模型训练系统自行确定。
S402、调用目标训练适配模块将初始训练数据转换成模型训练系统中的与业务需求对应的目标训练模块支持的指定数据格式得到符合指定数据格式的目标训练数据,将目标训练数据输出至目标训练模块。
调用目标训练适配模块基于上游的源数据处理模块定义的交互方式,从相应的匿名管道、命名管道、socket或者共享内存中读取通用数据格式的初始训练数据。再对通用数据格式的初始训练数据进行数据解析得到数据集的属性信息、样本数据的特征以及特征的数据类型,之后,再按照目标训练模块支持的指定数据格式对应的数据封装规则对数据集的属性信息、样本数据的特征以及特征的数据类型重新封装得到能够直接输入至目标训练模块的目标训练数据。
S403、调用目标训练模块根据业务需求和接收到的目标训练数据进行模型训练,以训练得到满足训练结束条件的模型。
目标训练模块能够加载待训练模型,并基于业务需求,将目标训练数据输入至待训练模型中进行训练,通过不断迭代训练,直至满足训练结束条件得到训练好的模型。
本实施例提供的方法通过采用数据读取与训练框架解耦的模型训练系统进行模型训练,实现训练加速。其中,源数据处理模块支持多种不同类型的数据源的接入,通过调用源数据处理模块基于业务需求对从指定数据源读取的所需的数据集进行数据格式转换得到预设通用格式的初始训练数据,并输出至业务需求所对应的目标训练框架中;由目标训练框架包括的目标训练适配模块对预设通用格式的初始训练数据进行转换得到符合目标训练模块支持的指定数据格式的目标训练数据,并将目标训练数据输出至目标训练模块进行模型训练,以训练得到满足训练结束条件的模型。
请参阅图5所示,在一个具体的实施例中,假设前端有3个数据源分别采用存储类型A、存储类型B以及存储类型C存储数据,后端有两个训练框架有相应的模型训练业务需求。模型训练系统的源数据读取模块能够通过调用3个数据源分别对应的SDK读取业务需求所需的数据,其中,存储类型A的数据读出为数据格式x,存储类型B的数据读出为数据格式y,存储类型C的数据读出为数据格式z,之后,通过模型训练系统中的源数据处理模块将数据格式x、数据格式y以及数据格式z的数据集转换为预设通用格式得到初始训练数据,并将训练框架1所需的初始训练数据存储至训练框架1对应的指定管道/socket/指定共享内存中,由训练框架1中的训练适配模块从相应的管道/socket/指定共享内存中读出所需的初始训练数据重新解析以及封装之后输入后端的训练框架1包括的训练模块进行模型训练。
类似地,源数据处理模块将训练框架2所需的初始训练数据存储至训练框架2对应的指定管道/socket/指定共享内存中,由训练框架2中的训练适配模块从相应的管道/socket/指定共享内存中读出所需的初始训练数据重新解析以及封装之后输入后端的训练框架2包括的训练模块进行模型训练。
若采用现有的模型训练系统,则需要在整个模型训练系统中部署6种代码进行数据读取,而采用本公开提供的方案通过5种代码便可实现数据读取。随着数据源种类不断增多,数据格式也不断增多,以及,随着训练框架数量的不断增多,本公开提供的模型训练系统相比于现有的模型训练系统而言,训练速度提升效果会更加明显。且采用源数据处理模块与训练框架分层的方式进行部署,有利于整 个模型训练系统的维护以及灵活扩展,能够满足用户日益增多的模型训练需求。
示例性地,本公开还提供一种电子设备。图6为本公开一些实施例提供的电子设备的结构示意图。请参阅图6所示,本实施例提供的电子设备600包括:存储器601和处理器602。
其中,存储器601可以是独立的物理单元,与处理器602可以通过总线603连接。存储器601、处理器602也可以集成在一起,通过硬件实现等。
存储器601用于存储程序指令,处理器602调用该程序指令,执行以上任一方法实施例提供的模型训练方法。
可选地,当上述实施例的方法中的部分或全部通过软件实现时,上述电子设备600也可以只包括处理器602。用于存储程序的存储器601位于电子设备600之外,处理器602通过电路/电线与存储器连接,用于读取并执行存储器中存储的程序。
处理器602可以是中央处理器(central processing unit,CPU),网络处理器(network processor,NP)或者CPU和NP的组合。
处理器602还可以进一步包括硬件芯片。上述硬件芯片可以是专用集成电路(application-specific integrated circuit,ASIC),可编程逻辑器件(programmable logic device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,CPLD),现场可编程逻辑门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。
存储器601可以包括易失性存储器(volatile memory),例如随机存取存储器(random-access memory,RAM);存储器也可以包括非易失性存储器(non-volatile memory),例如快闪存储器(flash memory),硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD);存储器还可以包括上述种类的存储器的组合。
本公开还提供一种可读存储介质,包括:计算机程序指令,所述计算机程序指令被电子设备的至少一个处理器执行时,使得所述电子设备实现如上任一方法实施例提供的模型训练方法。
本公开还提供一种计算机程序产品,当所述计算机程序产品在计算机上运行 时,使得所述计算机实现如上任一方法实施例提供的模型训练方法。
需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上所述仅是本公开的具体实施方式,使本领域技术人员能够理解或实现本公开。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本公开的精神或范围的情况下,在其它实施例中实现。因此,本公开将不会被限制于本文所述的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。

Claims (13)

  1. 一种模型训练系统,包括:
    源数据处理模块,用于将输入的业务需求对应的数据集转换成预设通用格式,将符合所述预设通用格式的数据集作为初始训练数据并传递给所述模型训练系统中与所述业务需求对应的目标训练适配模块;
    所述目标训练适配模块,用于将所述初始训练数据转换成所述业务需求对应的目标训练模块支持的指定数据格式得到符合所述指定数据格式的目标训练数据,将所述目标训练数据输出至与所述目标训练模块;
    所述目标训练模块,用于根据所述业务需求和接收到的所述目标训练数据进行模型训练,以训练得到满足训练结束条件的模型。
  2. 根据权利要求1所述的系统,其中,所述预设通用格式包括:数据包头、元数据以及数据部分;数据包头用于指示所述数据集的属性信息,所述元数据用于指示所述初始训练数据的特征的数据类型,所述数据部分用于存储所述初始训练数据的特征;
    其中,所述属性信息包括:所述数据集的大小、所述目标训练模块预先指定的数据编码方式、协议版本号以及魔数中的一项或多项。
  3. 根据权利要求2所述的系统,其中,所述目标训练适配模块,具体用于对所述初始训练数据进行数据解析,获取所述数据集的属性信息、样本数据的特征以及特征的数据类型;基于所述目标训练模块支持的指定数据格式对应的数据封装规则,将所述数据集的属性信息、样本数据的特征以及特征的数据类型封装得到所述目标训练数据,并向所述目标训练模块发送所述目标训练数据。
  4. 根据权利要求2所述的系统,其中,所述源数据处理模块,具体用于对所述数据集进行数据解析,获取所述数据集的属性信息、样本数据的特征以及特征的数据类型;以及,按照所述预设通用格式对应的数据封装规则,将所述数据集的属性信息、样本数据的特征以及特征的数据类型封装得到所述初始训练数据,并向所述目标训练适配模块发送所述初始训练数据。
  5. 根据权利要求1所述的系统,其中,所述源数据处理模块通过匿名管道、命名管道、套接字方式以及共享内存方式中任一方式向所述目标训练适配模块发送所述预设通用格式的初始训练数据。
  6. 根据权利要求1至5任一项所述的系统,还包括:源数据读取模块,用于支持多种类型的数据源的接入,从所述业务需求对应的指定数据源中读取所述业务需求所需的数据集,并将读取的数据集输出至所述源数据处理模块进行数据格式转换。
  7. 根据权利要求6所述的系统,其中,所述源数据读取模块,具体用于调用所述指定数据源对应的软件工具包,通过运行所述软件工具包访问所述指定数据源,读取所述业务需求所需的数据集。
  8. 一种模型训练方法,包括:
    调用源数据处理模块将输入的业务需求对应的数据集转换成预设通用格式,将符合所述预设通用格式的数据集作为初始训练数据并传递给模型训练系统中的与所述业务需求相对应的目标训练适配模块;
    调用所述目标训练适配模块将所述初始训练数据转换成所述模型训练系统中的与所述业务需求对应的目标训练模块支持的指定数据格式得到符合所述指定数据格式的目标训练数据,将所述目标训练数据输出至所述目标训练模块;
    调用所述目标训练模块根据所述业务需求和接收到的所述目标训练数据进行模型训练,以训练得到满足训练结束条件的模型。
  9. 根据权利要求8所述的方法,其中,所述预设通用格式包括:数据包头、元数据以及数据部分;数据包头用于指示所述数据集的属性信息,所述元数据用于指示所述初始训练数据的特征的数据类型,所述数据部分用于存储所述初始训练数据的特征;
    其中,所述属性信息包括:所述数据集的大小、所述目标训练模块预先指定的数据编码方式、协议版本号以及魔数中的一项或多项。
  10. 一种电子设备,包括:存储器和处理器;
    所述存储器被配置为存储计算机程序指令;
    所述处理器被配置为执行所述计算机程序指令,使得所述电子设备实现如权 利要求8或9所述的模型训练方法。
  11. 一种可读存储介质,包括:计算机程序指令;
    电子设备执行所述计算机程序指令,使得所述电子设备实现如权利要求8或9所述的模型训练方法。
  12. 一种计算机程序产品,其中,电子设备的至少一个处理器执行所述计算机程序产品,使得所述电子设备实现如权利要求8或9所述的模型训练方法。
  13. 一种计算机程序,该计算机程序包括指令,该指令被处理器执行时实现如权利要求8或9所述的模型训练方法。
PCT/CN2023/098217 2022-07-05 2023-06-05 模型训练系统、模型训练方法及装置 WO2024007787A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210792462.6 2022-07-05
CN202210792462.6A CN115099352A (zh) 2022-07-05 2022-07-05 模型训练系统、模型训练方法及装置

Publications (1)

Publication Number Publication Date
WO2024007787A1 true WO2024007787A1 (zh) 2024-01-11

Family

ID=83296920

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/098217 WO2024007787A1 (zh) 2022-07-05 2023-06-05 模型训练系统、模型训练方法及装置

Country Status (2)

Country Link
CN (1) CN115099352A (zh)
WO (1) WO2024007787A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115099352A (zh) * 2022-07-05 2022-09-23 北京火山引擎科技有限公司 模型训练系统、模型训练方法及装置
CN116822657B (zh) * 2023-08-25 2024-01-09 之江实验室 一种模型训练加速的方法、装置、存储介质及电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107516135A (zh) * 2017-07-14 2017-12-26 浙江大学 一种支持多源数据的自动化监督性学习方法
CN112328674A (zh) * 2020-11-17 2021-02-05 深圳力维智联技术有限公司 跨数据格式的模型转化加速方法及装置
US20220020064A1 (en) * 2019-08-29 2022-01-20 Tencent Technology (Shenzhen) Company Limited Feature processing method and apparatus for artificial intelligence recommendation model, electronic device, and storage medium
CN114691765A (zh) * 2020-12-30 2022-07-01 华为技术有限公司 一种人工智能系统中数据处理方法及装置
CN115099352A (zh) * 2022-07-05 2022-09-23 北京火山引擎科技有限公司 模型训练系统、模型训练方法及装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710653A (zh) * 2018-12-29 2019-05-03 北京航天数据股份有限公司 一种测试数据源配置方法及装置
CN111814959A (zh) * 2020-06-30 2020-10-23 北京百度网讯科技有限公司 模型训练数据的处理方法、装置、系统和存储介质
CN112529167B (zh) * 2020-12-25 2024-05-14 东云睿连(武汉)计算技术有限公司 一种神经网络交互式自动训练系统和方法
CN112732949B (zh) * 2021-01-19 2023-10-17 广州虎牙科技有限公司 一种业务数据的标注方法、装置、计算机设备和存储介质
CN113641337A (zh) * 2021-07-13 2021-11-12 广州三七互娱科技有限公司 数据处理方法、装置、计算机设备和存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107516135A (zh) * 2017-07-14 2017-12-26 浙江大学 一种支持多源数据的自动化监督性学习方法
US20220020064A1 (en) * 2019-08-29 2022-01-20 Tencent Technology (Shenzhen) Company Limited Feature processing method and apparatus for artificial intelligence recommendation model, electronic device, and storage medium
CN112328674A (zh) * 2020-11-17 2021-02-05 深圳力维智联技术有限公司 跨数据格式的模型转化加速方法及装置
CN114691765A (zh) * 2020-12-30 2022-07-01 华为技术有限公司 一种人工智能系统中数据处理方法及装置
CN115099352A (zh) * 2022-07-05 2022-09-23 北京火山引擎科技有限公司 模型训练系统、模型训练方法及装置

Also Published As

Publication number Publication date
CN115099352A (zh) 2022-09-23

Similar Documents

Publication Publication Date Title
WO2024007787A1 (zh) 模型训练系统、模型训练方法及装置
US20210406068A1 (en) Method and system for stream computation based on directed acyclic graph (dag) interaction
CN107608750B (zh) 用于型式辨识的装置
TWI502501B (zh) 用以控制自動機之內分支度及/或外分支度之展開量化
US10489062B2 (en) Methods and systems for using state vector data in a state machine engine
US9892144B2 (en) Methods for in-place access of serialized data
US11816493B2 (en) Methods and systems for representing processing resources
TW201347409A (zh) 狀態機晶格中之布林邏輯
US11941447B2 (en) Object-oriented memory client
US9762700B2 (en) Client-side aggregation of nested resource dependencies
CN111562885A (zh) 数据处理方法、装置、计算机设备及存储介质
JP2009527852A (ja) Ediスキーマをモデル化するためのxmlペイロード仕様
US20220261257A1 (en) Systems and devices for accessing a state machine
CN102656860B (zh) 多粒度流处理
US20230132724A1 (en) Broadcast adapters in a network-on-chip
US10185678B1 (en) Universal offloading engine
Peltenburg et al. Tens of gigabytes per second JSON-to-Arrow conversion with FPGA accelerators
US20130304754A1 (en) Self-Parsing XML Documents to Improve XML Processing
US20210182123A1 (en) System and method for constructing filter graph-based media processing pipelines in a browser
WO2024078089A1 (zh) 一种芯片及其数据传输方法
WO2022199331A1 (zh) 用于获取调用栈中栈帧信息的方法、装置、设备和介质
US11657203B2 (en) Multi-phase topology synthesis of a network-on-chip (NoC)
CN108874387A (zh) 一种数据序列化方法及其相关设备
US20240111694A1 (en) Node identification allocation in a multi-tile system with multiple derivatives
US20230409226A1 (en) Method and system for acceleration or offloading utilizing a multiple input data stream

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: 23834561

Country of ref document: EP

Kind code of ref document: A1