Solution¶
- pydantic model flashinfer_bench.data.Solution¶
A concrete implementation for a given Definition.
Represents a complete solution that provides a high-performance implementation for a computational workload defined by a Definition. Contains all source code, build specifications, and metadata required for building, interfacing, and benchmarking the implementation.
Show JSON schema
{ "title": "Solution", "description": "A concrete implementation for a given Definition.\n\nRepresents a complete solution that provides a high-performance implementation\nfor a computational workload defined by a Definition. Contains all source code,\nbuild specifications, and metadata required for building, interfacing, and\nbenchmarking the implementation.", "type": "object", "properties": { "name": { "description": "A unique, human-readable name for this specific solution (e.g., 'rmsnorm_triton_v1_h100').", "minLength": 1, "title": "Name", "type": "string" }, "definition": { "description": "The name of the Definition this implementation solves.", "minLength": 1, "title": "Definition", "type": "string" }, "author": { "description": "The name of the author or agent system that created this solution.", "minLength": 1, "title": "Author", "type": "string" }, "spec": { "$ref": "#/$defs/BuildSpec", "description": "Technical specifications for building and executing this solution." }, "sources": { "description": "Array of source code files representing the complete implementation.", "items": { "$ref": "#/$defs/SourceFile" }, "minItems": 1, "title": "Sources", "type": "array" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Optional human-readable description of the solution's technique or approach.", "title": "Description" } }, "$defs": { "BuildSpec": { "description": "Build specification for a solution implementation.\n\nContains all technical specifications required to build and execute a solution, including\nlanguage, hardware targets, dependencies, entry point, and build commands.", "properties": { "language": { "$ref": "#/$defs/SupportedLanguages", "description": "The primary programming language (e.g., 'triton', 'cuda', 'python')." }, "target_hardware": { "description": "List of hardware architectures this solution is compatible with (e.g., 'NVIDIA_H100',\n'NVIDIA_B200').", "items": { "type": "string" }, "minItems": 1, "title": "Target Hardware", "type": "array" }, "entry_point": { "description": "The exact path to the function to be called. Format: '{file_path}::{function_name}'\n(e.g., 'main.py::run').", "minLength": 1, "title": "Entry Point", "type": "string" }, "dependencies": { "anyOf": [ { "items": { "minLength": 1, "type": "string" }, "type": "array" }, { "type": "null" } ], "default": [], "description": "Optional list of required libraries or toolchains (e.g., 'CUDA >= 12.0',\n'triton >= 2.2').", "title": "Dependencies" } }, "required": [ "language", "target_hardware", "entry_point" ], "title": "BuildSpec", "type": "object" }, "SourceFile": { "description": "A single source code file in a solution implementation.\n\nRepresents a source code file with its relative path and complete content.\nThe file content is validated for syntax correctness based on the file extension.", "properties": { "path": { "description": "The relative path of the file, including its name and extension (e.g., 'src/kernel.cu',\n'main.py'). When compiling the solution, a temporary solution source directory will be\ncreated, and the file will be placed according to this path.", "minLength": 1, "title": "Path", "type": "string" }, "content": { "description": "The complete text content of the source file.", "minLength": 1, "title": "Content", "type": "string" } }, "required": [ "path", "content" ], "title": "SourceFile", "type": "object" }, "SupportedLanguages": { "description": "Supported programming languages for solution implementations.\n\nEnumeration of programming languages that can be used to implement\nsolutions for computational workloads.", "enum": [ "python", "triton", "cuda" ], "title": "SupportedLanguages", "type": "string" } }, "required": [ "name", "definition", "author", "spec", "sources" ] }
- Fields:
name (str)definition (str)author (str)spec (flashinfer_bench.data.solution.BuildSpec)sources (List[flashinfer_bench.data.solution.SourceFile])description (str | None)
- field name: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=1)])] [Required]¶
A unique, human-readable name for this specific solution (e.g., ‘rmsnorm_triton_v1_h100’).
- Constraints:
min_length = 1
- field definition: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=1)])] [Required]¶
The name of the Definition this implementation solves.
- Constraints:
min_length = 1
- field author: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=1)])] [Required]¶
The name of the author or agent system that created this solution.
- Constraints:
min_length = 1
- field spec: BuildSpec [Required]¶
Technical specifications for building and executing this solution.
- field sources: List[SourceFile] [Required]¶
Array of source code files representing the complete implementation.
- Constraints:
min_length = 1
- field description: str | None = None¶
Optional human-readable description of the solution’s technique or approach.
- get_entry_source() SourceFile | None¶
Get the entry source file specified in the build spec.
- Returns:
The SourceFile object containing the entry point, or None if not found.
- Return type:
Optional[SourceFile]
- requires_build() bool¶
Check if the solution requires a build step.
- Returns:
True if the solution requires building (has build commands or uses CUDA), False otherwise.
- Return type:
bool
- class flashinfer_bench.data.SupportedLanguages¶
Supported programming languages for solution implementations.
Enumeration of programming languages that can be used to implement solutions for computational workloads.
- PYTHON = 'python'¶
Python programming language.
- TRITON = 'triton'¶
Triton GPU programming language.
- CUDA = 'cuda'¶
CUDA C++ programming language.
- __new__(value)¶
- pydantic model flashinfer_bench.data.SourceFile¶
A single source code file in a solution implementation.
Represents a source code file with its relative path and complete content. The file content is validated for syntax correctness based on the file extension.
Show JSON schema
{ "title": "SourceFile", "description": "A single source code file in a solution implementation.\n\nRepresents a source code file with its relative path and complete content.\nThe file content is validated for syntax correctness based on the file extension.", "type": "object", "properties": { "path": { "description": "The relative path of the file, including its name and extension (e.g., 'src/kernel.cu',\n'main.py'). When compiling the solution, a temporary solution source directory will be\ncreated, and the file will be placed according to this path.", "minLength": 1, "title": "Path", "type": "string" }, "content": { "description": "The complete text content of the source file.", "minLength": 1, "title": "Content", "type": "string" } }, "required": [ "path", "content" ] }
- Fields:
path (str)content (str)
- field path: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=1)])] [Required]¶
The relative path of the file, including its name and extension (e.g., ‘src/kernel.cu’, ‘main.py’). When compiling the solution, a temporary solution source directory will be created, and the file will be placed according to this path.
The relative path of the file, including its name and extension (e.g., ‘src/kernel.cu’, ‘main.py’). When compiling the solution, a temporary solution source directory will be created, and the file will be placed according to this path.
- Constraints:
min_length = 1
- field content: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=1)])] [Required]¶
The complete text content of the source file.
- Constraints:
min_length = 1
- pydantic model flashinfer_bench.data.BuildSpec¶
Build specification for a solution implementation.
Contains all technical specifications required to build and execute a solution, including language, hardware targets, dependencies, entry point, and build commands.
Show JSON schema
{ "title": "BuildSpec", "description": "Build specification for a solution implementation.\n\nContains all technical specifications required to build and execute a solution, including\nlanguage, hardware targets, dependencies, entry point, and build commands.", "type": "object", "properties": { "language": { "$ref": "#/$defs/SupportedLanguages", "description": "The primary programming language (e.g., 'triton', 'cuda', 'python')." }, "target_hardware": { "description": "List of hardware architectures this solution is compatible with (e.g., 'NVIDIA_H100',\n'NVIDIA_B200').", "items": { "type": "string" }, "minItems": 1, "title": "Target Hardware", "type": "array" }, "entry_point": { "description": "The exact path to the function to be called. Format: '{file_path}::{function_name}'\n(e.g., 'main.py::run').", "minLength": 1, "title": "Entry Point", "type": "string" }, "dependencies": { "anyOf": [ { "items": { "minLength": 1, "type": "string" }, "type": "array" }, { "type": "null" } ], "default": [], "description": "Optional list of required libraries or toolchains (e.g., 'CUDA >= 12.0',\n'triton >= 2.2').", "title": "Dependencies" } }, "$defs": { "SupportedLanguages": { "description": "Supported programming languages for solution implementations.\n\nEnumeration of programming languages that can be used to implement\nsolutions for computational workloads.", "enum": [ "python", "triton", "cuda" ], "title": "SupportedLanguages", "type": "string" } }, "required": [ "language", "target_hardware", "entry_point" ] }
- Fields:
language (flashinfer_bench.data.solution.SupportedLanguages)target_hardware (List[str])entry_point (str)dependencies (List[str] | None)
- field language: SupportedLanguages [Required]¶
The primary programming language (e.g., ‘triton’, ‘cuda’, ‘python’).
- field target_hardware: List[str] [Required]¶
List of hardware architectures this solution is compatible with (e.g., ‘NVIDIA_H100’, ‘NVIDIA_B200’).
List of hardware architectures this solution is compatible with (e.g., ‘NVIDIA_H100’, ‘NVIDIA_B200’).
- Constraints:
min_length = 1
- field entry_point: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=1)])] [Required]¶
The exact path to the function to be called. Format: ‘{file_path}::{function_name}’ (e.g., ‘main.py::run’).
The exact path to the function to be called. Format: ‘{file_path}::{function_name}’ (e.g., ‘main.py::run’).
- Constraints:
min_length = 1
- field dependencies: List[Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=1)])]] | None = []¶
Optional list of required libraries or toolchains (e.g., ‘CUDA >= 12.0’, ‘triton >= 2.2’).
Optional list of required libraries or toolchains (e.g., ‘CUDA >= 12.0’, ‘triton >= 2.2’).