Skip to content

[Docs] Add docstrings to JIT kernel include headers - #19770

Merged
BBuf merged 4 commits into
sgl-project:mainfrom
xingsy97:jit-kernel-include-docs
Mar 7, 2026
Merged

BBuf merged 4 commits into
sgl-project:mainfrom
xingsy97:jit-kernel-include-docs

Conversation

@xingsy97

@xingsy97 xingsy97 commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

Motivation

See #17035 (Future Work -> Better documentation)

Headers under jit_kernel/include/sgl_kernel/ have few or no comments. Add doxygen-style doc comments and a reference table in the dev guide.

Modifications

Add doc comments to all 12 headers under jit_kernel/include/sgl_kernel/ (atomic, cta, math, runtime, source_location, tensor, tile, type, utils.cuh, utils.h, vec, warp). No functional changes.

Add "C++ Include Library Reference" section to docs/developer_guide/development_jit_kernel_guide.md.

Checklist

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Mar 3, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 improves the documentation for the JIT kernel infrastructure by adding detailed docstrings to its core C++/CUDA header files. This effort aims to make the codebase more accessible and understandable for developers, particularly new contributors, by clarifying the purpose and usage of various components. Additionally, a new reference section has been integrated into the developer guide to provide a high-level overview of these headers.

Highlights

  • Improved JIT Kernel Documentation: Added comprehensive Doxygen-style docstrings to 12 C++/CUDA header files within the python/sglang/jit_kernel/include/sgl_kernel/ directory, enhancing clarity for new contributors.
  • Developer Guide Update: Introduced a new 'C++ Include Library Reference' section in the development_jit_kernel_guide.md file, providing a summary table of each JIT kernel header and its key APIs.
  • No Functional Changes: All modifications are purely documentation-related, ensuring no changes to the existing functionality or behavior of the JIT kernel.

🧠 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.

Changelog
  • docs/developer_guide/development_jit_kernel_guide.md
    • Added a new section 'C++ Include Library Reference' to document JIT kernel headers.
  • python/sglang/jit_kernel/include/sgl_kernel/atomic.cuh
    • Added Doxygen-style file and function docstrings for atomic.cuh and max.
  • python/sglang/jit_kernel/include/sgl_kernel/cta.cuh
    • Added Doxygen-style file and function docstrings for cta.cuh and reduce_max.
  • python/sglang/jit_kernel/include/sgl_kernel/math.cuh
    • Added Doxygen-style file and function docstrings for math.cuh and various math functions/constants.
  • python/sglang/jit_kernel/include/sgl_kernel/runtime.cuh
    • Added Doxygen-style file docstrings for runtime.cuh.
  • python/sglang/jit_kernel/include/sgl_kernel/source_location.h
    • Added Doxygen-style file docstrings for source_location.h.
  • python/sglang/jit_kernel/include/sgl_kernel/tensor.h
    • Added Doxygen-style file and struct docstrings for tensor.h, SymbolicSize, SymbolicDType, SymbolicDevice, and TensorMatcher.
  • python/sglang/jit_kernel/include/sgl_kernel/tile.cuh
    • Added Doxygen-style file and struct docstrings for tile.cuh and Memory.
  • python/sglang/jit_kernel/include/sgl_kernel/type.cuh
    • Added Doxygen-style file and template docstrings for type.cuh, packed_t, and device::cast.
  • python/sglang/jit_kernel/include/sgl_kernel/utils.cuh
    • Added Doxygen-style file and macro/function/struct docstrings for utils.cuh, SGL_DEVICE, kWarpThreads, kFullMask, PDLWaitPrimary, PDLTriggerSecondary, pointer::offset, host::RuntimeDeviceCheck, and host::LaunchKernel.
  • python/sglang/jit_kernel/include/sgl_kernel/utils.h
    • Added Doxygen-style file and struct/function docstrings for utils.h, DebugInfo, PanicError, panic, RuntimeCheck, div_ceil, dtype_bytes, and irange.
  • python/sglang/jit_kernel/include/sgl_kernel/vec.cuh
    • Added Doxygen-style file and struct docstrings for vec.cuh, uint_trait, sized_int, AlignedStorage, and AlignedVector.
  • python/sglang/jit_kernel/include/sgl_kernel/warp.cuh
    • Added Doxygen-style file and function docstrings for warp.cuh, kFullMask, reduce_sum, and reduce_max.
Activity
  • No human activity has been recorded on this pull request since its creation.
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.

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

Copy link
Copy Markdown
Contributor

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 adds Doxygen-style documentation to several JIT kernel headers and a reference table to the developer guide. My review found one area where the documentation could be made more complete and consistent. Otherwise, the changes appear to be in order.

Comment thread python/sglang/jit_kernel/include/sgl_kernel/utils.cuh Outdated
@xingsy97
xingsy97 force-pushed the jit-kernel-include-docs branch from 8a9af7e to 1f7c7ab Compare March 3, 2026 10:02
@xingsy97
xingsy97 marked this pull request as ready for review March 3, 2026 10:19
Comment thread python/sglang/jit_kernel/include/sgl_kernel/tile.cuh Outdated
Comment thread python/sglang/jit_kernel/include/sgl_kernel/runtime.cuh Outdated
Comment thread python/sglang/jit_kernel/include/sgl_kernel/math.cuh Outdated
Comment thread docs/developer_guide/development_jit_kernel_guide.md Outdated
Comment thread python/sglang/jit_kernel/include/sgl_kernel/type.cuh Outdated
Comment thread python/sglang/jit_kernel/include/sgl_kernel/utils.cuh Outdated
@xingsy97
xingsy97 requested a review from yuan-luo as a code owner March 4, 2026 10:42
@xingsy97
xingsy97 requested a review from DarkSharpness March 4, 2026 10:42
@BBuf

BBuf commented Mar 7, 2026

Copy link
Copy Markdown
Collaborator

@xingsy97 Can you rebase the pr and we can merge it.

@xingsy97
xingsy97 force-pushed the jit-kernel-include-docs branch from 7c255b2 to f72b175 Compare March 7, 2026 03:48
xingsy97 added 3 commits March 7, 2026 11:54
Add doxygen-style doc comments to the 13 headers under
jit_kernel/include/sgl_kernel/. Also add a header reference
table to the JIT kernel dev guide.

Part of sgl-project#17035.
@xingsy97
xingsy97 force-pushed the jit-kernel-include-docs branch from f72b175 to eaebccd Compare March 7, 2026 03:55
}

/// \brief Returns sin(a).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Remove this empty line.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@xingsy97

xingsy97 commented Mar 7, 2026

Copy link
Copy Markdown
Contributor Author

@xingsy97 Can you rebase the pr and we can merge it.

@BBuf rebased and ready for merge now

@BBuf

BBuf commented Mar 7, 2026

Copy link
Copy Markdown
Collaborator

@xingsy97 Can you rebase the pr and we can merge it.

@BBuf rebased and ready for merge now

Merged, thanks!

@BBuf
BBuf merged commit f8d4eb7 into sgl-project:main Mar 7, 2026
55 of 63 checks passed
@xingsy97
xingsy97 deleted the jit-kernel-include-docs branch March 7, 2026 18:25
Wangzheee pushed a commit to Wangzheee/sglang that referenced this pull request Mar 21, 2026
JustinTong0323 pushed a commit to JustinTong0323/sglang that referenced this pull request Apr 7, 2026
Chronostasys pushed a commit to MindLab-Research/sglang that referenced this pull request Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants