Skip to main content
flashinfer-bench serve exposes an HTTP service for evaluating submitted Solution objects against workloads in a local TraceSet. It is a benchmark evaluation service, not a general model inference server.

Start The Server

Install the server dependencies first:
Then start the server against a local trace dataset:
CLI flags:

Mental Model

The server evaluates one submitted Solution asynchronously:
  • Solution: The implementation you submit to the server.
  • Task: The asynchronous evaluation job created for that submission.
  • Trace: One evaluation result for one workload under that task.
One task may produce multiple traces because the same solution can be evaluated on multiple workloads. Two status layers matter:
  • task.status tracks task lifecycle: pending, running, completed, or failed.
  • traces[*].evaluation.status tracks the actual evaluation result for each workload, such as PASSED, COMPILE_ERROR, RUNTIME_ERROR, or TIMEOUT.
task.status = completed only means the task finished running. It does not mean the solution passed correctness checks.

API Reference

GET /definitions

Purpose List available definitions in the loaded TraceSet. Request No request body. Response Returns an array of definition summaries. Example response:
Errors No endpoint-specific error behavior beyond standard server failures.

GET /definitions/{name}

Purpose Return the full serialized Definition object for one definition. Request Path parameters: Response Returns the full serialized Definition object. Use this endpoint when you need the exact contract before writing a passing solution. Errors
  • 404: Definition not found.

GET /definitions/{name}/workloads

Purpose List workloads for one definition. Request Path parameters: Response Returns an array of serialized Workload objects. Use this endpoint to discover valid workload UUIDs for POST /evaluate. Errors
  • 404: Definition not found.

GET /workloads/{uuid}

Purpose Return one workload by UUID. Request Path parameters: Response Returns the serialized Workload object. Errors
  • 404: Workload not found.

POST /evaluate

Purpose Submit one solution for evaluation. Request Request body fields: Illustrative payload example:
This payload is illustrative only. The submitted Solution still needs to match the selected definition’s real inputs and outputs. Response Response fields: Example response:
  • The server normalizes the submitted solution name by calling Solution.with_unique_name().
  • normalized_solution_name is deterministic for the same solution content.
  • If the selected workloads are empty, the task is still created, but it later ends with task.status = failed.
Errors
  • 400: solution.definition does not exist.

GET /tasks/{task_id}

Purpose Get one task by ID. Request Path parameters: Query parameters: Response Response fields: Example response:
  • If the task is still pending or running, traces may be null.
  • If the task fails at the task level, error contains the failure reason.
Errors
  • 404: Task not found.

POST /tasks/batch

Purpose Query multiple tasks in one request. Request Request body fields: Request body example:
Response Returns an array of TaskResponse objects. Each item has the following fields:
  • Returns a list of TaskResponse objects in the same order as task_ids.
  • Duplicate task IDs are allowed and produce duplicate results.
Errors
  • 404: At least one task ID does not exist. The request is fail-fast.

GET /health

Purpose Return worker health and queue depth. Request No request body. Response Response fields: Example response:
This endpoint is intended for operational checks rather than task inspection. Errors No endpoint-specific error behavior beyond standard server failures.

POST /shutdown (Management)

Purpose Ask the current server process to exit gracefully. Request No request body. Response Response fields: Example response:
This is a management endpoint, not part of the normal submit-and-poll flow. Errors No endpoint-specific error behavior beyond standard server failures.

Polling And Error Semantics

Keep these semantics in mind when integrating with the server:
  • task.status = completed means the task finished, not that the solution passed.
  • Look at traces[*].evaluation.status for correctness and performance outcomes.
  • task.status = failed indicates task-level failures such as missing workloads or other failures that prevent evaluation from completing normally.
  • In GET /tasks/{task_id}, timeout must be in the range 0..3600.
  • In POST /tasks/batch, timeout <= 0 returns immediately and timeout > 0 waits up to the provided value.
  • POST /tasks/batch is fail-fast on invalid task IDs.

Minimal Runnable Example

This example shows the smallest end-to-end flow that works without depending on a specific kernel signature. It intentionally submits a Python solution with a syntax error, so the task should complete with COMPILE_ERROR. That makes the example portable across trace datasets as long as you choose a definition that has at least one workload. Requirements:
  • curl
  • jq
  • A running benchmark server
Expected result:
  • Top-level status should become completed.
  • traces[0].evaluation.status should be COMPILE_ERROR.
To get PASSED instead, inspect GET /definitions/{name} and implement a real solution that matches that definition’s inputs and outputs.

Notes

  • The server requires at least one CUDA device.
  • Reference results are cached per (definition, workload) inside each worker process.
  • GET /health is intended for operational checks rather than task inspection.
  • Submitted solution names are normalized before evaluation.