Skip to content

Adding Examples to the Helion Docs/site #330

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

sekyondaMeta
Copy link

PR adds examples to the helion docs site:
Helion Puzzles is taken from a bento notebook created internally
The rest are examples taken from the .pys taken from examples/ folder.
Updates include:

  • Update to makefile to generate the .rst examples from the .py
  • Docstrings added to the .py examples to add some clarification
  • Minor adjustments to index.md and installation .md for organization

Some mock ups below built locally

Screenshot 2025-07-17 at 11 11 12 Screenshot 2025-07-17 at 11 10 39 Screenshot 2025-07-17 at 11 09 27

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 17, 2025
Copy link
Contributor

@jansel jansel left a comment

Choose a reason for hiding this comment

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

pre-commit run --all-files or ./lint.sh can help fix the lint errors.

For the tests you will need to run EXPECTTEST_ACCEPT=1 pytest test to update expected results to include addeded docstrings.

@@ -0,0 +1,736 @@
Helion Puzzles
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make this a markdown file?

Copy link
Author

Choose a reason for hiding this comment

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

sphinx gallery has issues with markdown files but I am investigating myst sphinx gallery which should work with markdown, will update

Copy link
Contributor

Choose a reason for hiding this comment

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

Our docs requirements are here:

helion/pyproject.toml

Lines 31 to 38 in 6c5c4ca

docs = [
"sphinx",
"myst-parser",
"sphinx-rtd-theme",
"sphinx-autodoc-typehints",
"linkify-it-py",
"sphinx-autobuild"
]

Installed with pip install ".[docs]" (see docs/README.md)

Let's update that rather than creating a new file.

Copy link
Author

Choose a reason for hiding this comment

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

Oh sure, will update that, did not see this. Thanks

@@ -1,3 +1,14 @@
"""
All-Gather Matrix Multiplication Example
===============================>>>>>>> REPLACE
Copy link
Contributor

Choose a reason for hiding this comment

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

REPLACE?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for catching that, will update it, not sure how I missed it but might explain a random issue I was having with this file rendering

- ``jagged_dense_add.py``: Addition between a jagged tensor and a dense tensor
- ``jagged_mean.py``: Computing the mean of each row in a jagged tensor
- ``segment_reduction.py``: Segmented reduction operation
- ``moe_matmul_ogs.py``: Mixture-of-Experts matrix multiplication using Outer-Gather-Scatter
Copy link
Contributor

Choose a reason for hiding this comment

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

@yf225 is this the right section?

@@ -1,3 +1,13 @@
"""
Attention Mechanism Example
Copy link
Contributor

Choose a reason for hiding this comment

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

(thoughout) I think "Mechanism" is the wrong word here.

Copy link
Author

Choose a reason for hiding this comment

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

Will update this

@@ -1,4 +1,14 @@
# Code based on https://github.com/pytorch-labs/helion/issues/237
Copy link
Contributor

Choose a reason for hiding this comment

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

We should keep this citation

Copy link
Author

Choose a reason for hiding this comment

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

Ooops will put that back

@jansel
Copy link
Contributor

jansel commented Jul 25, 2025

I think you also need to rebase to fix merge conflict.

@jansel
Copy link
Contributor

jansel commented Jul 26, 2025

Lints/tests are failing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants