-
Notifications
You must be signed in to change notification settings - Fork 15
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
sekyondaMeta
wants to merge
12
commits into
pytorch-labs:main
Choose a base branch
from
sekyondaMeta:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
9c8b3c6
Add Helion Puzzles
sekyondaMeta d1074d3
Adding Examples and Helion Puzzle
sekyondaMeta 84724e0
Merge branch 'pytorch-labs:main' into main
sekyondaMeta b1156ef
Merge branch 'pytorch-labs:main' into main
sekyondaMeta f8e3e7b
Update docs/Makefile
sekyondaMeta d11c0ed
Update docs/Makefile
sekyondaMeta fb673a7
GeneratePython and lint updates
sekyondaMeta 74dc53c
Update to use Sphinx Gallery
sekyondaMeta c1006ae
Update .gitignore
sekyondaMeta 046372c
Update examples/README.rst
sekyondaMeta d99c7bb
Update examples/README.rst
sekyondaMeta 7625aaa
Merge branch 'main' into main
sekyondaMeta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import os | ||
EXAMPLES_DIR = '../../examples' # Adjust as needed | ||
RST_DIR = './examples' # Relative to your Sphinx source dir | ||
example_files = [ | ||
'add.py', | ||
'all_gather_matmul.py', | ||
'attention.py', | ||
'bmm.py', | ||
'concatenate.py', | ||
'cross_entropy.py', | ||
'embedding.py', | ||
'exp.py', | ||
'fp8_attention.py', | ||
'fp8_gemm.py', | ||
'jagged_dense_add.py', | ||
'jagged_mean.py', | ||
'long_sum.py', | ||
'matmul.py', | ||
'matmul_layernorm.py', | ||
'matmul_split_k.py', | ||
'moe_matmul_ogs.py', | ||
'rms_norm.py', | ||
'segment_reduction.py', | ||
'softmax.py', | ||
'sum.py', | ||
'template_via_closure.py', | ||
] | ||
os.makedirs(RST_DIR, exist_ok=True) | ||
for fname in example_files: | ||
base = os.path.splitext(fname)[0] | ||
# Capitalize and replace underscores with spaces for nicer titles | ||
title = base.replace('_', ' ').title() | ||
rst_path = os.path.join(RST_DIR, f"{base}.rst") | ||
with open(rst_path, "w") as f: | ||
f.write(f"""{title} | ||
{'=' * len(title)} | ||
.. literalinclude:: {os.path.join(EXAMPLES_DIR, fname)} | ||
:language: python | ||
:linenos: | ||
""") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
Examples | ||
======== | ||
|
||
Examples showing the use of Helios in various scenarios. | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
examples/add | ||
sekyondaMeta marked this conversation as resolved.
Show resolved
Hide resolved
|
||
examples/all_gather_matmul | ||
examples/attention | ||
examples/bmm | ||
examples/concatenate | ||
examples/cross_entropy | ||
examples/embedding | ||
examples/exp | ||
examples/fp8_attention | ||
examples/fp8_gemm | ||
examples/jagged_dense_add | ||
examples/jagged_mean | ||
examples/long_sum | ||
examples/matmul | ||
examples/matmul_layernorm | ||
examples/matmul_split_k | ||
examples/moe_matmul_ogs | ||
examples/rms_norm | ||
examples/segment_reduction | ||
examples/softmax | ||
examples/sum | ||
examples/template_via_closure |
sekyondaMeta marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Add | ||
=== | ||
.. literalinclude:: ../../examples/add.py | ||
:language: python | ||
:linenos: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
All Gather Matmul | ||
================= | ||
.. literalinclude:: ../../examples/all_gather_matmul.py | ||
:language: python | ||
:linenos: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Attention | ||
========= | ||
.. literalinclude:: ../../examples/attention.py | ||
:language: python | ||
:linenos: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Bmm | ||
=== | ||
.. literalinclude:: ../../examples/bmm.py | ||
:language: python | ||
:linenos: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Concatenate | ||
=========== | ||
.. literalinclude:: ../../examples/concatenate.py | ||
:language: python | ||
:linenos: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Cross Entropy | ||
============= | ||
.. literalinclude:: ../../examples/cross_entropy.py | ||
:language: python | ||
:linenos: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Embedding | ||
========= | ||
.. literalinclude:: ../../examples/embedding.py | ||
:language: python | ||
:linenos: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Exp | ||
=== | ||
.. literalinclude:: ../../examples/exp.py | ||
:language: python | ||
:linenos: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Fp8 Attention | ||
============= | ||
.. literalinclude:: ../../examples/fp8_attention.py | ||
:language: python | ||
:linenos: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Fp8 Gemm | ||
======== | ||
.. literalinclude:: ../../examples/fp8_gemm.py | ||
:language: python | ||
:linenos: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Jagged Dense Add | ||
================ | ||
.. literalinclude:: ../../examples/jagged_dense_add.py | ||
:language: python | ||
:linenos: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Jagged Mean | ||
=========== | ||
.. literalinclude:: ../../examples/jagged_mean.py | ||
:language: python | ||
:linenos: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Long Sum | ||
======== | ||
.. literalinclude:: ../../examples/long_sum.py | ||
:language: python | ||
:linenos: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Matmul | ||
====== | ||
.. literalinclude:: ../../examples/matmul.py | ||
:language: python | ||
:linenos: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Matmul Layernorm | ||
================ | ||
.. literalinclude:: ../../examples/matmul_layernorm.py | ||
:language: python | ||
:linenos: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Matmul Split K | ||
============== | ||
.. literalinclude:: ../../examples/matmul_split_k.py | ||
:language: python | ||
:linenos: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Moe Matmul Ogs | ||
============== | ||
.. literalinclude:: ../../examples/moe_matmul_ogs.py | ||
:language: python | ||
:linenos: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Rms Norm | ||
======== | ||
.. literalinclude:: ../../examples/rms_norm.py | ||
:language: python | ||
:linenos: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Segment Reduction | ||
================= | ||
.. literalinclude:: ../../examples/segment_reduction.py | ||
:language: python | ||
:linenos: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Softmax | ||
======= | ||
.. literalinclude:: ../../examples/softmax.py | ||
:language: python | ||
:linenos: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Sum | ||
=== | ||
.. literalinclude:: ../../examples/sum.py | ||
:language: python | ||
:linenos: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Template Via Closure | ||
==================== | ||
.. literalinclude:: ../../examples/template_via_closure.py | ||
:language: python | ||
:linenos: |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.