flashinfer_bench.data.Workload

pydantic model flashinfer_bench.data.Workload

Concrete workload configuration for benchmarking.

Defines a specific instance of a computational workload with concrete values for all variable axes and specifications for all input data. This represents an executable configuration that can be benchmarked.

Show JSON schema
{
   "title": "Workload",
   "description": "Concrete workload configuration for benchmarking.\n\nDefines a specific instance of a computational workload with concrete\nvalues for all variable axes and specifications for all input data.\nThis represents an executable configuration that can be benchmarked.",
   "type": "object",
   "properties": {
      "axes": {
         "additionalProperties": {
            "minimum": 0,
            "type": "integer"
         },
         "description": "Dictionary mapping axis names to their concrete integer values. All values must be\npositive.",
         "title": "Axes",
         "type": "object"
      },
      "inputs": {
         "additionalProperties": {
            "anyOf": [
               {
                  "$ref": "#/$defs/RandomInput"
               },
               {
                  "$ref": "#/$defs/SafetensorsInput"
               },
               {
                  "$ref": "#/$defs/ScalarInput"
               }
            ]
         },
         "description": "Dictionary mapping input names to their data specifications.",
         "title": "Inputs",
         "type": "object"
      },
      "uuid": {
         "description": "Unique identifier for this specific workload configuration.",
         "minLength": 1,
         "title": "Uuid",
         "type": "string"
      }
   },
   "$defs": {
      "RandomInput": {
         "description": "Random input generation descriptor.\n\nRepresents a specification for generating random tensor input data\nduring workload execution and benchmarking.",
         "properties": {
            "type": {
               "const": "random",
               "default": "random",
               "description": "The input type identifier for random data generation.",
               "title": "Type",
               "type": "string"
            }
         },
         "title": "RandomInput",
         "type": "object"
      },
      "SafetensorsInput": {
         "description": "Input specification for data loaded from safetensors files.\n\nRepresents tensor data that will be loaded from a safetensors file\nusing a specific tensor key within that file.",
         "properties": {
            "type": {
               "const": "safetensors",
               "default": "safetensors",
               "description": "The input type identifier for safetensors data.",
               "title": "Type",
               "type": "string"
            },
            "path": {
               "description": "Path to the safetensors file containing the tensor data. The path is relative to the root\npath of the TraceSet.",
               "minLength": 1,
               "title": "Path",
               "type": "string"
            },
            "tensor_key": {
               "description": "Key identifier for the specific tensor within the safetensors file.",
               "minLength": 1,
               "title": "Tensor Key",
               "type": "string"
            }
         },
         "required": [
            "path",
            "tensor_key"
         ],
         "title": "SafetensorsInput",
         "type": "object"
      },
      "ScalarInput": {
         "description": "Scalar literal input specification.\n\nRepresents a scalar value (integer, float, or boolean) that will be\nused as a direct input parameter to the computational workload.",
         "properties": {
            "type": {
               "const": "scalar",
               "default": "scalar",
               "description": "The input type identifier for scalar values.",
               "title": "Type",
               "type": "string"
            },
            "value": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "number"
                  },
                  {
                     "type": "boolean"
                  }
               ],
               "description": "The scalar value to be used as input. Must be int, float, or bool.",
               "title": "Value"
            }
         },
         "required": [
            "value"
         ],
         "title": "ScalarInput",
         "type": "object"
      }
   },
   "required": [
      "axes",
      "inputs",
      "uuid"
   ]
}

Fields:
  • axes (Dict[str, int])

  • inputs (Dict[str, flashinfer_bench.data.workload.RandomInput | flashinfer_bench.data.workload.SafetensorsInput | flashinfer_bench.data.workload.ScalarInput])

  • uuid (str)

field axes: Dict[str, Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0)])]] [Required]

Dictionary mapping axis names to their concrete integer values. All values must be positive.

Dictionary mapping axis names to their concrete integer values. All values must be positive.

field inputs: Dict[str, RandomInput | SafetensorsInput | ScalarInput] [Required]

Dictionary mapping input names to their data specifications.

field uuid: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=1)])] [Required]

Unique identifier for this specific workload configuration.

Constraints:
  • min_length = 1

pydantic model flashinfer_bench.data.RandomInput

Random input generation descriptor.

Represents a specification for generating random tensor input data during workload execution and benchmarking.

Show JSON schema
{
   "title": "RandomInput",
   "description": "Random input generation descriptor.\n\nRepresents a specification for generating random tensor input data\nduring workload execution and benchmarking.",
   "type": "object",
   "properties": {
      "type": {
         "const": "random",
         "default": "random",
         "description": "The input type identifier for random data generation.",
         "title": "Type",
         "type": "string"
      }
   }
}

Fields:
  • type (Literal['random'])

field type: Literal['random'] = 'random'

The input type identifier for random data generation.

pydantic model flashinfer_bench.data.ScalarInput

Scalar literal input specification.

Represents a scalar value (integer, float, or boolean) that will be used as a direct input parameter to the computational workload.

Show JSON schema
{
   "title": "ScalarInput",
   "description": "Scalar literal input specification.\n\nRepresents a scalar value (integer, float, or boolean) that will be\nused as a direct input parameter to the computational workload.",
   "type": "object",
   "properties": {
      "type": {
         "const": "scalar",
         "default": "scalar",
         "description": "The input type identifier for scalar values.",
         "title": "Type",
         "type": "string"
      },
      "value": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "number"
            },
            {
               "type": "boolean"
            }
         ],
         "description": "The scalar value to be used as input. Must be int, float, or bool.",
         "title": "Value"
      }
   },
   "required": [
      "value"
   ]
}

Fields:
  • type (Literal['scalar'])

  • value (int | float | bool)

field type: Literal['scalar'] = 'scalar'

The input type identifier for scalar values.

field value: int | float | bool [Required]

The scalar value to be used as input. Must be int, float, or bool.

pydantic model flashinfer_bench.data.SafetensorsInput

Input specification for data loaded from safetensors files.

Represents tensor data that will be loaded from a safetensors file using a specific tensor key within that file.

Show JSON schema
{
   "title": "SafetensorsInput",
   "description": "Input specification for data loaded from safetensors files.\n\nRepresents tensor data that will be loaded from a safetensors file\nusing a specific tensor key within that file.",
   "type": "object",
   "properties": {
      "type": {
         "const": "safetensors",
         "default": "safetensors",
         "description": "The input type identifier for safetensors data.",
         "title": "Type",
         "type": "string"
      },
      "path": {
         "description": "Path to the safetensors file containing the tensor data. The path is relative to the root\npath of the TraceSet.",
         "minLength": 1,
         "title": "Path",
         "type": "string"
      },
      "tensor_key": {
         "description": "Key identifier for the specific tensor within the safetensors file.",
         "minLength": 1,
         "title": "Tensor Key",
         "type": "string"
      }
   },
   "required": [
      "path",
      "tensor_key"
   ]
}

Fields:
  • type (Literal['safetensors'])

  • path (str)

  • tensor_key (str)

field type: Literal['safetensors'] = 'safetensors'

The input type identifier for safetensors data.

field path: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=1)])] [Required]

Path to the safetensors file containing the tensor data. The path is relative to the root path of the TraceSet.

Path to the safetensors file containing the tensor data. The path is relative to the root path of the TraceSet.

Constraints:
  • min_length = 1

field tensor_key: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=1)])] [Required]

Key identifier for the specific tensor within the safetensors file.

Constraints:
  • min_length = 1

flashinfer_bench.data.InputSpec

Union type representing all possible input specification types. alias of RandomInput | SafetensorsInput | ScalarInput

alias of RandomInput | SafetensorsInput | ScalarInput