Skip to content
This repository was archived by the owner on Apr 6, 2026. It is now read-only.

feat: generate docs from build file and source - #89

Closed
drbh wants to merge 3 commits into
mainfrom
add-document-gen
Closed

feat: generate docs from build file and source#89
drbh wants to merge 3 commits into
mainfrom
add-document-gen

Conversation

@drbh

@drbh drbh commented Mar 21, 2025

Copy link
Copy Markdown
Collaborator

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 thread scripts/gen-docs.py Outdated
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
Copy Markdown
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).

@drbh

drbh commented Jul 31, 2025

Copy link
Copy Markdown
Collaborator Author

closing for now but will open an improved PR

@drbh drbh closed this Jul 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants