Skip to content

feat: generate docs from build file and source #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

drbh
Copy link
Collaborator

@drbh drbh commented Mar 21, 2025

This PR adds a new script that generates markdown documents for each kernel based on the build.toml and the supplied source code.

TODO

  • generate docs from config and source
  • ensure signatures are parsed correctly for all exampels

Examples

uv run scripts/gen-docs.py examples/relu

this creates a new doc located here examples/relu/docs/relu.md

(contents shown below *updated)

relu Documentation

Generated on 2025-03-25

Table of Contents

Project Overview

relu is a CUDA kernel project.

Build Configuration

Kernels

activation

CUDA Capabilities:

  • ['7.0', '7.2', '7.5', '8.0', '8.6', '8.7', '8.9', '9.0']

Source Files:

  • relu_kernel/relu.cu

Dependencies:

  • torch

operations

relu(Tensor! out, Tensor input) -> ()

defined

Comment on lines 110 to 118
# Also collect all other source files
for ext in [".cu", ".h", ".cpp", ".cuh"]:
extra_files = []
for p in Path(project_path).glob(f"**/*{ext}"):
# avoid adding `torch-ext` files
if "torch-ext" in str(p):
continue
if p not in source_files:
extra_files.append(p)
Copy link
Member

Choose a reason for hiding this comment

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

Is there any reason for doing this? As far as kernel-builder is concerned, unspecified source files do not exist (are not added to the sandbox).

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