Agent system for graphics processor development and graphics processor development method
By using a distributed multi-agent architecture of an intelligent agent system, and decomposing and coordinating GPU development tasks based on relevant documentation, the problems of low efficiency and low code quality in existing GPU development methods are solved, and efficient GPU hardware and software co-design is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI BIREN TECH CO LTD
- Filing Date
- 2025-11-18
- Publication Date
- 2026-04-21
AI Technical Summary
Existing GPU development methods suffer from low efficiency and low code quality. Manual development methods are inefficient, while automated development methods are unable to meet the needs of complex parallel architectures in GPUs and cannot effectively support GPU hardware and software co-design.
An intelligent agent system is adopted, including a first intelligent agent, a second intelligent agent, multiple third intelligent agents, and a fourth intelligent agent. Through a distributed multi-agent architecture, development tasks are decomposed and coordinated based on relevant documents to generate and test functional code, avoiding 'document-implementation' drift and achieving automated development.
It improves GPU development efficiency, ensures consistency of related documentation and components during development, and automates the processing of related documentation, simulators, assemblers, and test programs.
Smart Images

Figure CN121414568B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of graphics processor development technology, and embodiments of this disclosure relate to an intelligent agent system for graphics processor development, a graphics processor development method, an electronic device, and a non-transitory computer-readable storage medium. Background Technology
[0002] In the development of a graphics processing unit (GPU), based on the GPU architecture design, a document describing the architecture information is first generated, and then the relevant GPU code is generated based on the document to realize the development of the GPU.
[0003] Current GPU development methods primarily include manual and automated approaches. However, manual methods suffer from low efficiency, while automated methods generate low-quality code. Therefore, current GPU development methods are insufficient to meet the demands of GPU development. Summary of the Invention
[0004] This invention provides an intelligent agent system for graphics processing unit (GPU) development. The system includes a first intelligent agent, a second intelligent agent, multiple third intelligent agents, and a fourth intelligent agent. The first intelligent agent is configured to receive a development task triggered by a user and drive the second intelligent agent, the multiple third intelligent agents, and the fourth intelligent agent to execute corresponding operations sequentially or in parallel to complete the development task. The second intelligent agent is configured to maintain relevant documents used during GPU development. The multiple third intelligent agents are configured to generate functional code corresponding to the development functions of each third intelligent agent based on the relevant documents. The fourth intelligent agent is configured to perform joint testing on the functional code generated by the multiple third intelligent agents to generate test information for the development task, the test information describing the test results of the joint test. The multiple third intelligent agents include: a simulator intelligent agent for generating functional code for a simulator simulating the hardware behavior of the GPU; an assembler intelligent agent for generating functional code for an assembler that converts assembly files into machine code; and a test program intelligent agent for generating functional code for a test program for GPU development.
[0005] For example, in an intelligent agent system for graphics processor development provided in this application, when the first intelligent agent receives a development task triggered by a user and drives the second intelligent agent, the plurality of third intelligent agents, and the fourth intelligent agent to perform corresponding operations sequentially or in parallel to complete the development task, the system includes the following operations: receiving the development task triggered by the user, wherein the development task is described in natural language; generating a document processing request including document processing information based on the development task, wherein the document processing request is used to instruct the second intelligent agent to process the relevant document based on the document processing information, the document processing information including descriptive information on processing the content of the relevant document in at least one of adding, deleting, querying, and updating; and sending the document processing request to the second intelligent agent to drive the plurality of third intelligent agents and the fourth intelligent agent to perform corresponding operations to complete the development task.
[0006] For example, in an intelligent agent system for graphics processor development provided in this application, when the second intelligent agent performs the maintenance of relevant documents used in the graphics processor development process, it includes performing the following operations: receiving the document processing request sent by the first intelligent agent; processing the relevant documents based on the document processing information, wherein the processing of the relevant documents includes at least one of adding, deleting, querying, and updating; generating a development processing request based on the processing result information of the processed relevant documents, wherein the processing result information includes relevant information in the relevant documents after processing based on the document processing request; and sending the development processing request to the plurality of third intelligent agents respectively.
[0007] For example, in an intelligent agent system for graphics processor development provided in this application, the second intelligent agent includes a first basic sub-intelligent agent and a first instruction sub-intelligent agent; the first basic sub-intelligent agent is configured to maintain the basic content of the relevant documents, wherein the relevant documents include the architecture document of the graphics processor, the architecture document includes an instruction set architecture document, and the basic content includes architecture information describing the software or hardware in the development process of the graphics processor, the architecture information including instruction classification information; the first instruction sub-intelligent agent is configured to maintain the instruction description content of each instruction described in the instruction set architecture document.
[0008] For example, in an intelligent agent system for graphics processor development provided in this application, the first basic sub-intelligent agent is configured to: respond to the document processing information being related to the basic content, process the relevant part of the basic content according to the document processing information, and send a document instruction processing request including first instruction processing information to the first instruction sub-intelligent agent, so that the first instruction sub-intelligent agent processes the instruction description content of the target instruction in the instruction set architecture document based on the first instruction processing information, wherein the first instruction processing information includes the processing method of the target instruction and the processing range of the instruction description content of the target instruction, and the target instruction includes at least one instruction described in the instruction set architecture document based on the document processing information.
[0009] For example, in an intelligent agent system for graphics processor development provided in this application, the first instruction sub-agent is configured to: in response to receiving a document instruction processing request including first instruction processing information sent by the first basic sub-agent, process the instruction description content of a target instruction in the instruction set architecture document according to the first instruction processing information, wherein the first instruction processing information includes the processing method of the target instruction and the processing range of the instruction description content of the target instruction, and the target instruction includes at least one instruction described in the instruction set architecture document based on the document processing information; in response to the document processing information being directly related to the instruction described in the instruction set architecture document, process the instruction description content of the target instruction in the instruction set architecture document according to the document processing information, wherein processing the instruction description content of the target instruction includes at least one of adding, deleting, updating, and querying the instruction description content of the target instruction.
[0010] For example, in an intelligent agent system for graphics processor development provided in this invention application, the first basic sub-intelligent agent is further configured to, in response to the document processing information being related to the basic content, generate a plurality of first development processing requests based on the processed basic content, and send the plurality of first development processing requests to the plurality of third intelligent agents respectively, so that each third intelligent agent generates or updates the corresponding part of the corresponding function code based on the basic content processing information contained in the received first development processing request, wherein the basic content processing information includes relevant descriptive information in the basic content after processing based on the document processing request; the first instruction sub-intelligent agent is further configured to, in response to the... The document processing information is related to the basic content. Based on the instruction description content of the target instruction in the processed instruction set architecture document, multiple second development processing requests are generated and sent to the multiple third agents respectively. This allows each third agent to generate or update the corresponding part of the corresponding function code based on the second instruction processing information contained in the received second development processing request. The second instruction processing information includes the instruction content of the processed instruction description content of the target instruction and the change information of the instruction description content of the target instruction. The target instruction includes at least one instruction described in the instruction set architecture document, determined based on the document processing information.
[0011] For example, in an intelligent agent system for graphics processor development provided in this application, the third intelligent agent includes a second basic sub-intelligent agent and a second instruction sub-intelligent agent; the second basic sub-intelligent agent is configured to: in response to receiving a first development processing request sent by the first basic sub-intelligent agent, generate or update corresponding parts of the functional code corresponding to the basic content in the code corresponding to the third intelligent agent according to the basic content processing information included in the first development processing request; and send an update request including relationship update information to the second instruction sub-intelligent agent, wherein the relationship update information includes code dependencies updated due to the code update of the corresponding parts; the second instruction sub-intelligent agent is configured to: in response to the second development processing request and the update request, generate corresponding parts of the functional code corresponding to the code corresponding to the target instruction according to the relationship update information and the second instruction processing information.
[0012] For example, in an intelligent agent system for graphics processor development provided in this application, the first instruction sub-intelligent agent is further configured to, in response to the document processing information being directly related to the target instruction described in the instruction set architecture document, generate multiple third development processing requests based on the instruction description content of the target instruction in the processed instruction set architecture document, and send the multiple third development processing requests to the multiple third intelligent agents respectively, so that each third intelligent agent generates or updates the corresponding part in the corresponding functional code based on the third instruction processing information contained in the received third development processing request, wherein the third instruction processing information includes relevant description information after processing the instruction description content of the target instruction, and the target instruction includes at least one instruction described in the instruction set architecture document determined based on the document processing information.
[0013] For example, in an intelligent agent system for graphics processor development provided in this application, the third intelligent agent includes a second instruction sub-intelligent agent; the second instruction sub-intelligent agent is configured to, in response to the third development processing request, generate a corresponding part of the code corresponding to the target instruction in the corresponding functional code based on the third instruction processing information.
[0014] For example, in an intelligent agent system for graphics processor development provided in this application, before the second intelligent agent processes the relevant document based on the document processing information, it further includes the following operations: performing document maintenance conflict detection based on the document processing information and the relevant document, wherein the detection result of the document maintenance conflict is that processing the relevant document based on the document processing information fails; in response to detecting the document maintenance conflict, sending a first conflict resolution request including first conflict information to the first intelligent agent, wherein the first conflict information includes relevant conflict information of the document maintenance conflict; the first intelligent agent is further configured to, in response to receiving the first conflict resolution request, determine a first solution based on the first conflict information, update the document processing information based on the first solution, generate a document processing request including the updated document processing information, and send the document processing request to the second intelligent agent, so that the second intelligent agent maintains the relevant document based on the updated document processing information.
[0015] For example, in an intelligent agent system for graphics processor development provided in this application, the first intelligent agent performs the following operations to determine a first solution based on the first conflict information: analyzing the first conflict information to determine whether the document maintenance conflict can be resolved; generating a first solution in response to determining that the document maintenance conflict can be resolved; generating at least one first decision scheme and providing it to the user in response to determining that the document maintenance conflict cannot be resolved; and generating a first solution based on the first decision scheme triggered by the user.
[0016] For example, in an intelligent agent system for graphics processor development provided in this application, when the third intelligent agent generates functional code corresponding to the development function of the third intelligent agent based on the relevant document, the system further includes the following operations: performing code generation conflict detection based on the relevant document and at least one of the basic content processing information, the second instruction processing information, and the third instruction processing information, wherein when the code generation conflict detection result is a code generation conflict, the generation or execution of the functional code based on the relevant document fails; in response to detecting the code generation conflict, sending a second conflict resolution request including second conflict information to the first intelligent agent, the second conflict information including relevant conflict information of the code generation conflict; the first intelligent agent is further configured to, in response to receiving the second conflict resolution request, determine a second solution based on the second conflict information, generate a decision execution request containing relevant information of the second solution based on the second solution, and send it to the third intelligent agent, so that the third intelligent agent generates functional code corresponding to the development function of the third intelligent agent based on the relevant information of the second solution.
[0017] For example, in an intelligent agent system for graphics processor development provided in this application, the first intelligent agent performs the following operations to determine a second solution based on the second conflict information: analyzing the second conflict information to determine whether the code generation conflict can be resolved; generating a second solution in response to determining that the code generation conflict can be resolved; generating at least one second decision scheme and providing it to the user in response to determining that the code generation conflict cannot be resolved; and generating a second solution based on the second decision scheme triggered by the user.
[0018] For example, in an intelligent agent system for graphics processor development provided in this application, when the fourth intelligent agent performs joint testing on the functional code generated by the plurality of third intelligent agents and generates test information for the development task, the following operations are performed: sending multiple run test requests to the plurality of third intelligent agents respectively, so that each third intelligent agent runs the corresponding functional code based on the received run test request; obtaining the run information sent by the plurality of third intelligent agents, and generating test information based on the run information, wherein the run information is used to describe the process and result of running the functional code.
[0019] For example, in an intelligent agent system for graphics processor development provided in this application, the fourth intelligent agent is further configured to: in response to the test information indicating the existence of a runtime problem, analyze the test information to obtain a problem analysis result; optimize the functional code related to the runtime problem according to the problem analysis result, or send the test information to the first intelligent agent, wherein the problem analysis result includes the cause of the runtime problem; the first intelligent agent is further configured to: in response to receiving the test information, generate an optimization scheme according to the test information, and drive the second intelligent agent and the plurality of third intelligent agents to execute corresponding operations sequentially or in parallel to execute the optimization scheme.
[0020] This invention application provides a graphics processing unit (GPU) development method. The method is applied to an intelligent agent system, which includes a first intelligent agent, a second intelligent agent, multiple third intelligent agents, and a fourth intelligent agent. The method includes: receiving a development task triggered by a user; having the first intelligent agent drive the second intelligent agent, the multiple third intelligent agents, and the fourth intelligent agent to sequentially or in parallel execute corresponding operations to complete the development task; having the second intelligent agent maintain relevant documents used during the GPU development process; having the multiple third intelligent agents generate functional code corresponding to the development functions of each third intelligent agent based on the relevant documents; and having the fourth intelligent agent perform joint testing on the functional code generated by the multiple third intelligent agents to generate test information for the development task, the test information describing the test results of the joint test. The multiple third intelligent agents include: a simulator intelligent agent for generating functional code for a simulator simulating the hardware behavior of the GPU; an assembler intelligent agent for generating functional code for an assembler that converts assembly files into machine code; and a test program intelligent agent for generating functional code for a test program developed for the GPU.
[0021] This application provides an electronic device, comprising: a memory that non-transitoryly stores computer-executable instructions; and a processor configured to run the computer-executable instructions, wherein the computer-executable instructions are executed by the processor to implement the graphics processor development method according to any embodiment of this application.
[0022] This application provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the graphics processor development method according to any embodiment of this application.
[0023] The intelligent agent system for hardware and software co-development of graphics processing units (GPUs) provided by this invention uses relevant documents used in the GPU development process as a single source of facts. Each third agent develops based on the relevant documents and automatically aligns the various components that depend on the relevant documents. It adopts a distributed multi-agent architecture, which can decompose development tasks and reasonably allocate the tasks to be executed by each agent. Through multi-agent collaboration, it realizes the development of relevant documents, simulators, assemblers and test programs, thereby improving the development efficiency of GPUs. Attached Figure Description
[0024] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings of the embodiments will be briefly described below. Obviously, the drawings described below only relate to some embodiments of this disclosure, and are not intended to limit this disclosure.
[0025] Figure 1 This is a schematic diagram of the structure of a graphics processing unit (GPU);
[0026] Figure 2 A schematic block diagram of an intelligent agent system for graphics processor development, provided for at least one embodiment of the present disclosure;
[0027] Figure 3 A flowchart illustrating the execution process of an intelligent agent provided in at least one embodiment of this disclosure;
[0028] Figure 4 This is a schematic diagram of the structure of a second intelligent agent 12 provided in at least one embodiment of the present disclosure;
[0029] Figure 5 This is a schematic diagram of the structure of a third intelligent agent 13 provided in at least one embodiment of the present disclosure;
[0030] Figure 6a A schematic diagram illustrating the interaction between a second intelligent agent 12 and multiple third intelligent agents 13, provided for at least one embodiment of this disclosure;
[0031] Figure 6bA schematic diagram illustrating the interaction between another second intelligent agent 12 and multiple third intelligent agents 13, provided for at least one embodiment of this disclosure;
[0032] Figure 6c A schematic diagram illustrating the interaction between a second intelligent agent 12 and a plurality of third intelligent agents 13, provided for at least one embodiment of this disclosure;
[0033] Figures 7a-7c A schematic flowchart illustrating the execution of development tasks by an intelligent agent system for graphics processor development, provided in at least one embodiment of this disclosure;
[0034] Figure 8 A flowchart illustrating a graphics processor development method provided for at least one embodiment of this disclosure;
[0035] Figure 9 A schematic diagram of a non-transitory computer-readable storage medium provided for at least one embodiment of the present disclosure;
[0036] Figure 10 This is a schematic block diagram of an electronic device provided in one embodiment of the present disclosure. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the described embodiments of this disclosure without creative effort are within the scope of protection of this disclosure.
[0038] Unless otherwise defined, the technical or scientific terms used in this disclosure shall have the ordinary meaning understood by one of ordinary skill in the art to which this disclosure pertains. The terms "first," "second," and similar terms used in this disclosure do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships, and these relative positional relationships may change accordingly when the absolute position of the described object changes. To keep the following description of the embodiments of this disclosure clear and concise, detailed descriptions of some known functions and components are omitted.
[0039] Current GPU development methods mainly include two types, which this publication refers to as manual development methods and automated development methods. The manual and automated development methods are described below.
[0040] The manual development method refers to manually designing the GPU architecture, manually writing design documents, and manually writing the GPU software code based on the design documents. This method employs a sequential development model, leading to inefficiency. The same instruction semantics need to be repeatedly implemented in different software components, resulting in long debugging cycles and slow iteration feedback. Furthermore, it is prone to "document-implementation" drift, meaning that the rules set in the design document are inconsistent with the actual rules of the software components or hardware implementation, increasing coordination costs. Additionally, the long iteration cycle in GPU development means that some architectural design problems are only discovered during the implementation phase, leading to lengthy design iterations. Moreover, for GPUs, with their complex architecture, large number of instructions, complex parallelism, complex storage hierarchy, and diverse functional units, manual maintenance is extremely difficult and has poor scalability.
[0041] Automated development methods refer to the methods of generating documentation or GPU-executed code using auxiliary development tools. These methods primarily include automatic generation methods based on Domain-Specific Languages (DSLs) and Architecture Description Languages (ADLs), as well as automatic generation methods based on Artificial Intelligence (AI)-assisted programming tools.
[0042] DSL and ADL primarily target traditional Central Processing Unit (CPU) architectures. Automatic generation methods based on DSL and ADL lack sufficient support for GPU architecture development, have limited expressive power, and struggle to describe GPUs' Single Instruction Multiple Data (SIMD) or Single Instruction Multiple Threads (SIMT) execution modes, complex memory hierarchies, and dedicated functional units such as tensor cores. For GPU architectures, since DSL and ADL-based automatic generation methods mainly support Reduced Instruction Set Computing (RISC) and Very Long Instruction Word (VLIW) architectures, their generation performance is poor for highly parallel architectures like GPUs. Furthermore, DSL and ADL have high learning curves, requiring dedicated toolchains, but the support provided by the DSL and ADL user and maintenance communities and their collaborative ecosystem is limited, resulting in insufficient toolchain completeness.
[0043] For automated generation methods based on AI-assisted programming tools, existing tools face severe context length limitations, while large GPU development projects often contain hundreds of thousands of lines of code, far exceeding processing capabilities. Furthermore, AI-assisted programming tools lack the capacity to handle multi-module projects within a development project, failing to simultaneously understand the entire GPU development project architecture and dependencies, making cross-file refactoring and optimization difficult. Additionally, AI-assisted programming tools lack sufficient domain expertise and a deep understanding of GPU-specific parallel execution models, failing to automatically guarantee consistency between components. Moreover, AI-assisted programming tools suffer from session state loss issues, making it impossible to maintain the state of development projects across sessions and hindering integration with version control systems, thus making them unsuitable for large-scale GPU development.
[0044] Existing technical solutions each have their advantages and disadvantages, but none can effectively address the core challenges of GPU hardware-software co-design and development: manual development methods offer high flexibility, but maintenance costs increase with complexity; automated generation methods based on DSL and ADL provide automation capabilities but have limited expressive power and cannot effectively support complex parallel GPU architectures; automated generation methods based on AI-assisted programming tools have powerful code generation capabilities but lack domain expertise and project-level consistency guarantees. In summary, current manual and automated development methods both have certain shortcomings and are insufficient to meet the development needs of GPUs.
[0045] This disclosure provides, in at least one embodiment, an intelligent agent system, a graphics processor development method, an electronic device, and a non-transitory computer-readable storage medium for graphics processor development. The intelligent agent system for graphics processor development includes a first intelligent agent, a second intelligent agent, multiple third intelligent agents, and a fourth intelligent agent. The first intelligent agent is configured to receive a development task triggered by a user and drive the second intelligent agent, multiple third intelligent agents, and the fourth intelligent agent to execute corresponding operations sequentially or in parallel to complete the development task. The second intelligent agent is configured to maintain relevant documents used in the graphics processor development process. The multiple third intelligent agents are configured to generate functional code corresponding to the development functions of each third intelligent agent based on the relevant documents. The fourth intelligent agent is configured to perform joint testing on the functional code generated by the multiple third intelligent agents, generating test information for the development task, the test information being used to describe the test results of the joint test. The multiple third intelligent agents include: a simulator intelligent agent for generating functional code for a simulator simulating the hardware behavior of a graphics processor; an assembler intelligent agent for generating functional code for an assembler that converts assembly files into machine code; and a test program intelligent agent for generating functional code for a test program for graphics processor development.
[0046] The intelligent agent system for graphics processing unit (GPU) development provided in at least one embodiment of this disclosure uses relevant documents used in the GPU development process as a single source of fact. Each third agent develops based on these documents, automatically aligning components that depend on them, effectively avoiding the "document-implementation" drift problem during development. Employing a distributed multi-agent architecture, it decomposes all tasks involved in GPU development, rationally allocating tasks to each agent. Through multi-agent collaboration, it achieves the development of relevant documents, simulators, assemblers, and test programs, providing an automated development method. By using relevant documents as a single source of fact, it enables the automatic generation or maintenance of components consuming relevant documents, ensuring consistency among these components. The GPU development method provided in this disclosure can be applied to the intelligent agent system for GPU development provided in this disclosure. This intelligent agent system can be configured on an electronic device, such as a server. Alternatively, the intelligent agent system can be deployed in a cluster of multiple servers.
[0047] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings, but this disclosure is not limited to these specific embodiments.
[0048] This disclosure provides at least one embodiment of an AI agent system for handling development tasks for graphics processing units (GPUs). Figure 1 This is a schematic structural diagram of a graphics processor.
[0049] like Figure 1 As shown, a graphics processing unit (GPU) is actually an array of programmable multiprocessors. For example, a programmable multiprocessor can be a streaming processor cluster (SPC), such as including... Figure 1 The diagram shows streaming processor clusters 1, ..., M, where M is a positive integer greater than 1. In a graphics processing unit (GPU), one streaming processor cluster processes one computational task, or multiple streaming processor clusters process one computational task. Multiple streaming processor clusters share data through a global cache or global memory.
[0050] like Figure 1 As shown, taking streaming processor cluster 1 as an example, one streaming processor cluster includes multiple computing units, such as... Figure 1 The system is structured as Computation Unit 1, Computation Unit 2, ..., Computation Unit N, where N is a positive integer. Each Computation Unit (CU) performs arithmetic and logical operations, such as accumulation, reduction, and standard addition, subtraction, multiplication, and division. A Computation Unit includes multiple cores (also called computational kernels), each of which includes an Arithmetic Logic Unit (ALU), a floating-point unit, etc. These cores are used to execute specific computational tasks. Furthermore, the Computation Unit also includes registers (e.g., ...). Figure 1 The register file and shared memory in a computing unit are used to store source and destination data related to computing tasks in a hierarchical manner. The shared memory in a computing unit is used to share data between the cores of that computing unit.
[0051] like Figure 1 As shown, each computing unit also provides a tensor core for performing tensor-related computations, such as tensor shrinking operations. Tensor cores can accelerate tensor operations such as matrix multiplication. Tensor cores in multiple computing units can be uniformly scheduled and controlled.
[0052] like Figure 1 As shown, each streaming processor cluster also provides a buffer for caching data across the N computing units within the streaming processor cluster.
[0053] In parallel computing, computational tasks are typically executed by multiple threads. These threads are divided into multiple thread blocks before execution in the graphics processing unit (or parallel computing processor), and then dispatched via a thread block distribution module. Figure 1(Not shown in the image) Multiple thread blocks are distributed to various computation units. All threads in a thread block must be assigned to the same computation unit for execution. Simultaneously, thread blocks are broken down into minimum execution thread bundles (or simply warps), each containing a fixed number (or less than this fixed number) of threads, for example, 32 threads. Multiple thread blocks can execute in the same computation unit or in different computation units.
[0054] In each computing unit, the thread beam scheduling / distribution module ( Figure 1 (Not shown in the diagram) Thread bundles are scheduled and allocated so that multiple computing cores within the computing unit can run thread bundles. Depending on the number of computing cores in the computing unit, multiple thread bundles within a thread block can execute concurrently or in a time-sharing manner. Multiple threads within each thread bundle execute the same instructions. Memory-executed instructions are issued to shared memory within the computing unit or further issued to intermediate-level caches, global caches, or global memory (e.g., [example cache]). Figure 1 High Bandwidth Memory (HBM) is used for read and write operations.
[0055] Figure 2 This is a schematic block diagram of an intelligent agent system for graphics processor development, provided for at least one embodiment of this disclosure. Figure 2 As shown, the intelligent agent system 10 includes a first intelligent agent 11, a second intelligent agent 12, multiple third intelligent agents 13, and a fourth intelligent agent 14.
[0056] The intelligent agent system 10 includes an intelligent agent, which is an entity capable of observing and making decisions in a given environment and has the ability to process data. That is, the intelligent agent system 10 can output specific types of data based on a certain type of input data. In this embodiment of the disclosure, the intelligent agent system 10 can process GPU development tasks based on artificial intelligence technology.
[0057] The first intelligent agent 11 is configured to receive development tasks triggered by the user and drive the second intelligent agent 12, multiple third intelligent agents 13 and the fourth intelligent agent 14 to execute corresponding operations sequentially or in parallel to complete the development task.
[0058] The first intelligent agent 11 can determine the intelligent agent to be driven, the operations to be performed by that intelligent agent, and the order of operations to be performed, based on the development tasks to be achieved and the functions of other intelligent agents included in the intelligent agent system 10. The first intelligent agent 11 can also be called the top-level coordinating intelligent agent.
[0059] Development tasks can be triggered by users through a client application. The client application can be deployed on devices such as mobile phones and computers that can trigger development tasks. Triggering can be done through input or selection methods.
[0060] Development tasks are those related to the collaborative development of GPU hardware and software. For example, a development task can be the creation of documentation or GPU software components, or the maintenance of documentation or GPU software components during development. It could be a development task that creates the entire codebase of a graphics processing unit based on user requirements, or a development task that updates existing code based on user needs. Development tasks can be described using natural language.
[0061] For example, a user can input a natural language description of a development task through the user interface, such as adding a command and describing its function. The first agent 11 can receive the user input as a prompt to understand the development task the user expects to perform. For example, the development task obtained by the first agent 11 based on the user input is: "Add a MAD command to complete the operation dst=src1*src2+src3".
[0062] After the first agent 11 acquires the development task, the first agent 11 can drive the second agent 12, multiple third agents 13 and the fourth agent 14 to perform operations.
[0063] The second agent 12 is configured to maintain the relevant documentation used during GPU development.
[0064] The second intelligent agent 12 is capable of managing the content of relevant documents to enable GPU development. The second intelligent agent 12 can also be called a document intelligent agent.
[0065] The relevant documents maintained by the second intelligent agent 12 are Single Source of Truth (SSoT) documents. The content of these documents is related to both hardware and software architecture. These documents are maintained jointly during the GPU's hardware and software development processes to achieve collaborative hardware and software development. Furthermore, these documents ensure consistency among software components consuming them and support the automatic propagation of architectural changes.
[0066] For example, relevant documents may include graphics processor architecture documents. Architecture documents may include instruction set architecture (ISA) documents. ISA documents contain complete definitions and descriptions of the components of the ISA. ISA documents typically include register definitions, memory types, memory models, instruction categories and formats, and instruction definitions for specific instructions. Instruction definitions include instruction semantics, instruction encoding, and constraints.
[0067] Additionally, relevant documentation may include processor top-level architecture information. This processor top-level architecture information is hardware information, published in a standardized format for software use, thereby enabling hardware-software interoperability.
[0068] The relevant documents can be set according to the design and development needs, and this disclosure does not impose specific restrictions on them.
[0069] The intelligent agent system 10 includes multiple third intelligent agents 13, configured to generate functional code corresponding to the development functions of each third intelligent agent 13 based on relevant documents. The development functions of different third intelligent agents 13 are different.
[0070] For example, multiple third agents 13 include simulator agent 131, assembler agent 132, and tester agent 133.
[0071] The simulator agent 131 generates functional code for a simulator that emulates the hardware behavior of a GPU. For example, simulator agent 131 generates register file implementations, memory hierarchy implementations, and instruction implementations. The simulator takes binary machine code as input and returns the instruction execution results.
[0072] Assembler agent 132 is used to generate functional code for an assembler that converts assembly files into machine code. For example, assembler agent 132 generates a lexical analyzer, a syntax analyzer, an instruction encoding table, error handling rules, etc. The assembler's input is the assembly file, and the execution result is machine code.
[0073] Test program agent 133 is used to generate functional code for test programs in the co-development of GPU hardware and software. For example, test program agent 133 is used to generate basic instruction test programs, specialized test programs, etc. For example, a set of instruction tests for tensor kernel testing.
[0074] The fourth agent 14 is configured to jointly test the functional code generated by multiple third agents 13, generating test information specific to the development task. This test information describes the results of the joint tests.
[0075] After multiple third agents 13 generate corresponding functional codes, the fourth agent 14 can perform joint testing on the functional codes to test whether the functional codes can run normally and to determine the performance of running the functional codes, thereby achieving automatic debugging of the functional codes.
[0076] At least one embodiment of this disclosure provides an intelligent agent system for graphics processor development. A first intelligent agent 11 interacts with the user to obtain development tasks, and drives a second intelligent agent 12 to maintain relevant documentation based on these tasks, thus achieving automatic maintenance of the documentation. A third intelligent agent 13 generates functional code for the software components being developed based on the maintained documentation, implementing simulators, assemblers, and test programs that depend on the documentation. This process is synchronized with the processing of the documentation, effectively avoiding the "document-implementation" drift problem. Finally, a fourth intelligent agent 14 jointly tests the functional code generated by multiple third intelligent agents 13, automatically testing whether the functional code generated during the execution of the development task can run normally. This intelligent agent system for graphics processor development can automatically process relevant documentation, simulators, assemblers, and test programs, as well as automatically test the functional code corresponding to the simulators, assemblers, and test programs, based on development tasks through multi-agent collaboration, thereby completing the development task. For example, in some embodiments, the intelligent agents included in the intelligent agent system 10 can use a unified execution engine.
[0077] It should be noted that the intelligent agents included in the intelligent agent system 10 include the first intelligent agent 11, the second intelligent agent 12, the third intelligent agent 13, the fourth intelligent agent 14, as well as the various sub-intelligent agents that the second intelligent agent 12 may include and the various sub-intelligent agents that the third intelligent agent 13 may include, as mentioned below.
[0078] The agents included in the intelligent agent system 10 are based on an execution engine and can continuously and cyclically invoke tools and manage thread contexts. Figure 3 This is a flowchart illustrating the execution process of an intelligent agent provided in at least one embodiment of the present disclosure.
[0079] First, the agent obtains the prompt and thread ID. The prompt can be any information obtained by the agent. Based on the thread ID, the thread's context is loaded. The thread's context includes its accumulated dialogue history, variables, state, and other information. The agent then calls the Large Language Model (LLM) to process the prompt and context, generating a response.
[0080] Secondly, the agent determines whether to invoke the tool based on the response of the large model.
[0081] Tools are used to perform development tasks, and the tools invoked by each agent are related to the specific functions of that agent. For example, the tool invoked by the second agent 12 is used to maintain relevant documentation. The tool invoked by the third agent 13 is used to generate functional code. This disclosure provides a detailed description of some of these tools, which can be found below.
[0082] Each agent can access the same project directory by calling the tool, which facilitates collaborative development among multiple agents.
[0083] If the agent determines to invoke a tool, the following steps are repeated until the tool is no longer invoked: The agent executes the tool. In cases where multiple tools need to be executed, a parallel execution method can be used. The agent appends the tool results obtained from executing the tools to the context processed by the large language model, updating the context. The agent then invokes the large language model to process the prompt words and the updated context, generating a response. The agent determines whether to invoke the tool based on the generated response.
[0084] If the agent determines not to invoke the tool, it saves the generated dialogue history, variables, state and other information to the thread's context.
[0085] The agent determines whether the thread needs to be shut down. If it does, the thread's context is cleaned up. If it does not need to be shut down, the thread's context is persisted.
[0086] Finally, the agent returns the final response generated by the LLM.
[0087] The first agent 11 can, based on the development task, first drive the second agent 12 to adjust the content of the relevant document. As mentioned earlier, the relevant document can support consistency among the components of the GPU software that consume the relevant document. When the relevant document is adjusted, multiple third agents 13 then generate functional code based on the adjusted relevant document to ensure the consistency of each component.
[0088] For example, in some embodiments, when the first intelligent agent 11 receives a development task triggered by a user and drives the second intelligent agent 12 and multiple third intelligent agents 13 to perform corresponding operations sequentially or in parallel, the following operations are performed: receiving the development task triggered by the user; generating a document processing request including document processing information according to the development task; and sending the document processing request to the second intelligent agent 12.
[0089] The document processing request instructs the second agent 12 to process relevant documents based on document processing information. This document processing information can be described using natural language.
[0090] Document processing information includes information on adjustments made to the content of a related document using at least one of the following methods: adding, deleting, querying, and updating. The adjustment methods included in the document processing information are determined based on the needs of the development task. Taking the aforementioned development task as adding a MAD directive: dst=src1*src2+src3, the document processing information includes information on adjustments made to the content of the related document using the adding method, such as "Request to add MAD directive definition".
[0091] The first intelligent agent 11 sends a document processing request to the second intelligent agent 12 to drive multiple third intelligent agents 13 and fourth intelligent agents 14 to perform corresponding operations and complete the development task.
[0092] The following section introduces possible implementation methods for the second intelligent agent 12 to maintain related documents.
[0093] For example, in some embodiments, when the second agent 12 performs the maintenance of relevant documents used in the GPU development process, it includes performing the following operations: receiving a document processing request sent by the first agent 11, which includes document processing information; processing the relevant documents based on the document processing information; generating a development processing request based on the processing result information of the processed relevant documents; and sending the development processing request to multiple third agents 13 respectively.
[0094] The second intelligent agent 12 can process relevant documents based on the acquired document processing information. Processing relevant documents includes adjusting the relevant documents using at least one of the following methods: adding, deleting, querying, and updating. The method of adjusting the relevant documents is determined by the information on the adjustment methods included in the document processing information.
[0095] The second intelligent agent 12 obtains processing result information based on the processed relevant documents. The processing result information includes relevant information in the relevant documents after processing based on the document processing request. The processing result information describes the processing of the content of the relevant documents. Taking the development task as "adding MAD instructions" as an example, the processing result information may include updating the ISA primitives in the instruction set architecture document, adding instruction categories of three source operand types, and may also include defining the semantics, encoding, and constraints of the MAD instructions. The second intelligent agent 12 generates a development processing request based on the processing result information. The development processing request includes the processing result information. The processing result information is described using natural language. The development processing request instructs the third intelligent agent 13 to generate functional code corresponding to the development function based on the adjusted relevant documents.
[0096] The second agent 12 sends development processing requests to multiple third agents 13 to drive the multiple third agents 13 to generate functional code.
[0097] It should be noted that the second intelligent agent 12 can send development processing requests to multiple third intelligent agents 13 in parallel, thereby driving multiple third intelligent agents 13 to generate functional code in parallel, improving processing efficiency and shortening development time.
[0098] In other embodiments, the second intelligent agent 12 can detect human adjustments to the relevant document. Based on the processing result information of the human-adjusted relevant document, the second intelligent agent 12 can generate a development processing request and send the request to multiple third intelligent agents 13 respectively. The human adjustment to the relevant document can be a direct modification of the document itself, or an adjustment to code that affects the content of the document.
[0099] For example, in some embodiments, the second agent 12 is a single agent. In other embodiments, the second agent 12 may include multiple sub-agents.
[0100] The following describes the specific process by which the second agent 12 maintains relevant documents and sends development processing requests to the third agent 13 when the second agent 12 includes multiple sub-agents.
[0101] First, let's introduce the structure of the second intelligent agent 12. Figure 4 This is a schematic diagram of the structure of a second intelligent agent 12 provided in at least one embodiment of the present disclosure. The second intelligent agent 12 includes a first basic sub-intelligent agent and a first instruction sub-intelligent agent.
[0102] It should be noted that, Figure 4 The number of first basic sub-intelligent agents included in the second intelligent agent 12, and the number of first instruction sub-intelligent agents, are merely examples and do not constitute a limitation on the number of first basic intelligent agents or the number of first instruction sub-intelligent agents.
[0103] The content of the relevant documents maintained by the first basic sub-agent and the first instruction sub-agent is different.
[0104] The first basic sub-agent is configured to maintain the basic content of the relevant documents.
[0105] The core content of the relevant documents includes software or hardware architecture information during the graphics processor development process. For example, architecture information includes instruction classification information, which includes memory type, register definitions (including register type and register classification), instruction category and format, etc. The core content of the relevant documents may also include processor top-level architecture information and memory model information.
[0106] For example, instruction classification information describes the instruction type for obtaining a destination operand from two source operands, as well as information such as the register type and storage type of each operand.
[0107] The first instruction sub-agent is configured to maintain the instruction descriptions of each instruction described in the instruction set architecture document.
[0108] For example, the instruction description can include the instruction definition for a specific instruction (such as an addition instruction or a multiplication instruction) under the instruction category. The instruction definition includes instruction semantics, instruction encoding, and constraints.
[0109] For example, the first instruction sub-agent can process the instruction descriptions of multiple instructions in the instruction set architecture document in parallel, such as adding, deleting, updating, and querying the instruction descriptions of multiple instructions in parallel.
[0110] In the above embodiments, each sub-agent of the second intelligent agent 12 is configured to maintain a portion of the content of a relevant document, making the scope of the relevant document content maintained by each sub-agent controllable. The context saved by each sub-agent is related to a portion of the relevant document content maintained by the sub-agent. Each sub-agent does not need to save context related to all the content of the relevant document, thus narrowing the scope of the context saved and concerned by each sub-agent. When a sub-agent loads context, it can load a sufficient number of contexts that are highly relevant to the content of the relevant document being maintained from the smaller scope of the saved contexts, improving the effectiveness of each sub-agent in maintaining relevant documents based on context.
[0111] For example, in some embodiments, the first basic sub-agent is configured to: in response to document processing information being related to basic content, process the relevant part of the basic content according to the document processing information, and send a document instruction processing request including first instruction processing information to the first instruction sub-agent, so that the first instruction sub-agent processes the instruction description content of the target instruction in the instruction set architecture document based on the first instruction processing information.
[0112] In other words, when it is necessary to process the basic content of relevant documents based on document processing information, the first basic sub-agent processes the basic content according to the document processing information.
[0113] The tools that the first basic sub-agent and the first instruction sub-agent can call are described below.
[0114] For example, the first basic sub-agent can call the corresponding tools through the following two tool call interfaces:
[0115] The first tool call interface: processor(action, processor_description).
[0116] Here, `action` represents operations such as adding, deleting, querying, and updating. `processor_description` is a natural language description of the processor modifications. `processor` is the processor invoked.
[0117] The tool called by the first tool interface mentioned above is related to the basic content of the relevant documentation. It is used to manage the top-level architecture information of the processor and supports multi-processor configuration.
[0118] The second tool call interface is: isa_base(action, processor, isa_base_description).
[0119] The tools called by the second tool interface mentioned above are related to the basic content of the relevant documentation and are used to manage register definitions, memory types, memory models, and instruction categories and formats.
[0120] Here, `action` refers to operations such as adding, deleting, querying, and updating. `processor` is the invoked processor. `isa_base_description` is a natural language description of how the basic content of the ISA document is processed. `action` and `isa_base_description` can be determined based on the document processing information.
[0121] For example, the document processing information is to create a 3-operand instruction category. The first basic sub-agent calls isa_base(update, "Add a 3-operand instruction category (3SRC_TYPE), supporting 64-bit encoding format") to update the instruction category in the basic content.
[0122] When processing basic content, it is necessary to correspondingly process the instruction description content of the target instruction related to the basic content being processed. The first basic sub-agent triggers the first instruction sub-agent to process the instruction description content of the target instruction.
[0123] The first basic sub-agent is determined based on document processing information, specifically at least one instruction described in the instruction set architecture document, i.e., the target instruction. The target instruction is the instruction whose content needs to be processed.
[0124] The first basic sub-agent sends a document instruction processing request, including first instruction processing information, to the first instruction sub-agent. The first instruction processing information is determined based on one or more of the document processing information and the processed portion of the basic content, thereby determining the instruction description content of the target instruction to be processed based on the document processing information itself, or based on the processing status of the basic content in the relevant document.
[0125] The first instruction processing information includes the processing information of the target instruction. This processing information includes the processing method for the target instruction and the processing scope of the target instruction's instruction description. The processing scope of the target instruction's instruction description includes all or part of the target instruction's instruction description.
[0126] Taking the document processing information as "Creating a 3-operand instruction category" as an example, since the purpose of creating a 3-operand instruction category is to add MAD instructions and complete the operation dst = src1 * src2 + src3, the first instruction processing information includes adding the MAD instruction definition. Here, the target instruction is MAD. The processing method is addition, and the relevant instruction description content is the instruction definition.
[0127] For example, in some embodiments, the first instruction sub-agent is configured to: in response to receiving a document instruction processing request including first instruction processing information sent by the first base sub-agent, process the instruction description content of a target instruction in the instruction set architecture document according to the first instruction processing information. Processing the instruction description content of the target instruction includes at least one of adding, deleting, updating, and querying the instruction description content of the target instruction.
[0128] When the document processing information is related to the basic content in the instruction set architecture document, the first basic sub-agent maintains the basic content in the relevant document. The first instruction sub-agent correspondingly maintains the instruction description content of the target instruction in the relevant document.
[0129] As mentioned above, the first basic sub-agent sends a document instruction processing request, which includes first instruction processing information, to the first instruction sub-agent.
[0130] The first instruction sub-agent, based on the first instruction processing information, can determine the instruction description content and processing method of the target instruction, and process the instruction description content of the target instruction according to the processing method. Taking the above-mentioned first instruction processing information including adding the MAD instruction definition as an example, the first instruction sub-agent adds the MAD instruction definition to the relevant document.
[0131] When the target instruction comprises multiple instructions, the first instruction sub-agent can maintain the instruction descriptions of multiple instructions in parallel, further improving the efficiency of maintaining related documents. For example, the first instruction sub-agent can invoke the corresponding tool through the following tool invocation interface:
[0132] isa_instruction(action,processor,instruction_description).
[0133] The tools called by this interface are used to manage the instruction descriptions of specific instructions in ISA documents, mainly including instruction semantics, instruction encoding, and constraints.
[0134] Here, `action` refers to operations such as adding, deleting, querying, and updating. `processor` refers to the invoked processor. `instruction_description` is a natural language description of the target instruction in the ISA document.
[0135] The action and instruction_description are determined based on the first instruction processing information. Taking the first instruction processing information including adding a MAD instruction definition as an example, the first instruction sub-agent calls isa_instruction(add, "MAD instruction definition") to add the MAD instruction definition.
[0136] In the above embodiment, within the second intelligent agent 12, the first basic sub-intelligent agent first maintains the basic content of the relevant documents, and then triggers the first instruction sub-intelligent agent to maintain the instruction description content of the relevant documents, thereby realizing the adjustment based on the basic content. The instruction description content of the target instruction related to the adjusted basic content is automatically adjusted to ensure that the instruction description content of the target instruction is aligned with the basic content of the relevant documents, thereby realizing the automatic vertical propagation from the adjustment of the basic content to the adjustment of the instruction description content and improving the efficiency of maintaining the relevant documents.
[0137] For example, in some embodiments, the first instruction sub-agent is configured as follows:
[0138] In response to the document processing information being directly related to the target instruction described in the instruction set architecture document, the instruction description content of the target instruction in the instruction set architecture document is processed according to the document processing information. Processing the instruction description content of the target instruction includes at least one of adding, deleting, updating, or querying the instruction description content of the target instruction.
[0139] When the document processing information is directly related to the target instruction described in the instruction set architecture document, the instruction description content of the target instruction can be maintained directly.
[0140] The first instruction sub-agent can determine the instruction description content and processing method of the target instruction that needs to be processed based on the document processing information, and process the instruction description content of the target instruction according to the processing method.
[0141] In such cases, the first instruction sub-agent can invoke the corresponding tool through the tool invocation interface isa_instruction(action, processor, instruction_description). The tool invocation method is similar to the invocation method described above and will not be repeated here.
[0142] Furthermore, when the target instruction includes multiple instructions, the first instruction sub-agent can maintain the instruction descriptions of multiple instructions in parallel, further improving the efficiency of maintaining related documents.
[0143] In the above embodiments, the instruction description content of the target instruction in the ISA document can be processed directly, so as to flexibly adopt the corresponding maintenance method for the content of different related documents.
[0144] The following describes the specific process of sending a development processing request to the third agent 13 when the second agent 12 includes multiple sub-agents.
[0145] For example, in some embodiments, the third agent 13 includes a second basic sub-agent and a second instruction sub-agent.
[0146] Figure 5 This is a schematic diagram of the structure of a third intelligent agent 13 provided in at least one embodiment of the present disclosure. The third intelligent agent 13 includes a second basic sub-intelligent agent and a second instruction sub-intelligent agent.
[0147] Figure 5 The number of second basic sub-intelligent agents included in the third intelligent agent 13, and the number of second instruction sub-intelligent agents, are merely examples and do not constitute a limitation on the number of second basic intelligent agents or the number of second instruction sub-intelligent agents.
[0148] The second basic sub-agent is configured to generate functional code corresponding to the development functions of the third agent 13, and the code corresponding to the basic content in the relevant documents.
[0149] The second instruction sub-agent is configured to generate code that corresponds to the instructions described in the ISA document within the function code corresponding to the development function of the third agent 13.
[0150] The code generated by the second instruction sub-agent must, on the one hand, conform to the instruction description maintained by the first instruction sub-agent to achieve consistency with SSoT, and on the other hand, conform to the framework capabilities provided by the second basic sub-agent (such as decoding structures, register file interfaces, execution pipelines, state models, etc.). The framework capabilities provided by the second basic sub-agent are implemented by the code generated by the second basic sub-agent.
[0151] When document processing information is related to basic content, it is necessary not only to process the basic content but also the code description content of the target code. The third agent 13 needs to generate code corresponding to the basic content in the relevant documents and code corresponding to the instructions described in the ISA documents.
[0152] For example, when the first basic sub-agent adjusts the definition of the instruction category, the first instruction sub-agent is first triggered to adjust the instruction description content of the instruction under the instruction category, and then the second basic sub-agent is triggered to adjust the framework capability. The first instruction sub-agent and the second basic sub-agent trigger the second instruction sub-agent to generate the code corresponding to the instruction.
[0153] When the document processing information is directly related to the instructions described in the ISA document, it is necessary to process the code description content of the target code. The third agent 13 needs to generate code corresponding to the instructions described in the ISA document.
[0154] The process of the second agent 12 triggering the third agent 13 to generate code corresponding to the basic content in the relevant documents and code corresponding to the instructions described in the ISA documents will be explained below.
[0155] Figure 6a This is a schematic diagram illustrating the interaction between a second intelligent agent 12 and multiple third intelligent agents 13, provided in at least one embodiment of this disclosure. For example, in some embodiments, a first basic sub-intelligent agent receives a document processing request including document processing information. If the document processing information is related to basic content, the basic content of the relevant document is processed, such as by adding instruction types. Then, based on the processed basic content, the first basic sub-intelligent agent generates multiple first development processing requests and sends these requests to the multiple third intelligent agents 13 respectively. The basic content processing information carried in the first development processing requests includes relevant descriptive information in the basic content after processing based on the document processing request.
[0156] The first development processing request includes basic content processing information. This basic content processing information is described using natural language. It includes relevant descriptive information about the basic content being processed based on the document processing request. For example, the basic content processing information could be a description of the changes before and after processing, or a description of the processed basic content.
[0157] For example, taking the document processing information as an example of adding a three-operand instruction category, the basic content processing information carried in the first development processing request sent to the simulator agent 131 includes: the extended instruction decoder supports 64-bit instruction format, and a three-operand instruction execution pipeline is added; the basic content processing information carried in the first development processing request sent to the assembler agent 132 includes: the lexical analyzer supports three-operand syntax, and the encoder supports 64-bit instruction generation; the basic content processing information carried in the first development processing request sent to the test program agent 133 includes: the test framework supports 64-bit instruction verification, and a three-operand instruction test category is added.
[0158] The first instruction sub-agent is further configured to, in response to the basic content related to document processing information, generate multiple second development processing requests based on the instruction description content of the target instruction in the processed instruction set architecture document, and send these requests to multiple third agents 13 respectively. The second instruction processing information includes the instruction content of the processed target instruction's instruction description and change information regarding the target instruction's instruction description content. For example, the change information includes a change summary. The change summary describes the changes in the target instruction's instruction description content before and after processing.
[0159] For example, taking the document processing information as an example of adding a three-operand instruction category, the first instruction processing information included in the document instruction processing request received by the first instruction sub-agent may be: adding a MAD instruction definition, the first intelligent sub-agent processes the instruction set architecture document, adds a MAD instruction to the document, and adds the relevant instruction description content of the MAD instruction.
[0160] After that, as Figure 6a As shown, the second instruction processing information carried in the second development processing request sent by the first instruction sub-agent to the simulator agent 131 may include implementing MAD instructions; the second instruction processing information carried in the second development processing request sent to the assembler agent 132 may include adding MAD instruction encoding rules; and the second instruction processing information carried in the second development processing request sent to the test program agent 133 may include generating MAD instruction tests.
[0161] like Figure 6aAs shown, when the two agents process the basic content, the second instruction sub-agent receives the update request and the second development processing request sent by the second basic sub-agent. The second instruction sub-agent processes the corresponding part of the functional code according to the code dependency carried in the update request and the second instruction processing information carried in the second development processing request, as described below.
[0162] Figure 6b This is a flowchart illustrating the interaction between a second intelligent agent 12 and multiple third intelligent agents 13, provided in at least one embodiment of this disclosure. Taking document processing information as an example of creating a 3-operand instruction category, the first basic sub-intelligent agent updates the instruction category in the basic content to facilitate the addition of a three-operand MAD instruction. The basic content processing information generated by the first basic sub-intelligent agent is: instruction category update.
[0163] The basic content processing information included in multiple first development processing requests may be the same, or they may differ based on the development functions to be sent to the third intelligent agent 13.
[0164] The first basic sub-agent sends multiple first development processing requests to multiple third agents 13 respectively.
[0165] For example, the first basic sub-agent sends a first development processing request to the simulator agent, the assembler agent, and the test program agent, respectively.
[0166] The first basic sub-agent can send the first development processing request to multiple third agents 13 in parallel, so that each third agent 13 can generate or update the corresponding part of the corresponding functional code in parallel based on the basic content processing information contained in the received first development processing request, thereby improving the overall efficiency of multiple third agents 13 in generating functional code.
[0167] The first instruction sub-agent can generate multiple second development processing requests based on the instruction description of the target instruction in the processed instruction set architecture document.
[0168] The second development processing request includes second instruction processing information. The second instruction processing information is described using natural language. For example, the second instruction processing information includes relevant descriptive information from the instruction description content of the target instruction after processing based on the first instruction processing information. For example, the second instruction processing information may be descriptive information about the changes in the instruction description content of the target instruction before and after processing, or it may be descriptive information about the processed instruction description content of the target instruction.
[0169] For example, the second instruction processing information included in multiple second development processing requests may be the same, or they may differ based on the development functions to be sent to the third intelligent agent 13.
[0170] For example, with Figure 6b As shown, the first basic sub-agent sends a document instruction processing request, including first instruction processing information, to the first instruction sub-agent. The first instruction processing information includes adding MAD instruction definitions. The first instruction sub-agent adds instruction definitions to the MAD instructions. The second instruction processing information for simulator agent 131 is: implement MAD instructions. The second instruction processing information for assembler agent 132 is: add MAD encoding. The second instruction processing information for test program agent 133 is: generate MAD tests.
[0171] The first instruction sub-agent sends multiple second development processing requests to multiple third agents 13 respectively.
[0172] For example, the first instruction sub-agent sends a second development processing request to the simulator agent, the assembler agent, and the test program agent, respectively.
[0173] It should be noted that the first instruction sub-agent can send the second development processing request to multiple third agents 13 in parallel, so that multiple third agents 13 can process the second instruction processing information in parallel, generate or update the corresponding functional code, and improve the overall efficiency of multiple third agents 13 in generating functional code.
[0174] After obtaining the first development processing request and the second development processing request, the third intelligent agent 13 generates the corresponding functional code.
[0175] For example, in some embodiments, the second basic sub-agent is configured to, in response to receiving a first development processing request sent by the first basic sub-agent, generate or update the corresponding part of the functional code and the code corresponding to the basic content in the code of the third agent 13, based on the basic content processing information included in the first development processing request, and send an update request including relationship update information to the second instruction sub-agent, wherein the relationship update information includes the code dependency relationship updated due to the code update of the corresponding part.
[0176] For example, when the code corresponding to the basic content is updated, the reference relationships and dependencies of the code corresponding to specific instructions will change accordingly. The relationship update information includes information about the updates to code dependencies caused by these changes in the basic content. Updated code dependencies include at least one of the following: interface definition changes, data structure definition changes, and call relationship changes. Interface definition changes refer to changes in the definition of the interface. Data structure definition changes refer to changes in the definition of the data structure. Call relationship changes refer to changes in the call relationships between different pieces of code.
[0177] The second instruction sub-agent is configured to, in response to the second development processing request and update request, generate the corresponding part of the corresponding functional code and the code of the corresponding target instruction based on the relationship update information and the second instruction processing information.
[0178] The second basic sub-agent processes information based on the basic content and generates or updates the corresponding parts of the functional code and the code corresponding to the basic content in the code of the third agent 13.
[0179] For example, for simulator agent 131, the second basic sub-agent of simulator agent 131 can call the corresponding tool through the following tool call interface:
[0180] simulator_base(action,base_description).
[0181] Here, `action` refers to operations such as adding, deleting, querying, and updating. `base_description` is a natural language description of the modifications made to the simulator's functional code. `base_description` is generated based on the basic content processing information included in the first development processing request obtained by simulator agent 131.
[0182] The tools invoked by this interface are related to the simulator's basic functions and are used to manage the main simulation loop, build scripts, register file implementation, and memory hierarchy implementation. By calling this tool, the corresponding code in the simulator's functional code can be generated.
[0183] For example, with Figure 6b For example, taking the basic content processing information as an example: instruction category update, the second basic sub-intelligent agent of simulator agent 131 calls simulator_base(update,"Extend instruction decoder to support 64-bit instruction format, add three-operand instruction execution pipeline") to generate the instruction category-related code in the simulator's functional code.
[0184] For example, for assembler agent 132, the second basic sub-agent of assembler agent 132 can call the corresponding tool through the following tool call interface:
[0185] assembler_base(action,base_description).
[0186] Here, `action` refers to operations such as adding, deleting, querying, and updating. `base_description` is a natural language description of the modifications made to the assembler's functional code. `base_description` is generated based on the basic content processing information included in the first development processing request obtained by the assembler agent 132.
[0187] The tools invoked by this interface are related to the basic functions of the assembler, and are used to manage the lexical analyzer, parser, object file generator, and symbol table. By invoking this tool, code corresponding to the basic functions in the assembler can be generated.
[0188] For example, with Figure 6b For example, taking the basic content processing information as an example: instruction category update, the second basic sub-agent of assembler agent 132, assembler_base(update,"lexical analyzer supports three-operand syntax, encoder supports 64-bit instruction generation"), generates the code related to instruction category in the assembler's functional code.
[0189] For example, for test program agent 133, the second basic sub-agent of test program agent 133 can call the corresponding tool through the following tool call interface:
[0190] test_base(action,base_description).
[0191] Here, `action` represents operations such as adding, deleting, querying, and updating. `base_description` is a natural language description of the modifications made to the functional code of the test program. `base_description` is generated based on the basic content processing information included in the first development processing request obtained by the test program's intelligent agent 133.
[0192] The tools invoked by this interface are related to the basic functionality of the test program and are used to manage the test framework, test runner, and result verifier. By invoking this tool, the corresponding code in the functional code of the test program can be generated.
[0193] For example, with Figure 6b For example, taking the basic content processing information as an example: instruction category update, the second basic sub-intelligent agent of the test program agent 133, test_base(update,"Test framework supports 64-bit instruction verification, add three-operand instruction test category"), generates the code related to the instruction category in the functional code of the test program.
[0194] There is a code dependency between the code corresponding to the basic content and the code corresponding to the target instruction. If the code corresponding to the basic content changes, the code corresponding to the target instruction needs to be modified accordingly based on the code corresponding to the basic content.
[0195] The second basic sub-agent sends an update request, including relation update information, to the second instruction sub-agent. This relation update information includes updated code dependencies due to updates to the corresponding code sections. Based on these updated code dependencies, the second instruction sub-agent can determine the generated or updated code corresponding to the basic content. The second instruction sub-agent can then generate the corresponding portions of the functional code and the code of the target instruction, based on the relation update information and the second instruction processing information.
[0196] For example, the second instruction sub-agent of simulator agent 131 can call the corresponding tool through the following tool call interface:
[0197] simulator_instruction(action, instruction_description).
[0198] Here, `action` refers to operations such as adding, deleting, querying, and updating. `instruction_description` is a natural language description of the modifications made to the simulator's functional code. `instruction_description` is generated based on the second instruction processing information and relationship update information obtained by the simulator agent 131.
[0199] The tool interface calls tools related to the simulator's implementation functionality, used to manage instruction decoding and execution logic. By calling this tool, the corresponding code for the target instruction can be generated from the simulator's functional code.
[0200] Taking the second instruction processing information as an example: implementing MAD instructions, simulator agent 131 calls simulator_instruction(add,"Implement MAD instructions: read src1 / src2 / src3 registers, perform multiplication and addition operations, and write back to dst register") to generate code related to MAD instructions.
[0201] For example, the second instruction sub-agent of assembler agent 132 can invoke the corresponding tool through the following tool invocation interface:
[0202] assembler_instruction(action,instruction_description).
[0203] Here, `action` refers to operations such as adding, deleting, querying, and updating. `instruction_description` is a natural language description of the modifications made to the assembler's functional code. `instruction_description` is generated based on the second instruction processing information and relationship update information obtained by the assembler agent 132.
[0204] The tools invoked by this interface are related to the assembler's implementation functionality and are used to manage instruction encoding tables, operand verification, and error handling rules. By invoking this tool, the code corresponding to the target instruction in the assembler's functional code can be generated.
[0205] For example Figure 6b As shown, taking the second instruction processing information as "add MAD encoding" as an example, the assembler agent 132 calls assembler_instruction(add,"MAD instruction encoding rule: opcode=0x2A, verify the validity of the three source operands") to generate the MAD instruction-related code in the assembler's functional code.
[0206] For example, the second instruction sub-agent of test program agent 133 can call the corresponding tool through the following tool call interface:
[0207] test_instruction(action,instruction_description).
[0208] Here, `action` refers to operations such as adding, deleting, querying, and updating. `instruction_description` is a natural language description of the modifications made to the functional code of the test program. `instruction_description` is generated based on the second instruction processing information and relationship update information obtained by the test program's intelligent agent 133.
[0209] The tools invoked by this interface are related to the implementation functionality of the test program and are used to generate instruction test programs, boundary condition test programs, and error injection test programs. By calling this tool, the code corresponding to the target instruction in the functional code of the test program can be generated.
[0210] For example Figure 6b As shown, taking the second instruction processing information as "Generate MAD test" as an example, the test program agent 133 calls test_instruction(add,"Generate MAD instruction test: basic function test, boundary value test, precision test") to generate the code related to MAD instructions in the functional code of the test program.
[0211] For example, taking the implementation of "modify extension" as an example, the first base sub-agent calls isa_base(update, "Extend the double operand category, add a modifier field, and define saturation / round rules"). The first instruction sub-agent executes isa_instruction(update, "...the syntax is changed to dest, src1, src2[modifier]; list the clamping range corresponding to sat, the value of round and the default") for all instructions in the relevant documents with dest=src1 op src2, ensuring that the content in the relevant documents maintains a consistent format and constraint description.
[0212] Taking simulator agent 131 as an example, the second base sub-agent of simulator agent 131 calls `simulator_base(update,"Expand instruction description structure to carry modifier; add bit field parsing to decoder; expose saturation / rounding control entry"` to complete the structure expansion. The second instruction sub-agent of simulator agent 131 executes `simulator_instruction(update,"...clamp the calculation result by modifier.sat, call applyRounding(modifier.roundMode())")` for each affected instruction, thereby realizing the saturation and rounding semantics in the relevant documentation at the instruction level.
[0213] Correspondingly, assembler agent 132 and test program agent 133 perform corresponding operations. For example, the second base sub-agent of assembler agent 132 calls `assembler_base(update, "...lexical / syntax add [modifier] optional segment"))`. The second instruction sub-agent of assembler agent 132 adjusts each affected instruction. The second base sub-agent of test program agent 133 calls `test_base(update,"...instruction test template covering modifier combination")`. The second instruction sub-agent of test program agent 133 adjusts each affected instruction.
[0214] This enables consistent updates of the "modifier extension" across documentation, simulators, assemblers, and test programs at both the base and instruction levels.
[0215] In the above embodiments, the first basic sub-agent and the first instruction sub-agent, based on the content processed in the relevant document, respectively trigger the second basic sub-agent and the second instruction sub-agent to generate function code based on the content processed in the relevant document, ensuring the alignment of the function code with the content of the relevant document, and realizing the automatic horizontal propagation of the content of the relevant document to the function code.
[0216] The process of the second agent 12 triggering the third agent 13 to generate code corresponding to the instructions described in the ISA document is explained below.
[0217] Figure 6c This is a schematic diagram illustrating the interaction between a second intelligent agent 12 and a plurality of third intelligent agents 13, provided for at least one embodiment of the present disclosure.
[0218] For example, in some embodiments, the first instruction sub-agent is further configured to, in response to the document processing information being directly related to the target instruction described in the instruction set architecture document, generate multiple third development processing requests based on the instruction description content of the target instruction in the processed instruction set architecture document, and send multiple third development processing requests to multiple third agents 13 respectively.
[0219] The first instruction sub-agent can process the instruction description content of the target instruction in the ISA document based on the document processing information included in the document processing request, and generate multiple third development processing requests based on the instruction description content of the target instruction in the processed instruction set architecture document.
[0220] The third-party development processing request includes third-party instruction processing information. This third-party instruction processing information is described using natural language. For example, it may include relevant descriptive information after processing the document processing information within the instruction description content of the target instruction. For instance, the third-party instruction processing information could be a description of the changes in the instruction description content of the target instruction before and after processing, or a description of the processed instruction description content of the target instruction.
[0221] For example, the third instruction processing information included in multiple third development processing requests may be the same, or they may differ based on the development functions of the third intelligent agent 13 to which they are to be sent.
[0222] The first instruction sub-agent sends multiple third development processing requests to multiple third agents 13 respectively.
[0223] For example, the first instruction sub-agent sends a third development processing request to the simulator agent, the assembler agent, and the test program agent, respectively.
[0224] It should be noted that the first instruction sub-agent can send the second development processing request to multiple third agents 13 in parallel, so that multiple third agents 13 can process the third instruction processing information in parallel, generate or update the corresponding functional code, and improve the overall efficiency of multiple third agents 13 in generating functional code.
[0225] After receiving the third development processing request, the third intelligent agent 13 generates the corresponding functional code.
[0226] For example, in some embodiments, the second instruction sub-agent is configured to, in response to a third development processing request, generate a corresponding part of the code corresponding to the target instruction in the corresponding functional code based on the third instruction processing information.
[0227] Without changing the code corresponding to the basic content, the second instruction sub-agent can directly process information according to the third instruction and generate the corresponding part of the corresponding functional code and the code of the corresponding target instruction.
[0228] The way in which the second instruction sub-intelligent agent of each third intelligent agent 13 calls the tool to generate the corresponding part of the target instruction code in the corresponding function code according to the third instruction processing information is similar to the way the second instruction sub-intelligent agent of each third intelligent agent 13 calls the tool. Please refer to the description above for details, which will not be repeated here.
[0229] In the above embodiments, each sub-agent of the third intelligent agent 13 is configured to generate partial code of functional code related to the content of a relevant document based on different adjustments. This makes the scope of the sub-functional code generated by each sub-agent controllable and narrows the scope of the context stored by each sub-agent. When a sub-agent loads a context, it can load a sufficient number of contexts that are highly relevant to the sub-functional code to be generated, thus improving the effectiveness of each sub-agent in generating sub-functional code based on the context.
[0230] For example, in some embodiments, before the second intelligent agent 12 performs document processing based on document processing information, it further includes performing the following operations: performing document maintenance conflict detection based on document processing information and related documents; and in response to detecting a document maintenance conflict, sending a first conflict resolution request including first conflict information to the first intelligent agent 11.
[0231] The second intelligent agent 12 can trigger document maintenance conflict detection after obtaining document processing information.
[0232] For example, the second agent 12 can determine whether the relevant document can be successfully maintained based on the document processing information. If not, a document maintenance conflict is identified. The result of detecting a document maintenance conflict is that the processing of the relevant document based on the document processing information has failed.
[0233] The second intelligent agent 12 sends a first conflict resolution request, including first conflict information, to the first intelligent agent 11. The first conflict information includes relevant conflict information related to the document maintenance conflict. The first conflict information is described using natural language. For example, the first conflict information includes the analyzed reason for the document maintenance conflict, or information such as the conflict name, type, and identifier. For example, the analyzed reason for the document maintenance conflict is: the current encoding only supports 2 source operands, while the MAD instruction requires 3 source operands. For example, the first conflict information is: report encoding format conflict.
[0234] For example, in some embodiments, the first intelligent agent 11 is further configured to, in response to receiving a first conflict resolution request, determine a first solution based on the first conflict information, update the document processing information based on the first solution, generate a document processing request including the updated document processing information, and send the document processing request to the second intelligent agent 12.
[0235] For example, the first intelligent agent 11 can determine the first solution by means of autonomous decision-making or manual decision-making.
[0236] The first intelligent agent 11 first analyzes the first conflict information to determine whether the document maintenance conflict can be resolved. In response to the determination that the document maintenance conflict can be resolved, it generates a first solution. That is, it generates the first solution through autonomous decision-making.
[0237] In response to the determination that the document maintenance conflict cannot be resolved, at least one first decision option is generated and provided to the user. Based on the first decision option triggered by the user, a first solution is generated. That is, the first solution is generated through manual decision-making.
[0238] First agent 11 updates document processing information based on a first solution. For example, first agent 11 analyzes encoding format conflicts, determines that document maintenance conflicts can be resolved, and generates a first solution. The updated document processing information is: Create a 3-operand instruction category.
[0239] The second agent 12 can maintain relevant documents based on the updated document processing information.
[0240] It should be noted that autonomous decision-making and manual decision-making can be flexibly chosen based on the needs of conflict resolution.
[0241] For example, the decision-making method can be selected based on the type of document maintenance conflict. For instance, document maintenance conflicts can be categorized into semantic conflicts and architectural conflicts. Semantic conflicts can be resolved primarily through autonomous decision-making, while architectural conflicts can be resolved primarily through manual decision-making.
[0242] In the event of document maintenance conflicts, the interaction between the second intelligent agent 12 and the first intelligent agent 11 enables timely resolution of these conflicts, increasing the probability of successfully completing the development task. Furthermore, if autonomous decision-making fails to resolve the document maintenance conflict, escalation to manual decision-making further facilitates successful resolution.
[0243] For example, in some embodiments, when the third agent 13 generates functional code corresponding to the development functions of the third agent 13 based on relevant documents, the method further includes performing the following operations: detecting code generation conflicts based on the relevant documents and at least one of basic content processing information and second instruction processing information. In response to detecting a code generation conflict, a second conflict resolution request including second conflict information is sent to the first agent 11. The second conflict information includes relevant conflict information related to the code generation conflict.
[0244] The third agent 13 can trigger code generation conflict detection before or after generating functional code.
[0245] For example, the third agent 13 can determine whether it can generate or run functional code based on the relevant document and at least one of the basic content processing information, second instruction processing information, and third instruction processing information. If not, a code generation conflict is determined. The result of the code generation conflict detection is that the generation or execution of functional code based on the relevant document failed.
[0246] The third intelligent agent 13 sends a second conflict resolution request, including second conflict information, to the first intelligent agent 11. The second conflict information includes relevant conflict information related to the code generation conflict. The second conflict information is described using natural language. For example, the second conflict information includes the analyzed cause of the code generation conflict, or information such as the conflict name, type, and identifier. For example, the analyzed cause of the code generation conflict is: insufficient register file ports, requiring read 3 and write 1, currently at read 2 and write 1. For example, the second conflict information could be: report a register file port conflict.
[0247] For example, in some embodiments, the first agent 11 is further configured to, in response to receiving a second conflict resolution request, determine a second solution based on the second conflict information, generate a decision execution request containing relevant information about the second solution based on the second solution, and send it to the third agent 13.
[0248] For example, the first intelligent agent 11 can determine the second solution by means of autonomous decision-making or manual decision-making.
[0249] The first agent 11 first analyzes the second conflict information to determine whether the code generation conflict can be resolved. In response to the determination that the code generation conflict can be resolved, it generates a second solution. That is, it generates the second solution through autonomous decision-making.
[0250] In response to the determination that the code generation conflict cannot be resolved, at least one second decision option is generated and provided to the user. A second solution is then generated based on the second decision option triggered by the user. In other words, a second solution is generated through manual decision-making.
[0251] The first agent 11 generates a decision execution request containing relevant information about the second solution and sends it to the third agent 13.
[0252] For example, the first intelligent agent 11 analyzes the register file port conflict and determines that it cannot be resolved. It then uses a manual decision-making approach, sending three second-choice options to the user: expanding the register file port, instruction pipeline optimization, and register renaming. Based on the user's choice to expand the register file port to 3 reads and 1 write, a second solution is generated. The relevant information for the second solution can be a description of the solution. For example, the relevant information for the second solution could be: Execute manual decision: Expand register file port.
[0253] The third intelligent agent 13 generates functional code corresponding to the development functions of the third intelligent agent 13 based on the relevant information of the second solution.
[0254] In the event of a code generation conflict, the third agent 13 interacts with the first agent 11. The first agent 11 coordinates the code generation conflict to resolve it in a timely manner, thereby improving the quality and effectiveness of the generated functional code.
[0255] For example, in some embodiments, when the fourth intelligent agent 14 performs joint testing on the functional code generated by multiple third intelligent agents 13 and generates test information for the development task, it includes performing the following operations: sending multiple run test requests to the multiple third intelligent agents 13 respectively, so that each third intelligent agent 13 runs the corresponding functional code based on the received run test requests; obtaining the run information sent by the multiple third intelligent agents 13, and generating test information based on the run information. The run information describes the process and result of running the functional code.
[0256] For example, for simulator agent 131, fourth agent 14 sends a request to simulator agent 131 instructing them to compile a test run for the simulator. Simulator agent 131 responds to the request by running the simulator's functional code, compiling the simulator, and sending runtime information about the simulator to fourth agent 14.
[0257] For assembler agent 132, fourth agent 14 sends a request to assembler agent 132 instructing them to compile the assembler for a test. In response to the request, assembler agent 132 runs the assembler's functional code, compiles the assembler, and sends runtime information about the compiler to fourth agent 14.
[0258] For test program agent 133, fourth agent 14 sends a test run request to test program agent 133, instructing the test program to run. In response to the test run request, test program agent 133 runs the functional code of the test program, performs the test, and sends the test program's running information to fourth agent 14.
[0259] The fourth agent 14 generates test information based on the operational information sent by multiple third agents 13. For example, the test information includes at least the test results. The test information may also include performance analysis results of the GPU based on the test results, as well as the changes brought to the GPU by performing development tasks.
[0260] For example, the fourth agent 14 sends test information to the first agent 11. The first agent 11 can also send test information to the user terminal so that the user terminal can display the results to the user, making it easier for the user to understand the results of performing the development task.
[0261] For example, in some embodiments, the fourth agent 14 is further configured to: in response to a test information indicating the existence of a runtime problem, analyze the test information to obtain a problem analysis result; optimize the functional code related to the runtime problem based on the problem analysis result, or send the test information to the first agent 11, wherein the problem analysis result includes the cause of the runtime problem.
[0262] The fourth agent 14 can also determine whether there are operational problems based on test information. If the test information indicates an operational problem, it analyzes the test information to obtain a problem analysis result. The problem analysis result includes the cause of the operational problem. Based on the problem analysis result, the fourth agent 14 can autonomously optimize the functional code related to the operational problem. For example, optimization includes updating or modifying. Alternatively, the fourth agent 14 can send test information to the first agent 11 and interact with the first agent 11 to resolve the operational problem.
[0263] The first intelligent agent 11 is also configured to, in response to receiving test information, generate an optimization scheme based on the test information, and drive the second intelligent agent 12 and multiple third intelligent agents 13 to execute corresponding operations sequentially or in parallel to execute the optimization scheme.
[0264] For example, the optimization scheme can be generated autonomously by the first intelligent agent 11 based on test information, or it can be generated through human decision-making.
[0265] If the optimization content is related to relevant documents, the first agent 11 can drive the second agent 12 and multiple third agents 13 to execute the optimization scheme.
[0266] The intelligent agent system for hardware and software co-development of graphics processors provided in at least one embodiment of this disclosure has an automated workflow for implementing development tasks. It can automatically align relevant documents, simulators, assemblers, and test programs, helping to shorten the development cycle. Furthermore, based on conflict detection and joint testing mechanisms, it can promptly detect and handle errors and problems during the execution of development tasks, improving the quality of the results and reducing errors in the results.
[0267] The following is combined Figures 7a-7c The example shown illustrates the process of performing development tasks in an intelligent agent system for graphics processor development provided in an embodiment of this disclosure. Figures 7a-7c This is a flowchart illustrating the execution of development tasks by an intelligent agent system for graphics processor development, provided as an embodiment of the present disclosure.
[0268] Suppose the user inputs: "Add MAD command to complete the operation dst=src1*src2+src3".
[0269] First agent 11 receives user input and obtains the development task as: "Add MAD instructions to complete the operation dst=src1*src2+src3". Based on the development task, first agent 11 generates a document processing request including document processing information: "Request to add MAD instruction definition". First agent 11 sends the document processing request to second agent 12.
[0270] The second intelligent agent 12 receives the document processing request, which includes document processing information.
[0271] Before processing the relevant documents based on document processing information, the second intelligent agent 12 detected a document maintenance conflict. The reason for the document maintenance conflict is that the current encoding only supports two source operands, while the MAD instruction requires three source operands. This document maintenance conflict prevents the second intelligent agent 12 from properly processing the relevant documents based on the document processing information.
[0272] The second agent 12 sends a first conflict resolution request, including first conflict information, to the first agent 11. The first conflict information includes information related to document maintenance conflicts. For example, the first conflict information is: report encoding format conflict.
[0273] After obtaining the first conflict resolution request, the first intelligent agent 11 analyzes the document maintenance conflict based on the first conflict information, determines that the document maintenance conflict can be resolved, generates a first solution, and updates the document processing information based on the first solution. The updated document processing information is: Create a 3-operand instruction category.
[0274] The first intelligent agent 11 sends a document processing request, including updated document processing information, to the second intelligent agent 12.
[0275] The second agent 12 obtains a document processing request that includes updated document processing information and performs operations according to the updated document processing information. The second agent 12 calls isa_base(update, "Add three-operand instruction category (3SRC_TYPE), supporting 64-bit encoding format") to update the basic content related to the instruction category in the relevant document. The update result is: [63:56]opcode|[55:48] dst|[47:32]src1|[31:16]src2|15:0]rc3.
[0276] After the basic content of the relevant document is changed, the second intelligent agent 12 processes the instruction description content of the target instruction related to the changed basic content in the relevant document, and triggers the third intelligent agent 13 to generate function code according to the adjusted relevant document.
[0277] The second agent 12 sends a first development processing request, including basic content processing information, to the simulator agent 131, the assembler agent 132, and the test program agent 133, respectively. The basic content processing information is: instruction category update.
[0278] Simulator agent 131 receives a first development processing request, including basic content processing information. Based on the basic content processing information, simulator agent 131 updates the corresponding parts of the simulator's functional code and the code for the corresponding instruction category. Specifically, simulator agent 131 calls simulator_base(update,"Extend the instruction decoder to support 64-bit instruction format and add a three-operand instruction execution pipeline").
[0279] Assembler agent 132 receives a first development processing request, including basic content processing information. Based on the basic content processing information, assembler agent 132 updates the corresponding parts of the assembler's functional code and the code for the corresponding instruction category. Specifically, it calls assembler_base(update,"The lexical analyzer supports three-operand syntax, and the encoder supports 64-bit instruction generation").
[0280] Test program agent 133 obtains a development processing request that includes basic content processing information. Based on the basic content processing information, test program agent 133 updates the corresponding parts of the functional code and the code of the corresponding instruction category in the test program. Specifically, it calls test_base(update,"The test framework supports 64-bit instruction verification, add a three-operand instruction test category").
[0281] The following describes the process by which the second intelligent agent 12 processes the modified instruction description of the target instruction.
[0282] The second agent 12 calls `isa_instruction(add, "MAD instruction definition")` to add the instruction description of the MAD instruction to the relevant documentation. The MAD instruction is the target instruction. Specifically, the instruction description of the MAD instruction includes its semantics, encoding, and constraints.
[0283] After processing the instruction description of the target instruction, the second agent 12 triggers multiple third agents 13 to generate the corresponding part of the code corresponding to the MAD instruction in the corresponding function code.
[0284] The second agent 12 sends a second development processing request, including second instruction processing information, to the simulator agent 131, the assembler agent 132, and the test program agent 133, respectively. The second instruction processing information is related to the MAD instruction.
[0285] Simulator agent 131 acquires a second development processing request, including second instruction processing information. Simulator agent 131 then processes the request based on the second instruction processing information and relationship update information. Figure 7b (Not shown in the image), the code related to MAD instructions in the function code that generates the simulator. Relationship update information includes the updated code dependencies due to updates to the encoding format of the corresponding code in the simulator's function code.
[0286] Specifically, simulator agent 131 calls simulator_instruction(add,"Implement MAD instructions: read src1 / src2 / src3 registers, perform multiplication and addition operations, and write back to dst register") to generate the code for MAD execution logic.
[0287] Assembler agent 132 acquires a second development processing request, including second instruction processing information. Assembler agent 132 then processes the request based on the second instruction processing information and relation update information. Figure 7b (Not shown in the diagram), the code related to the MAD instruction in the function code that generates the assembler. The relationship update information includes the updated code dependencies due to updates to the corresponding encoding format code in the assembler's function code.
[0288] Specifically, assembler agent 132 calls assembler_instruction(add,"MAD instruction encoding rule: opcode=0x2A, verify the validity of the three source operands") to generate the MAD instruction encoding table.
[0289] The test program agent 133 acquires a second development processing request, including second instruction processing information. The test program agent 133 then processes the request based on the second instruction processing information and relationship update information. Figure 7b (Not shown in the image), the code related to MAD instructions in the functional code of the generated test program. Relationship update information includes the updated code dependencies due to corresponding code updates in the encoding format within the functional code of the test program.
[0290] Specifically, test program agent 133 calls test_instruction(add,"Generate MAD instruction test: basic function test, boundary value test, precision test") to generate code for testing MAD instructions.
[0291] Furthermore, after the simulator agent 131 generates the MAD execution logic code based on the second instruction processing information and relationship update information, a code generation conflict detection is performed. This involves checking the consistency between the functional code and related documentation, and a code generation conflict is detected. The cause of this conflict is insufficient register file ports; it requires reading 3 and writing 1, but is currently reading 2 and writing 1. This conflict prevents the simulator agent 131 from running the MAD execution logic code correctly.
[0292] The simulator agent 131 sends a second conflict resolution request, including second conflict information, to the first agent 11. For example, the second conflict information is: report register file port conflict.
[0293] After obtaining a second conflict resolution request including second conflict information, the first intelligent agent 11 analyzes the code generation conflict based on the second conflict information. If it determines that the conflict is unsolvable, it sends three second decision options to the user through a manual decision-making process: expanding the register file port, instruction pipeline optimization, and register renaming technology. Based on the user-selected expanded register file port (3 reads, 1 write), a second solution is generated. The relevant information for the second solution can be a description of the solution. For example, the relevant information for the second solution could be: Execute manual decision: Expand register file port. The first intelligent agent 11 sends a decision execution request including the relevant information for the second solution to the simulator intelligent agent 131.
[0294] Simulator agent 131 obtains a decision execution request including decision information and executes the operation according to the decision information. Simulator agent 131 calls simulator_base(update,"Extend register file port to 3 read 1 write") to generate the code related to the register file port in the simulator's functional code.
[0295] First agent 11 sends a joint test command to fourth agent 14. The joint test command is used to trigger fourth agent 14 to execute a joint test operation.
[0296] The fourth agent 14 sends test execution requests to multiple third agents 13. The test execution requests are used to trigger the third agents 13 to run functional code.
[0297] Specifically, simulator agent 131 compiles the simulator. Assembler agent 132 compiles the assembler. Test program agent 133 runs and generates test code. Each third agent 13 feeds back the execution information to the fourth agent 14.
[0298] The fourth agent 14 generates test information based on the runtime information. The test information includes the test results of each third agent 13, as well as a performance evaluation report. The test results include: the assembler correctly generates 64-bit machine code, the simulator correctly executes MAD, and all test cases pass. The performance evaluation report includes: performance impact: instruction encoding: 32-bit → 64-bit (partial), decoding latency: +1 cycle, register port: 2 reads 1 write → 3 reads 1 write, cache utilization -5%.
[0299] The fourth agent 14 sends test information to the first agent 11. The first agent 11 sends the test information through the user terminal to notify the user of the completion status of the development task.
[0300] In this embodiment, a "single source of truth" serves as the iteration center, automating document generation, dependency construction, and code generation to achieve an efficient closed loop in GPU development, reducing collaboration costs and lowering design iteration cycles and time costs. Based on a multi-agent workflow and alignment mechanism, corresponding workflows are automatically triggered and the alignment of documents, simulators, assemblers, and programs is completed in parallel, which helps to shorten the development cycle and reduce errors.
[0301] This disclosure provides a method for developing a graphics processor, applied to an intelligent agent system, which includes a first intelligent agent, a second intelligent agent, multiple third intelligent agents, and a fourth intelligent agent.
[0302] Figure 8 A flowchart of a graphics processor development method provided by at least one embodiment of the present disclosure is shown.
[0303] like Figure 8 As shown, the graphics processor development method may include steps S810 to S850.
[0304] Step S810: Receive the development task triggered by the user;
[0305] Step S820: The first intelligent agent drives the second intelligent agent, multiple third intelligent agents, and the fourth intelligent agent to execute corresponding operations sequentially or in parallel to complete the development task;
[0306] Step S830: The second agent maintains the relevant documents used in the development of the graphics processor;
[0307] Step S840: Multiple third-party agents generate functional code corresponding to the development functions of each third-party agent based on relevant documents;
[0308] Step S850: The fourth agent performs joint testing on the functional code generated by multiple third agents, generating test information for the development task. The test information is used to describe the test results of the joint test.
[0309] The multiple third agents include: a simulator agent for generating function code for a simulator that simulates the hardware behavior of a graphics processor; an assembler agent for generating function code for an assembler that converts assembly files into machine code; and a test program agent for generating function code for a test program developed for the graphics processor.
[0310] For example, development tasks are described in natural language.
[0311] The development task is completed by having a first intelligent agent drive a second intelligent agent and multiple third intelligent agents to execute corresponding operations sequentially or in parallel, including:
[0312] The first intelligent agent generates a document processing request, which includes document processing information, based on the development task. The document processing request is used to instruct the second intelligent agent to process the relevant document based on the document processing information, which includes information on adjusting the content of the relevant document in at least one of the following ways: adding, deleting, querying, and updating.
[0313] The first intelligent agent sends a document processing request to the second intelligent agent, which drives multiple third and fourth intelligent agents to perform corresponding operations and complete the development task.
[0314] For example, the documentation used in the development of the graphics processor is maintained by a second intelligent agent, including:
[0315] Receive document processing requests sent by the first intelligent agent;
[0316] Based on document processing information processing, related documents are processed, wherein the methods of processing related documents include at least one of adding, deleting, querying and updating;
[0317] Based on the processing results of the relevant documents, a development processing request is generated. The processing results include relevant information in the relevant documents after processing based on the document processing request.
[0318] Send development processing requests to multiple third-party intelligent agents respectively.
[0319] For example, the second intelligent agent includes a first basic sub-intelligent agent and a first instruction sub-intelligent agent;
[0320] The documentation used in the collaborative hardware and software development process of the graphics processor, maintained by a second intelligent agent, includes:
[0321] The basic content of the relevant documents is maintained by the first basic sub-agent. The relevant documents include the architecture document of the graphics processor, the architecture document includes the instruction set architecture document, and the basic content includes the software or hardware architecture information describing the development process of the graphics processor. The architecture information includes instruction classification information.
[0322] The first instruction sub-agent maintains the instruction descriptions of each instruction described in the instruction set architecture document.
[0323] For example, the basic content of the relevant documents maintained by the first basic sub-agent includes:
[0324] The first basic sub-agent responds to document processing information related to basic content, processes relevant parts of the basic content based on the document processing information, and...
[0325] A document instruction processing request, including first instruction processing information, is sent to the first instruction sub-agent so that the first instruction sub-agent processes the instruction description content of the target instruction in the instruction set architecture document based on the first instruction processing information. The first instruction processing information includes the processing method of the target instruction and the processing range of the instruction description content of the target instruction. The target instruction includes at least one instruction described in the instruction set architecture document, which is determined based on the document processing information.
[0326] For example, the instruction descriptions of each instruction described in the instruction set architecture document are maintained by the first instruction sub-agent, including:
[0327] In response to receiving a document instruction processing request including first instruction processing information sent by a first basic sub-agent, the first instruction sub-agent processes the instruction description content of the target instruction in the instruction set architecture document according to the first instruction processing information. The first instruction processing information includes the processing method of the target instruction and the processing range of the instruction description content of the target instruction. The target instruction includes at least one instruction described in the instruction set architecture document based on the document processing information. The processing information includes the processing method of the target instruction and the related instruction description content.
[0328] In response to the fact that the document processing information is directly related to the instructions described in the instruction set architecture document, the instruction description content of the target instruction in the instruction set architecture document is processed according to the document processing information.
[0329] The instruction description content for processing the target instruction includes at least one of the instruction description contents for adding, deleting, updating, and querying the target instruction.
[0330] For example, graphics processor development methodologies also include:
[0331] The first basic sub-agent responds to the document processing information and the basic content, generates multiple first development processing requests based on the processed basic content, and sends multiple first development processing requests to multiple third agents respectively, so that each third agent generates or updates the corresponding part in the corresponding function code based on the basic content processing information contained in the received first development processing requests. The basic content processing information includes the relevant descriptive information in the basic content after processing based on the document processing requests.
[0332] The first instruction sub-agent, in response to document processing information and related basic content, generates multiple second development processing requests based on the instruction description content of the target instruction in the processed instruction set architecture document. These requests are then sent to multiple third agents, enabling each third agent to generate or update the corresponding part of the functional code based on the second instruction processing information contained in the received second development processing requests. The second instruction processing information includes the instruction content of the processed target instruction's instruction description and change information of the target instruction's instruction description. The target instruction includes at least one instruction described in the instruction set architecture document, determined based on the document processing information.
[0333] For example, the third intelligent agent includes the second basic sub-intelligent agent and the second instruction sub-intelligent agent;
[0334] Each third agent generates functional code corresponding to its development functions based on relevant documents, including:
[0335] In response to receiving a first development processing request from a first basic sub-agent, the second basic sub-agent generates or updates the corresponding parts of the functional code and the code corresponding to the basic content in the third agent based on the basic content processing information included in the first development processing request. It also sends an update request including relationship update information to the second instruction sub-agent, wherein the relationship update information includes the code dependency relationship updated due to the code update of the corresponding part, and the updated code dependency relationship includes at least one of interface definition change, data structure definition change, and call relationship change.
[0336] The second instruction sub-agent responds to the second development processing request and update request, and generates the corresponding part of the corresponding functional code and the code of the corresponding target instruction based on the relationship update information and the second instruction processing information.
[0337] For example, graphics processor development methodologies also include:
[0338] The first instruction sub-agent, in response to document processing information directly related to the target instruction described in the instruction set architecture document, generates multiple third development processing requests based on the instruction description content of the target instruction in the processed instruction set architecture document, and sends these requests to multiple third agents. This allows each third agent to generate or update the corresponding part of the functional code based on the third instruction processing information contained in the received third development processing requests. The third instruction processing information includes relevant description information after processing the instruction description content of the target instruction. The target instruction includes at least one instruction described in the instruction set architecture document, determined based on the document processing information.
[0339] For example, the third intelligent agent includes the second instruction sub-intelligent agent;
[0340] Each third agent generates functional code corresponding to its development functions based on relevant documents, including:
[0341] The second instruction sub-agent responds to the third development processing request and generates the corresponding part of the corresponding functional code and the code of the corresponding target instruction based on the third instruction processing information.
[0342] For example, prior to a second agent processing relevant documents based on document processing information, graphics processor development methods also include:
[0343] The second intelligent agent performs document maintenance conflict detection based on document processing information and related documents, wherein the detection result of the document maintenance conflict is that the processing of related documents based on the document processing information fails; in response to the detection of document maintenance conflict, a first conflict resolution request including first conflict information is sent to the first intelligent agent, wherein the first conflict information includes relevant conflict information of the document maintenance conflict;
[0344] Upon receiving a first conflict resolution request, the first intelligent agent determines a first solution based on the first conflict information, updates the document processing information based on the first solution, generates a document processing request including the updated document processing information, and sends the document processing request to the second intelligent agent, so that the second intelligent agent maintains the relevant documents based on the updated document processing information.
[0345] For example, the first intelligent agent determines a first solution based on the first conflict information, including:
[0346] Analyze the first conflict information to determine whether the document maintenance conflict can be resolved;
[0347] In response to the determination that a document maintenance conflict can be resolved, a first solution is generated;
[0348] In response to the determination that the document maintenance conflict cannot be resolved, at least one first decision option is generated and provided to the user, and a first solution is generated based on the first decision option triggered by the user.
[0349] For example, graphics processor development methodologies also include:
[0350] A third intelligent agent performs code generation conflict detection based on relevant documents and at least one of basic content processing information, second instruction processing information, and third instruction processing information. When the code generation conflict detection result is a code generation conflict, the generation or execution of functional code based on the relevant documents fails. In response to the detection of a code generation conflict, a second conflict resolution request including second conflict information is sent to the first intelligent agent. The second conflict information includes relevant conflict information of the code generation conflict.
[0351] Upon receiving a second conflict resolution request, the first intelligent agent determines a second solution based on the second conflict information, generates a decision execution request containing relevant information about the second solution, and sends it to the third intelligent agent, so that the third intelligent agent generates functional code corresponding to the development function of the third intelligent agent based on the relevant information of the second solution.
[0352] For example, the first intelligent agent determines a second solution based on the second conflict information, including:
[0353] Analyze the second conflict information to determine whether the code generation conflict can be resolved.
[0354] In response to the determination that the code generation conflict can be resolved, a second solution is generated;
[0355] In response to determining that the code generation conflict cannot be resolved, at least one second decision scheme is generated and provided to the user, and a second solution is generated based on the second decision scheme triggered by the user.
[0356] For example, a fourth agent performs joint testing on functional code generated by multiple third agents, generating test information specific to the development task, including:
[0357] Multiple test requests are sent to multiple third-party agents so that each third-party agent can run the corresponding functional code based on the received test requests.
[0358] The system acquires runtime information sent by multiple third-party agents, generates test information based on the runtime information, and uses the runtime information to describe the process and results of running the functional code.
[0359] For example, graphics processor development methodologies also include:
[0360] The fourth agent responds to the test information indicating an operational problem, analyzes the test information, and obtains the problem analysis results; based on the problem analysis results, it optimizes the functional code related to the operational problem, or sends the test information to the first agent, wherein the problem analysis results include the cause of the operational problem;
[0361] In response to receiving test information, the first intelligent agent generates an optimization plan based on the test information, which drives the second intelligent agent and multiple third intelligent agents to execute the corresponding operations sequentially or in parallel to implement the optimization plan.
[0362] At least one embodiment of this disclosure also provides an electronic device including a processor and a memory, the memory storing one or more computer program modules. The one or more computer program modules are configured to be executed by the processor to implement the graphics processor development method described above.
[0363] Figure 9 This is a schematic diagram of a non-transitory computer-readable storage medium provided for at least one embodiment of the present disclosure. For example, such as Figure 9 As shown, storage medium 200 can be a non-transitory computer-readable storage medium on which one or more computer-readable instructions 201 can be stored non-transitory. For example, when the computer-readable instructions 201 are executed by a processor, one or more steps in the graphics processor development method described above can be performed.
[0364] For example, the storage medium 200 can be used in an electronic device 300, such as the storage medium 200 including the storage device 308 in the electronic device 300.
[0365] For example, a storage device may include any combination of one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, erasable programmable read-only memory (EPROM), portable compact disc read-only memory (CD-ROM), USB storage, flash memory, etc. One or more computer-readable instructions may be stored on the computer-readable storage medium, and a processor may execute these instructions to perform various functions of the processor. Various application programs and various data may also be stored in the storage medium.
[0366] For example, the storage medium may include a memory card for a smartphone, a cache component for a tablet computer, a hard disk for a personal computer, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), portable compact disc read-only memory (CD-ROM), flash memory, or any combination of the above storage media, or other suitable storage media.
[0367] Figure 10 This is a schematic block diagram of an electronic device provided according to an embodiment of the present disclosure. For example... Figure 10 As shown, the electronic device 300 is, for example, suitable for implementing the graphics processor development method provided in the embodiments of this disclosure. It should be noted that... Figure 10 The components of the electronic device 300 shown are merely exemplary and not limiting. The electronic device 300 may have other components as needed for the actual application.
[0368] like Figure 10 As shown, the electronic device 300 may include a processing device 301 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to non-transitory computer-readable instructions stored in memory to achieve various functions.
[0369] For example, when the computer-readable instruction processing device 301 executes, it can perform one or more steps in the graphics processor development method according to any of the above embodiments. It should be noted that a detailed description of the processing procedure of the graphics processor development method can be found in the relevant descriptions in the embodiments of the above-described graphics processor development method.
[0370] For example, the memory may include any combination of one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) 303 and / or cache memory, etc., whereby computer-readable instructions can be loaded from storage device 308 into RAM 303 to execute. Non-volatile memory may include, for example, read-only memory (ROM) 302, hard disk, erasable programmable read-only memory (EPROM), portable compact disc read-only memory (CD-ROM), USB storage, flash memory, etc. Various applications and various data, such as various data used and / or generated by applications, may also be stored in the computer-readable storage medium.
[0371] For example, the processing device 301, the read-only memory (ROM) 302, and the random access memory (RAM) 303 are interconnected via a bus 304. The input / output (I / O) interface 305 is also connected to the bus 304.
[0372] Typically, the following devices can be connected to the input / output (I / O) interface 305: input devices 306 including, for example, a touchscreen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 307 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 308 including, for example, magnetic tape, hard disk, flash memory, etc.; and communication devices 309. Communication device 309 allows electronic device 300 to communicate wirelessly or wiredly with other electronic devices to exchange data. Although Figure 10 An electronic device 300 with various devices is shown, but it should be understood that it is not required to implement or possess all of the devices shown, and the electronic device 300 may alternatively implement or possess more or fewer devices. For example, a processing device 301 can control other components in the electronic device 300 to perform desired functions. The processing device 301 may be a device with data processing capabilities and / or program execution capabilities, such as a central processing unit (CPU), a tensor processor (TPU), or a graphics processing unit (GPU). The central processing unit (CPU) may be an x86, ARM, RISC-V architecture, etc. The GPU may be directly integrated into the SOC, directly integrated onto the motherboard, or built into the northbridge chip of the motherboard.
[0373] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0374] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units are not, in some cases, intended to limit the specific unit.
[0375] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.
[0376] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0377] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0378] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
[0379] The following points should be noted regarding this disclosure:
[0380] (1) The accompanying drawings of the embodiments of this disclosure only involve the structures involved in the embodiments of this disclosure. Other structures can be referred to the general design.
[0381] (2) Where there is no conflict, the embodiments of this disclosure and the features in the embodiments can be combined with each other to obtain new embodiments.
[0382] The above description is only a specific embodiment of this disclosure, but the protection scope of this disclosure is not limited thereto. The protection scope of this disclosure should be determined by the protection scope of the claims.
Claims
1. An intelligent agent system for graphics processor development, characterized in that, The intelligent agent system includes a first intelligent agent, a second intelligent agent, multiple third intelligent agents, and a fourth intelligent agent; The first intelligent agent is configured to receive a development task triggered by the user, and drive the second intelligent agent, the plurality of third intelligent agents and the fourth intelligent agent to execute corresponding operations sequentially or in parallel to complete the development task; The second intelligent agent is configured to maintain the relevant documents used during the development of the graphics processor; The plurality of third agents are configured to generate functional code corresponding to the development functions of each third agent based on the relevant documents; The fourth agent is configured to jointly test the functional code generated by the plurality of third agents, and generate test information for the development task. The test information is used to describe the test results of the joint test. The plurality of third intelligent agents include: a simulator intelligent agent for generating function code for a simulator that simulates the hardware behavior of the graphics processor; an assembler intelligent agent for generating function code for an assembler that converts assembly files into machine code; and a test program intelligent agent for generating function code for a test program developed for the graphics processor. The second intelligent agent includes a first basic sub-intelligent agent and a first instruction sub-intelligent agent; The first basic sub-agent is configured to maintain the basic content of the relevant documents, wherein the relevant documents include the architecture document of the graphics processor, the architecture document includes the instruction set architecture document, and the basic content includes software or hardware architecture information describing the development process of the graphics processor, the architecture information including instruction classification information; The first instruction sub-agent is configured to maintain the instruction description content of each instruction described in the instruction set architecture document; The third intelligent agent includes a second basic sub-intelligent agent and a second instruction sub-intelligent agent; The second basic sub-agent is configured as follows: In response to receiving a first development processing request sent by the first basic sub-agent, based on the basic content processing information included in the first development processing request, the corresponding part of the functional code corresponding to the third agent and the code corresponding to the basic content are generated or updated, and an update request including relationship update information is sent to the second instruction sub-agent, wherein the relationship update information includes code dependencies updated due to the code update of the corresponding part, and the updated code dependencies include at least one of interface definition change, data structure definition change and call relationship change; The second instruction sub-agent is configured to, in response to the second development processing request and the update request sent by the first instruction sub-agent, generate the corresponding part of the corresponding function code and the code of the corresponding target instruction based on the relationship update information and the second instruction processing information contained in the second development processing request.
2. The intelligent agent system according to claim 1, characterized in that, When the first intelligent agent receives a development task triggered by the user and drives the second intelligent agent, the plurality of third intelligent agents, and the fourth intelligent agent to execute corresponding operations sequentially or in parallel to complete the development task, it includes performing the following operations: Receive development tasks triggered by users, wherein the development tasks are described in natural language. According to the development task, a document processing request including document processing information is generated, wherein the document processing request is used to instruct the second intelligent agent to process the relevant document based on the document processing information, and the document processing information includes descriptive information on processing the content of the relevant document in at least one of the following methods: adding, deleting, querying, and updating; The document processing request is sent to the second agent to drive the plurality of third agents and the fourth agent to perform corresponding operations and complete the development task.
3. The intelligent agent system according to claim 2, characterized in that, When the second intelligent agent performs the maintenance of relevant documents used in the development of the graphics processor, it includes performing the following operations: Receive the document processing request sent by the first intelligent agent; The related documents are processed based on the document processing information, wherein the processing of the related documents includes at least one of adding, deleting, querying, and updating. A development processing request, including processing result information, is sent to each of the plurality of third intelligent agents, wherein the processing result information includes relevant information in the relevant documents after processing based on the document processing request.
4. The intelligent agent system according to claim 1, characterized in that, The first basic sub-agent is configured as follows: In response to the document processing information being related to the basic content, the relevant portion of the basic content is processed according to the document processing information, and... A document instruction processing request, including first instruction processing information, is sent to the first instruction sub-agent so that the first instruction sub-agent processes the instruction description content of the target instruction in the instruction set architecture document based on the first instruction processing information. The first instruction processing information includes the processing method for the target instruction and the processing range of the instruction description content of the target instruction. The target instruction includes at least one instruction described in the instruction set architecture document, determined based on the document processing information.
5. The intelligent agent system according to claim 1, characterized in that, The first instruction sub-agent is configured as follows: In response to receiving a document instruction processing request including first instruction processing information sent by the first basic sub-agent, the instruction description content of the target instruction in the instruction set architecture document is processed according to the first instruction processing information. The first instruction processing information includes the processing method of the target instruction and the processing range of the instruction description content of the target instruction. The target instruction includes at least one instruction described in the instruction set architecture document based on the document processing information. In response to the fact that the document processing information is directly related to the instructions described in the instruction set architecture document, the instruction description content of the target instruction in the instruction set architecture document is processed according to the document processing information; The method of processing the instruction description content of the target instruction includes at least one of adding, deleting, updating, and querying.
6. The intelligent agent system according to claim 1, characterized in that, The first basic sub-agent is further configured to, in response to the document processing information being related to the basic content, generate a plurality of first development processing requests based on the processed basic content, and send the plurality of first development processing requests to the plurality of third agents respectively, so that each third agent generates or updates the corresponding part of the corresponding function code based on the basic content processing information contained in the received first development processing request, wherein the basic content processing information includes relevant descriptive information in the basic content after processing based on the document processing request; The first instruction sub-agent is further configured to, in response to the document processing information being related to the basic content, generate multiple second development processing requests based on the instruction description content of the target instruction in the processed instruction set architecture document, and send the multiple second development processing requests to the multiple third agents respectively, so that each third agent generates or updates the corresponding part of the corresponding function code based on the second instruction processing information contained in the received second development processing request, wherein the second instruction processing information includes the instruction content of the processed instruction description content of the target instruction and change information of the instruction description content of the target instruction, and the target instruction includes at least one instruction described in the instruction set architecture document based on the document processing information.
7. The intelligent agent system according to claim 1, characterized in that, The first instruction sub-agent is further configured to, in response to the document processing information being directly related to the instruction described in the instruction set architecture document, generate multiple third development processing requests based on the instruction description content of the target instruction in the processed instruction set architecture document, and send the multiple third development processing requests to the multiple third agents respectively, so that each third agent generates or updates the corresponding part in the corresponding function code based on the third instruction processing information contained in the received third development processing request; The third instruction processing information includes relevant description information after processing the instruction description content of the target instruction, and the target instruction includes at least one instruction described in the instruction set architecture document, which is determined based on the document processing information.
8. The intelligent agent system according to claim 7, characterized in that, The third intelligent agent includes the second instruction sub-intelligent agent; The second instruction sub-agent is configured to, in response to the third development processing request, generate the corresponding part of the corresponding functional code and the code corresponding to the target instruction based on the third instruction processing information.
9. The intelligent agent system according to claim 3, characterized in that, Before the second intelligent agent processes the relevant document based on the document processing information, it further includes performing the following operations: Based on the document processing information and the related documents, document maintenance conflict is detected, wherein the result of the document maintenance conflict detection is that the processing of the related documents based on the document processing information fails; In response to detecting the document maintenance conflict, a first conflict resolution request including first conflict information is sent to the first agent, wherein the first conflict information includes relevant conflict information of the document maintenance conflict; The first agent is further configured to, in response to receiving the first conflict resolution request, determine a first solution based on the first conflict information, update the document processing information based on the first solution, generate a document processing request including the updated document processing information, and send the document processing request to the second agent, so that the second agent maintains the relevant document based on the updated document processing information.
10. The intelligent agent system according to claim 9, characterized in that, The first intelligent agent determines a first solution based on the first conflict information, including performing the following operations: Analyze the first conflict information to determine whether the document maintenance conflict can be resolved; In response to determining that the document maintenance conflict can be resolved, a first solution is generated; In response to determining that the document maintenance conflict cannot be resolved, at least one first decision scheme is generated and provided to the user, and a first solution is generated based on the first decision scheme triggered by the user.
11. The intelligent agent system according to claim 3, characterized in that, When the third agent executes the function code corresponding to the development function of the third agent based on the relevant document, the following operations are also performed: Based on the relevant documents and the processing result information, code generation conflict is detected. If the code generation conflict detection result is that there is a code generation conflict, the generation or execution of the function code based on the relevant documents fails. In response to detecting the code generation conflict, a second conflict resolution request including second conflict information is sent to the first agent, wherein the second conflict information includes relevant conflict information of the code generation conflict; The first intelligent agent is further configured to, in response to receiving the second conflict resolution request, determine a second solution based on the second conflict information, generate a decision execution request containing relevant information of the second solution based on the second solution, and send it to the third intelligent agent, so that the third intelligent agent generates functional code corresponding to the development function of the third intelligent agent based on the relevant information of the second solution.
12. The intelligent agent system according to claim 11, characterized in that, The first intelligent agent determines a second solution based on the second conflict information, including performing the following operations: Analyze the second conflict information to determine whether the code generation conflict can be resolved; In response to determining that the code generation conflict can be resolved, a second solution is generated; In response to determining that the code generation conflict cannot be resolved, at least one second decision scheme is generated and provided to the user, and a second solution is generated based on the second decision scheme triggered by the user.
13. The intelligent agent system according to any one of claims 1-12, characterized in that, When the fourth agent performs joint testing on the functional code generated by the plurality of third agents and generates test information for the development task, it includes performing the following operations: Multiple run test requests are sent to the multiple third intelligent agents respectively, so that each third intelligent agent runs the corresponding functional code based on the received run test request; The system acquires the operational information sent by the plurality of third-party intelligent agents, generates test information based on the operational information, and the operational information is used to describe the process and result of running the functional code.
14. The intelligent agent system according to any one of claims 1-12, characterized in that, The fourth intelligent agent is further configured as follows: In response to the test information indicating an operational problem, the test information is analyzed to obtain the problem analysis results; Based on the problem analysis results, optimize the functional code related to the operational problem, or send the test information to the first intelligent agent, wherein the problem analysis results include the causes of the operational problem; The first intelligent agent is further configured to, in response to receiving the test information, generate an optimization scheme based on the test information, and drive the second intelligent agent and the plurality of third intelligent agents to execute corresponding operations sequentially or in parallel to execute the optimization scheme.
15. A method for developing a graphics processing unit, characterized in that, The method is applied to an intelligent agent system, the intelligent agent system including a first intelligent agent, a second intelligent agent, multiple third intelligent agents, and a fourth intelligent agent, the method comprising: Receive development tasks triggered by users; The first intelligent agent drives the second intelligent agent, the plurality of third intelligent agents, and the fourth intelligent agent to execute corresponding operations sequentially or in parallel to complete the development task; The second intelligent agent maintains the relevant documents used during the development of the graphics processor; Based on the relevant documents, the plurality of third-party intelligent agents generate functional codes corresponding to the development functions of each third-party intelligent agent; The fourth intelligent agent performs joint testing on the functional code generated by the plurality of third intelligent agents, generating test information for the development task, the test information being used to describe the test results of the joint test; The plurality of third intelligent agents include: a simulator intelligent agent for generating function code for a simulator that simulates the hardware behavior of the graphics processor; an assembler intelligent agent for generating function code for an assembler that converts assembly files into machine code; and a test program intelligent agent for generating function code for a test program developed for the graphics processor. The second intelligent agent includes a first basic sub-intelligent agent and a first instruction sub-intelligent agent; The first basic sub-agent is configured to maintain the basic content of the relevant documents, wherein the relevant documents include the architecture document of the graphics processor, the architecture document includes the instruction set architecture document, and the basic content includes software or hardware architecture information describing the development process of the graphics processor, the architecture information including instruction classification information; The first instruction sub-agent is configured to maintain the instruction description content of each instruction described in the instruction set architecture document; The third intelligent agent includes a second basic sub-intelligent agent and a second instruction sub-intelligent agent; The second basic sub-agent is configured as follows: In response to receiving a first development processing request sent by the first basic sub-agent, based on the basic content processing information included in the first development processing request, the corresponding part of the functional code corresponding to the third agent and the code corresponding to the basic content are generated or updated, and an update request including relationship update information is sent to the second instruction sub-agent, wherein the relationship update information includes code dependencies updated due to the code update of the corresponding part, and the updated code dependencies include at least one of interface definition change, data structure definition change and call relationship change; The second instruction sub-agent is configured to, in response to the second development processing request and the update request sent by the first instruction sub-agent, generate the corresponding part of the corresponding function code and the code of the corresponding target instruction based on the relationship update information and the second instruction processing information contained in the second development processing request.
16. The graphics processor development method according to claim 15, characterized in that, The development tasks are described in natural language. The first intelligent agent drives the second intelligent agent and the plurality of third intelligent agents to execute corresponding operations sequentially or in parallel to complete the development task, including: The first intelligent agent generates a document processing request including document processing information based on the development task. The document processing request is used to instruct the second intelligent agent to process the relevant document based on the document processing information. The document processing information includes information on adjusting the content of the relevant document in at least one of the following ways: adding, deleting, querying, and updating. The first intelligent agent sends the document processing request to the second intelligent agent to drive the multiple third intelligent agents and the fourth intelligent agent to perform corresponding operations and complete the development task.
17. An electronic device, characterized in that, include: Memory stores computer-executable instructions non-transiently; The processor is configured to run computer-executable instructions. The computer-executable instructions are implemented by the processor at runtime according to the graphics processor development method of claim 15 or 16.
18. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are executed by the processor, they implement the graphics processor development method according to claim 15 or 16.
Citation Information
Patent Citations
Code generation method and system based on heterogeneous multi-agent cooperation and electronic equipment
CN119829038A
Hardware design method and device, equipment, storage medium and program product
CN120144099A
Software development method and device based on artificial intelligence, equipment and medium
CN120723218A