Skip to content

Conversation

@Ubospica
Copy link
Collaborator

@Ubospica Ubospica commented Jan 23, 2026

This PR enhances API docs by adding the workload docs and refining other docs.

Signed-off-by: Ubospica ubospica@gmail.com

Summary by CodeRabbit

  • Documentation
    • Updated API reference navigation to prioritize data-oriented docs.
    • Renamed and reworded data/schema documentation for clearer Python API guidance.
    • Added a new Workload section with schema, examples, and storage details.
    • Made Trace fields optional and clarified relationships among Workload, Solution, Definition, and Evaluation.
    • Clarified agent module wording and added notes on JSON Schema versioning and schema-generation tooling.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 23, 2026

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Reorganizes API docs to reference data-oriented pages instead of schema, introduces a new Workload component and dedicated Workload documentation, makes solution/workload/evaluation optional in the Trace schema, updates several doc pages and wording, and applies a minor docstring formatting tweak in flashinfer_bench/apply/apply_api.py.

Changes

Cohort / File(s) Summary
API Index
docs/api/index.md
Replaced rst/schema with rst/data and reordered toctree entries to include rst/data and rst/tracing.
Agents API doc
docs/api/rst/agents.md
Reworded module description, removed schema-generation bullet, added JSON Schema versioning note, and documented new functions (flashinfer_bench_run_sanitizer, extract_solution_to_files, pack_solution_from_files) before function_to_schema.
Data API doc
docs/api/rst/data.md
Renamed title to flashinfer_bench.data, rephrased intro to describe Python API for Trace Schema, and switched toctree entries from schema_* to data_*.
Trace docs (structure & schema)
docs/flashinfer_trace/flashinfer_trace.md, docs/flashinfer_trace/trace.md, docs/flashinfer_trace/solution.md
Added Workload as a distinct component; rewrote Trace semantics so solution and evaluation are optional (workload-only traces allowed); updated evaluation fields and linkage semantics.
Workload documentation (new file)
docs/flashinfer_trace/workload.md
New file defining the Workload JSON schema, input descriptor types (random, scalar, safetensors), storage format, and examples.
Code docstring tweak
flashinfer_bench/apply/apply_api.py
Minor re-indentation in the apply(...) docstring; no functional changes.

Sequence Diagram(s)

(omitted — changes are documentation and schema reorganizations without new multi-component runtime control flow)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • YiyanZhai

Poem

🐰 A Workload hopped into docs, tidy and neat,
Traces can rest or run — now optional and sweet,
Data pages guide readers down an ordered way,
Small doc tweaks hopped in, then bounded off to play,
Hop, hop — the rabbit stamps a tiny, joyful beat!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs: Enhance agent and API docs' directly relates to the main changes in this PR, which involve enhancing API documentation, adding workload documentation, and refining agent and data documentation across multiple markdown files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Ubospica, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the API and agent documentation for FlashInfer-Bench. The primary focus is on improving the clarity and structure of the data schema documentation, notably by introducing a distinct Workload component and providing comprehensive details on its structure and usage. These changes aim to make the dataset's organization and the roles of its core components more understandable for users and developers.

Highlights

  • Documentation Restructuring: The API documentation for data schemas has been significantly reorganized, renaming 'schema' related files and references to 'data' for improved clarity and consistency across the documentation.
  • New Workload Documentation: A dedicated and detailed documentation page for the Workload concept has been added, defining its JSON schema, structure, and providing comprehensive examples for various scenarios.
  • Enhanced Trace and Solution Descriptions: The documentation for Trace and Solution components has been updated to align with the newly introduced Workload concept, clarifying their relationships, optional fields, and how they are linked within the dataset.
  • Agent Module Clarification: The flashinfer_bench.agents module documentation has been refined to better describe its tools and how JSON Schema versions are provided, removing previous ambiguities.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@Ubospica
Copy link
Collaborator Author

cc @YiyanZhai

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly enhances the documentation for the FlashInfer-Bench project, focusing on the API and the FlashInfer Trace schema. Key improvements include a clearer structure for API references, a dedicated and detailed document for the 'Workload' component, and refined descriptions across various schema-related files. The changes improve readability, consistency, and navigation through the documentation, making it easier for users to understand the core components and their relationships. A minor formatting adjustment was also made in the apply_api.py file.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@docs/flashinfer_trace/workload.md`:
- Around line 33-36: Add blank lines immediately before the table that follows
the "Additional fields for type `scalar`:" heading and immediately after the
table so it is separated from surrounding paragraphs (this satisfies
markdownlint MD058); locate the table block (the pipe-delimited rows including
the header row "| **Field** | **Type** | **Required** | **Description** |") and
insert one blank line above and one blank line below it.

@Ubospica Ubospica force-pushed the main-dev/2025-01-22-enhance-docs branch from d11d2c5 to d57fdd5 Compare January 23, 2026 06:47
Signed-off-by: Ubospica <ubospica@gmail.com>
@Ubospica Ubospica force-pushed the main-dev/2025-01-22-enhance-docs branch from d57fdd5 to 69d8a6b Compare January 23, 2026 06:47
Signed-off-by: Ubospica <ubospica@gmail.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/flashinfer_trace/trace.md (1)

29-37: Fix the contradiction between required fields and nullable table.

Lines 34-35 mark correctness and performance as Required (Yes), but the nullable table at lines 64-72 explicitly states these fields can be None depending on the status. This is a direct contradiction that will confuse readers.

The "Required" column should reflect that these fields are conditionally required. Consider:

  • Changing "Yes" to "Conditional" or "See nullable table below"
  • Adding a note referencing the nullable table
  • Or restructuring to make the dependency on status clear upfront
📝 Suggested clarification

Update the table to indicate conditional requirements:

 | **Field** | **Type** | **Required** | **Description** |
 | --- | --- | --- | --- |
 | `status` | string | Yes | The final status of the evaluation run. Has to be one of the following:
 `"PASSED"`, `"INCORRECT_SHAPE"`, `"INCORRECT_NUMERICAL"`, `"INCORRECT_DTYPE"`, `"RUNTIME_ERROR"`, `"COMPILE_ERROR"`. |
 | `log` | string | Yes | The embedded record of the stdout and stderr of the evaluation run. |
-| `correctness` | object | Yes | The summarized correctness results across all entries in the dataset. |
-| `performance` | object | Yes | The summarized performance metrics across all entries in the dataset. |
+| `correctness` | object | Conditional* | The summarized correctness results across all entries in the dataset. |
+| `performance` | object | Conditional* | The summarized performance metrics across all entries in the dataset. |
 | `environment` | object | Yes | A snapshot of the hardware and software execution environment. |
 | `timestamp` | string | Yes | The ISO 8601 timestamp of when this summary was generated. |
+
+\* See the nullable table below for status-dependent requirements.
🤖 Fix all issues with AI agents
In `@docs/flashinfer_trace/workload.md`:
- Around line 9-11: Clarify whether the JSONL files contain standalone Workload
objects or full Trace objects: update the description so it explicitly states
the storage unit (either "each line is a Workload object containing only the
workload fields" or "each line is a Trace object with definition and workload
populated and solution/evaluation null"), and make the examples match that
wording; reference the Trace and Workload types and the fields definition,
workload, solution, and evaluation when editing the text and/or examples so the
doc and sample JSONL lines are consistent.
♻️ Duplicate comments (1)
docs/flashinfer_trace/workload.md (1)

33-36: Add blank line before the scalar table to satisfy MD058.

The table immediately following "Additional fields for type scalar:" lacks a preceding blank line, which violates markdownlint MD058. The safetensors table (lines 40-43) correctly has a blank line before it.

🧹 Proposed fix
 Additional fields for type `scalar`:
+
 | **Field** | **Type** | **Required** | **Description** |
 | --- | --- | --- | --- |
 | `value` | int, float, bool | **Yes** | The concrete value of the input. |
🧹 Nitpick comments (4)
docs/flashinfer_trace/workload.md (1)

29-36: Consider documenting that random type has no additional required fields.

The documentation covers additional fields for scalar and safetensors types but doesn't explicitly mention that random has no additional fields. Adding a brief note would improve clarity for readers.

📝 Suggested addition
 | `type` | string | **Yes** | Data source type. Could be `random`, `scalar`, or `safetensors`. |

+The type `random` requires no additional fields; tensors will be generated with random values matching the shape and dtype specified in the Definition.
+
 Additional fields for type `scalar`:
docs/flashinfer_trace/trace.md (3)

7-9: Clarify the purpose of a Trace without solution/evaluation.

The statement that a Trace "describes a workload entry in the dataset" when solution and evaluation are omitted is unclear. What is the intended use case for a Trace object that only contains a workload reference? If the goal is simply to store workload configurations, wouldn't it be more straightforward to use the Workload object directly?

Consider adding a brief explanation of when and why users would create a Trace without evaluation results, or provide an example demonstrating this use case.


64-72: Consider clarifying environment and timestamp requirements for error statuses.

The nullable table addresses correctness and performance but doesn't mention environment and timestamp, which are marked as always required in the evaluation schema. Should environment information and timestamps be available for all error types, including COMPILE_ERROR?

If these fields should always be present regardless of status, consider adding a note confirming this. If they can be absent for certain error cases, update the nullable table accordingly.


74-121: Consider adding examples for optional and error cases.

The current example demonstrates a successful run with all fields populated, which is helpful. However, the documentation would benefit from additional examples showing:

  1. A Trace with optional solution and evaluation fields omitted (as described in lines 7-9)
  2. An error case (e.g., INCORRECT_NUMERICAL or COMPILE_ERROR) demonstrating the nullable correctness/performance fields

These examples would clarify the optional/nullable behavior described in the schema.

Comment on lines +9 to +11
**Storage Format:** In the FlashInfer-Bench dataset, a standalone Workload is stored using the [Trace](trace.md) data structure with only the `definition` and `workload` fields populated, while `solution` and `evaluation` are set to `null`.

In FlashInfer Trace dataset, all workloads of the same definition are stored in a single JSONL file where each line is a `Workload` object.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Clarify the storage format description vs. examples.

Line 11 states "each line is a Workload object," but the examples (lines 47-75 and 79-99) show full Trace objects containing definition, workload, solution, and evaluation fields. Consider clarifying whether JSONL files contain standalone Workload objects or Trace objects with embedded workloads.

🤖 Prompt for AI Agents
In `@docs/flashinfer_trace/workload.md` around lines 9 - 11, Clarify whether the
JSONL files contain standalone Workload objects or full Trace objects: update
the description so it explicitly states the storage unit (either "each line is a
Workload object containing only the workload fields" or "each line is a Trace
object with definition and workload populated and solution/evaluation null"),
and make the examples match that wording; reference the Trace and Workload types
and the fields definition, workload, solution, and evaluation when editing the
text and/or examples so the doc and sample JSONL lines are consistent.

Copy link
Contributor

@YiyanZhai YiyanZhai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@Ubospica Ubospica merged commit c150536 into flashinfer-ai:main Jan 24, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants